Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
55e0c77
docs, tests, refactor
ayush9pandey Jul 10, 2026
a723651
updates to examples and docs
ayush9pandey Jul 12, 2026
41f4906
text edits
ayush9pandey Jul 13, 2026
e20f37c
Add induction motor and biological examples
Jenny7265 Jul 16, 2026
9376dd2
Add SEIRVD model reduction example
Jenny7265 Jul 18, 2026
020fdd7
add new notebooks, more refactoring of API
ayush9pandey Jul 19, 2026
642a47a
refactor load sbml, add working toggle swtich example
ayush9pandey Jul 19, 2026
4fc4f29
finishing up refactor, manually verified all notebooks and code
ayush9pandey Jul 21, 2026
d9cfd0b
add banner
ayush9pandey Jul 21, 2026
a469d5f
update banner
ayush9pandey Jul 21, 2026
f740f74
Merge remote-tracking branch 'upstream/v1.0' into ecological-pr
Jenny7265 Jul 27, 2026
48e9665
Adjusted according to review feedback on notebooks
Jenny7265 Jul 27, 2026
a03c0ff
test reduced models under adjusted operating conditions
Jenny7265 Aug 3, 2026
bcf5c5b
update motor control parameter testing
Jenny7265 Aug 3, 2026
d115087
update motor control notebook
Jenny7265 Aug 3, 2026
2be2ebb
Fix AutoReduce imports in motor control notebook & tested realastic p…
Jenny7265 Aug 6, 2026
f0b7b03
Fixed AutoReduce imports in motor control notebook
Jenny7265 Aug 6, 2026
169293f
Update gene expression model notebook and plots
Jenny7265 Aug 6, 2026
3740000
Update SEIRVD model notebook
Jenny7265 Aug 6, 2026
9fcaa6c
Update gene expression model notebook
Jenny7265 Aug 6, 2026
08b9156
Update motor control notebook
Jenny7265 Aug 6, 2026
b711873
Update motor control notebook
Jenny7265 Aug 6, 2026
58c746d
Add SEIRVD model notebook
Jenny7265 Aug 6, 2026
942dae1
Update SEIRVD model notebook
Jenny7265 Aug 6, 2026
9d22d8d
Remove SEIRVD notebook from ecological branch
Jenny7265 Aug 6, 2026
df69205
Merge pull request #32 from Jenny7265/ecological-pr
ayush9pandey Aug 7, 2026
fa3190d
Merge pull request #33 from Jenny7265/seirvd-pr
ayush9pandey Aug 7, 2026
2027836
remove numpy<2 requirement
ayush9pandey Aug 10, 2026
173f1e5
all notebooks final, all issues for milestone fixed
ayush9pandey Aug 11, 2026
ec3c088
fix: sort imports in test_converters.py (ruff I001)
Copilot Aug 11, 2026
9cd6843
fix docs links
ayush9pandey Aug 11, 2026
c4b01e2
Merge branch 'v1.0' of https://github.com/ayush9pandey/autoReduce int…
ayush9pandey Aug 11, 2026
58010b8
update docs nblink
ayush9pandey Aug 11, 2026
353ad4d
viral spread notebook run
ayush9pandey Aug 11, 2026
bb60248
notebook data
ayush9pandey Aug 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
branch = True
source = autoreduce
source = autoreduce

