Metadata-Version: 2.4
Name: autoreduce
Version: 0.9
Summary: Python tools for automated model reduction of nonlinear dynamical systems
Author-email: Ayush Pandey <ayushpandey@ucmerced.edu>
License-Expression: BSD-3-Clause
Project-URL: Documentation, https://autoreduce.readthedocs.io
Project-URL: Source, https://github.com/ayush9pandey/AutoReduce
Project-URL: Tracker, https://github.com/ayush9pandey/AutoReduce/issues
Keywords: SBML,Automated Model Reduction,Modeling,QSSA,Hill functions
Requires-Python: <=3.14.7,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: python-libsbml>=5.21.1
Requires-Dist: scipy>=1.10
Requires-Dist: sympy>=1.11
Provides-Extra: all
Requires-Dist: control; extra == "all"
Requires-Dist: matplotlib; extra == "all"
Requires-Dist: pydmd; extra == "all"
Requires-Dist: seaborn; extra == "all"
Requires-Dist: pandas; extra == "all"
Requires-Dist: biocrnpyler; extra == "all"
Provides-Extra: control
Requires-Dist: control; extra == "control"
Provides-Extra: dmd
Requires-Dist: pydmd; extra == "dmd"
Provides-Extra: bio
Requires-Dist: biocrnpyler; extra == "bio"
Provides-Extra: docs
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: nbsphinx-link; extra == "docs"
Requires-Dist: numpydoc; extra == "docs"
Requires-Dist: pandoc; extra == "docs"
Requires-Dist: recommonmark; extra == "docs"
Requires-Dist: setuptools-scm; extra == "docs"
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-copybutton; extra == "docs"
Requires-Dist: sphinx-math-dollar; extra == "docs"
Requires-Dist: sphinx-toggleprompt; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: ipykernel; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Requires-Dist: nbconvert; extra == "dev"
Requires-Dist: nbformat; extra == "dev"
Requires-Dist: nbsphinx; extra == "dev"
Requires-Dist: nbsphinx-link; extra == "dev"
Requires-Dist: numpydoc; extra == "dev"
Requires-Dist: pandoc; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Requires-Dist: recommonmark; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: setuptools-scm; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-copybutton; extra == "dev"
Requires-Dist: sphinx-math-dollar; extra == "dev"
Requires-Dist: sphinx-toggleprompt; extra == "dev"
Requires-Dist: sphinx_rtd_theme; extra == "dev"
Provides-Extra: test
Requires-Dist: ipykernel; extra == "test"
Requires-Dist: jupyter; extra == "test"
Requires-Dist: nbconvert; extra == "test"
Requires-Dist: nbformat; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-xdist; extra == "test"
Requires-Dist: matplotlib; extra == "test"
Requires-Dist: pandas; extra == "test"
Dynamic: license-file

# AutoReduce: An Automated Model Reduction Toolbox

![AutoReduce banner](graphics/autoreduce_banner.png)

Python toolbox to obtain reduced model expressions using time-scale
separation, conservation laws, sensitivity analysis, and projection-based
interfaces to established reduction libraries.

[![Build](https://github.com/ayush9pandey/autoreduce/actions/workflows/build.yml/badge.svg)](https://github.com/ayush9pandey/autoreduce/actions/workflows/build.yml)
[![Lint](https://github.com/ayush9pandey/autoreduce/actions/workflows/lint.yml/badge.svg)](https://github.com/ayush9pandey/autoreduce/actions/workflows/lint.yml)
[![codecov](https://codecov.io/gh/ayush9pandey/AutoReduce/graph/badge.svg?token=h9diSMrJbj)](https://codecov.io/gh/ayush9pandey/AutoReduce)
[![PyPI version](https://badge.fury.io/py/autoreduce.svg)](https://badge.fury.io/py/autoreduce)
[![Documentation Status](https://readthedocs.org/projects/autoreduce/badge/?version=latest)](https://autoreduce.readthedocs.io/en/latest/?badge=latest)

## Overview

AutoReduce is a Python package for automated model reduction of nonlinear
dynamical systems. It provides tools for:

- Automated model reduction using QSSA (Quasi-Steady State Approximation)
- Conservation-law based reductions
- Local sensitivity analysis
- SBML import/export through python-libsbml
- Integration with [BioCRNPyler](https://biocrnpyler.readthedocs.io/) for synthetic biology models
- Optional python-control and PyDMD interfaces

See the [bioRxiv paper](https://doi.org/10.1101/2020.02.15.950840)
and [International Journal of Robust and Nonlinear Control paper](https://doi.org/10.1002/rnc.6013)
for the model-reduction background.

## Quick Start

```python
import numpy as np
from sympy import symbols

from autoreduce import System, solve_timescale_separation

S, C, P, k1, k2, k3, E_total = symbols("S C P k1 k2 k3 E_total")

E = E_total - C
x = [S, C, P]
f = [
    -k1 * E * S + k2 * C,
    k1 * E * S - (k2 + k3) * C,
    k3 * C,
]

system = System(
    x,
    f,
    params_dict={k1: 1.0, k2: 0.5, k3: 0.25, E_total: 1.0},
    x_init=[10.0, 0.0, 0.0],
    C=np.array([[1, 0, 0], [0, 0, 1]]),
)

reduced_system, collapsed_system = solve_timescale_separation(
    system,
    [S, P],
    fast_states=[C],
)
```

`params_dict` can be used to set, get, and update parameters:

```python
system.set_param(k1, 2.0)
system.get_param(k1)
system.set_param_dict({k2: 1.0, k3: 0.1})
```

For more examples, check out the [documentation](https://autoreduce.readthedocs.io/en/latest/examples.html).

## Installation

Supported Python versions are 3.9 - 3.13.

Install the latest version of AutoReduce:

```bash
pip install autoreduce
```

Install with all optional dependencies:

```bash
pip install autoreduce[all]
```

Install optional integrations explicitly:

```bash
pip install "autoreduce[bio]"
pip install "autoreduce[control]"
pip install "autoreduce[dmd]"
```

For development installation:

```bash
git clone https://github.com/ayush9pandey/autoreduce.git
cd autoreduce
pip install -e ".[dev]"
```

## Documentation

Full documentation is available at [autoreduce.readthedocs.io](https://autoreduce.readthedocs.io/).

## Contributing

We welcome contributions. Developer notes and release instructions are in the
[documentation](https://autoreduce.readthedocs.io/en/latest/develop.html).

## Contact

For questions, feedback, or suggestions, please contact:
- Ayush Pandey (ayushpandey at ucmerced dot edu)
- [GitHub Issues](https://github.com/ayush9pandey/autoreduce/issues)

## License

Released under the BSD 3-Clause License (see `LICENSE`)
