Installation

Using pip

pip install pyreduce-astro

For Development

Clone the repository and use uv:

git clone https://github.com/ivh/PyReduce
cd PyReduce/
uv sync

This will automatically:

  • Create a virtual environment

  • Install all dependencies

  • Build the CFFI C extensions

  • Install PyReduce in editable mode

To run commands:

uv run reduce --help              # CLI
uv run pytest -m unit             # Tests
uv run python examples/uves_example.py

Building C Extensions

The C extensions are built automatically during uv sync. To manually rebuild them:

uv run reduce-build               # Build C extensions
uv run reduce-clean               # Remove compiled extensions

This is useful after modifying the C source files in pyreduce/clib/.

Platform Notes

PyReduce uses CFFI to link to C code. On non-Linux platforms you may need to install libffi. See https://cffi.readthedocs.io/en/latest/installation.html#platform-specific-instructions for details.