# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build Commands

```bash
# Install dev dependencies
pip install -e ".[test]"

# Build wheel (uses meson-python)
pip install build && python -m build

# Run all tests
pytest tests/python/

# Run single test
pytest tests/python/test_ab01md.py -v

# Run specific test function
pytest tests/python/test_ab01md.py::test_basic -v

# Parallel tests (faster)
pytest tests/python/ -n auto
```

## Architecture

C11 translation of SLICOT (Subroutine Library In COntrol Theory) with Python bindings. 578 functions across 27 categories.

### Core Structure
- `src/` - C implementations organized by 2-letter prefix (AB/, SB/, MB/, etc.)
- `include/slicot/` - Headers per prefix (ab.h, sb.h, etc.), aggregated in `slicot.h`
- `include/slicot_types.h` - Type aliases: `i32`, `i64`, `f64`, `c128`
- `python/wrappers/py_*.c` - NumPy C-API wrappers per prefix
- `python/slicot_module.c` - Main Python extension module
- `python/data/docstrings.json` - Docstring metadata (generated by `tools/generate_docstrings.py`)

### Build System
- meson-python wraps Meson for Python packaging
- Meson auto-detects BLAS/LAPACK (OpenBLAS, scipy-openblas, Accelerate)
- Static linking for wheels

### Key Conventions
- All arrays use Fortran column-major order (`order='F'` in NumPy)
- Python wrappers use `NPY_ARRAY_FARRAY` flag
- Tests in `tests/python/test_<routine>.py` mirror routine names

### macOS Note
Full test suite may crash on macOS due to Accelerate framework issues. Use `tools/run_tests_batched.py` as workaround.
