Developer Notes
This chapter contains notes for developers contributing to AutoReduce.
Package Structure
The package source is organized by model-reduction responsibility:
autoreduce.systemcontains the coreSystemrepresentation and model import adapters.autoreduce.solverscontains numerical ODE and sensitivity solvers.autoreduce.reductionscontains time-scale, conservation, abundance, and projection-based reduction methods.autoreduce.utilscontains conversion, SBML, and reduction-constructor utilities.examplesis split into biological, canonical, and ecological examples.testscontains the pytest suite.
Code Style
AutoReduce uses ruff for linting and formatting configuration. Run these commands from the repository root:
ruff check autoreduce tests
ruff format autoreduce tests
Docstrings should follow NumPy style. Public modules, classes, and functions should explain the scientific object being represented, the assumptions made, and the expected symbolic or numeric dimensions.
Testing
Install the test dependencies and run pytest:
pip install -e ".[dev]"
pytest
Run coverage explicitly when needed:
pytest --cov=autoreduce --cov-report=xml
Documentation
Documentation is built with Sphinx from the docs directory. Install the
documentation extra from the repository root:
python -m pip install -e ".[docs]"
Build the HTML documentation locally:
python -m sphinx -b html docs docs/_build/html
On Windows, if a synchronized folder or a browser locks files under
docs/_build, build to a fresh output directory instead:
python -m sphinx -b html docs %TEMP%\autoreduce-sphinx-html
Read the Docs
AutoReduce is configured for Read the Docs with .readthedocs.yaml at the
repository root. The Read the Docs project should:
Import the GitHub repository.
Use the repository configuration file,
.readthedocs.yaml.Build with the Sphinx configuration in
docs/conf.py.Install the package with the
docsextra.
The current Read the Docs configuration uses Python 3.12. Reproduce any Read the Docs failure locally by running:
python -m pip install -e ".[docs]"
python -m sphinx -b html docs docs/_build/html
Releasing New Versions
AutoReduce uses semantic versioning (MAJOR.MINOR.PATCH) and Git tags through
setuptools_scm. Package wheels and source distributions are published to
PyPI by the manual GitHub Actions release workflow.
PyPI Setup
The PyPI project should use trusted publishing from GitHub Actions. In the
PyPI project settings for autoreduce, add a trusted publisher with:
Owner:
ayush9pandeyRepository:
AutoReduceWorkflow:
pypi-deploy.ymlEnvironment:
Release Deploy
In GitHub, create the Release Deploy environment so that it matches the
workflow environment in .github/workflows/pypi-deploy.yml. Add reviewer
protection there if releases should require manual approval.
Release checklist:
Ensure the working tree is clean and CI is green.
Update documentation and examples as needed.
Run the package checks from the release environment:
python -m pip install -e ".[dev]" pytest ruff check autoreduce tests python -m sphinx -b html docs docs/_build/html python -m build --no-isolation
Commit and push all release changes.
Create an annotated tag on the release commit:
git tag -a vX.Y.Z -m "Release X.Y.Z" git push --tags
Run the PyPI release workflow from the tag or provide the tag in the workflow
refinput.Verify the published package from a clean environment:
python -m pip install autoreduce==X.Y.Z python -c "import autoreduce; print(autoreduce.__version__)"
Generated build outputs such as build/, dist/, *.egg-info, and
autoreduce/_version.py are setuptools artifacts. They must not be committed.