[report]
exclude_lines =
Expand All @@ -10,4 +10,4 @@ exclude_lines =
if __name__ == .__main__.:
ignore_errors = True
omit =
tests/*
tests/*
24 changes: 10 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
branches: ["main"]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.9, 3.11, 3.12]
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install autoreduce
run: pip install ".[all, test]"
run: pip install -e ".[test]"
- name: Test autoreduce
run: pytest --cov --junitxml=junit.xml -o junit_family=legacy
- name: Upload test results to Codecov
run: pytest --cov=autoreduce --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 7 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Lint

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
lint:
Expand All @@ -12,13 +15,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install ruff

- name: Run flake8
run: flake8 autoreduce tests
- name: Run ruff
run: ruff check autoreduce tests
10 changes: 9 additions & 1 deletion .github/workflows/pypi-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,23 @@ name: PyPI Deploy

on:
workflow_dispatch:
inputs:
ref:
description: "Tag, branch, or commit to build. Leave blank to use the selected ref."
required: false
default: ""

jobs:
pypi-publish:
runs-on: ubuntu-latest
permissions:
id-token: write
environment: Release Deploy
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref || github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -18,7 +27,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install build

- name: Build the package
Expand Down
25 changes: 11 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,30 @@ name: test

on:
push:
branches: ["*","!master"]
branches: ["*", "!main"]
pull_request:
branches: ["main"]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]

steps:
- uses: actions/checkout@v4
- name: show directory tree
run: ls -R .
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
python-version: "3.13"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install autoreduce
run: pip install ".[all, test]"
run: pip install -e ".[test]"
- name: Test autoreduce
run: pytest --cov --junitxml=junit.xml -o junit_family=legacy
- name: Upload test results to Codecov
run: pytest --cov=autoreduce --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/generated/

# PyBuilder
target/
Expand Down Expand Up @@ -107,3 +108,12 @@ dmypy.json

# Package specific
examples/reduced_gene_expression.xml
autoreduce/_version.py
examples/biological/models/design1_regulated_promoter.xml
examples/biological/models/example_1.xml
examples/biological/models/example1.xml
examples/biological/models/reduced_gene_expression.xml
examples/biological/models/reduced_gfp_expression.xml
*.xml
*.pptx
*.png
9 changes: 6 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ version: 2
build:
os: ubuntu-24.04
tools:
python: "3.13"
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
install:
- method: pip
path: .
extra_requirements:
- docs
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"python.pythonPath": "C:\\Users\\apand\\Anaconda3\\python.exe",
"python.pythonPath": "C:\\Users\\ayush\\anaconda3\\Scripts\\conda.exe",
"python.condaPath": "C:\\Users\\ayush\\anaconda3\\Scripts\\conda.exe",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.pycodestyleEnabled": true,
Expand Down Expand Up @@ -36,5 +37,7 @@
"black-formatter.args": [
"--line-length",
"79"
]
],
"python-envs.defaultEnvManager": "ms-python.python:conda",
"python-envs.defaultPackageManager": "ms-python.python:conda"
}
1,467 changes: 0 additions & 1,467 deletions IJRNC_examples/gene expression analysis.ipynb

This file was deleted.

924 changes: 0 additions & 924 deletions IJRNC_examples/population-control.ipynb

This file was deleted.

289 changes: 0 additions & 289 deletions IJRNC_examples/toggle-switch example.ipynb

This file was deleted.

283 changes: 0 additions & 283 deletions IJRNC_examples/two_member_population_control.ipynb

This file was deleted.

96 changes: 63 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# AutoReduce: An automated model reduction tool
# AutoReduce: An Automated Model Reduction Toolbox

Python toolbox to automatically obtain reduced model expressions using time-scale separation, conservation laws, and other assumptions.
![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)
Expand All @@ -10,41 +14,67 @@ Python toolbox to automatically obtain reduced model expressions using time-scal

## Overview

AutoReduce is a Python package for automated model reduction of SBML models. It provides tools for:
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)
- Hill function 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
- Analysis of gene expression models
- Optional python-control and PyDMD interfaces

Refer to the [bioRxiv paper](https://www.biorxiv.org/content/10.1101/2020.02.15.950840v2.full.pdf) and [Journal of Robust and Nonlinear Control paper](https://onlinelibrary.wiley.com/doi/full/10.1002/rnc.6013) for more details.
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
from autoreduce.converters import load_sbml

# Load your SBML model
sys = load_sbml('your_sbml_file.xml', outputs=['your_output'])

# Solve conservation laws
conservation_laws = sys.solve_conservation_laws(
conserved_sets=[
['species1', 'species2', 'species3'], # First conserved set
['species4', 'species5'] # Second conserved set
],
states_to_eliminate=['species_to_eliminate1', 'species_to_eliminate2']
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:

# Solve timescale separation using QSSA
reduced_qssa_model = sys.solve_timescale_separation(
['fast_species1', 'fast_species2']
)
```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
Expand All @@ -57,12 +87,20 @@ Install with all optional dependencies:
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 ".[all]"
pip install -e ".[dev]"
```

## Documentation
Expand All @@ -71,14 +109,8 @@ Full documentation is available at [autoreduce.readthedocs.io](https://autoreduc

## Contributing

We welcome contributions! Please see our [contributing guide](https://autoreduce.readthedocs.io/en/latest/contributing.html) for details.

## Versions

AutoReduce versions:
- 0.3.0 (current release): Major updates including improved API and documentation
- 0.2.0 (alpha release): `pip install autoreduce==0.2.0`
- 0.1.0 (alpha release): `pip install autoreduce==0.1.0`
We welcome contributions. Developer notes and release instructions are in the
[documentation](https://autoreduce.readthedocs.io/en/latest/develop.html).

## Contact

Expand All @@ -89,5 +121,3 @@ For questions, feedback, or suggestions, please contact:
## License

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

Copyright (c) 2025, Ayush Pandey. All rights reserved.
Loading
Loading