Metadata-Version: 2.4
Name: hybrax
Version: 0.1.0
Summary: Bioprocess hybrid models and data management in JAX
Author: Mathias Gotsmy, Julian Libiseller-Egger
License-Expression: MIT
Project-URL: Homepage, https://github.com/hybrax/hybrax
Project-URL: Repository, https://github.com/hybrax/hybrax
Project-URL: Documentation, https://hybrax.readthedocs.io
Keywords: bioprocess,fermentation,upstream modeling,hybrid modeling,jax,diffrax,neural ODE,UDE,universal differential equations,data structures
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jax<0.10.1,>=0.4.30
Requires-Dist: jaxlib>=0.4.0
Requires-Dist: numpy>=1.26
Requires-Dist: pandas<3.1,>=3.0.5
Requires-Dist: equinox<0.14,>=0.13.8
Requires-Dist: scipy>=1.15.0
Requires-Dist: clarabel>=0.11
Requires-Dist: diffrax<0.8,>=0.7.2
Requires-Dist: sympy<1.15,>=1.14.0
Requires-Dist: ijson>=3.5.1
Requires-Dist: matplotlib>=3.8
Requires-Dist: optax<0.3,>=0.2.8
Requires-Dist: optimistix>=0.1.0
Requires-Dist: pydantic>=2.5.2
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=3.0.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.6; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=4.0.0; extra == "dev"
Requires-Dist: mypy>=0.950; extra == "dev"
Requires-Dist: ruff>=0.17.2; extra == "dev"
Requires-Dist: ipdb>=0.13.13; extra == "dev"
Requires-Dist: jupyter>=1.1.1; extra == "dev"
Requires-Dist: ipykernel>=7.2.0; extra == "dev"
Requires-Dist: openpyxl>=3.1.5; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.2; extra == "docs"
Requires-Dist: furo>=2024.1; extra == "docs"
Requires-Dist: myst-nb>=1.1; extra == "docs"
Requires-Dist: linkify-it-py>=2.0; extra == "docs"
Requires-Dist: sphinx-autoapi>=3.1; extra == "docs"
Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
Requires-Dist: sphinx-design>=0.6; extra == "docs"
Requires-Dist: jupyter-cache>=1.0; extra == "docs"
Requires-Dist: ipykernel>=6.29; extra == "docs"
Requires-Dist: matplotlib==3.11.1; extra == "docs"
Dynamic: license-file

# Hybrax

Bioprocess hybrid models and data management in JAX.

Hybrid models, also known as universal differential equations (UDEs) or
grey-box models, embed learned components such as neural networks in a
mechanistic ODE.

Hybrax combines bioprocess data interchange and hybrid model training in one
package. `hybrax.format` provides the data model, validation, serialization,
and mechanistic right-hand side. `hybrax.train` provides preparation,
augmentation, training, prediction, and leave-one-out cross-validation.

Read the [documentation](https://hybrax.readthedocs.io) for tutorials, gallery
examples, and API reference.

## Motivation

Bioprocess modeling research lacks standardized data formats, making it
difficult to compare modeling approaches across labs and publications.
`hybrax.format` provides a common hierarchical data structure with
built-in validation, serialization, and mechanistic modeling support.
Built on JAX and Equinox, it enables automatic differentiation through
ODE integration for gradient-based hybrid model training.

## Installation

For local development, create the uv environment with the development extras:

```bash
uv sync --extra dev
```

Run tests with `uv run pytest`. Add `-n 12` to use 12 pytest-xdist workers.

## Quick start

```python
import hybrax.format as bp

# Load a process collection from JSON
collection = bp.serialization.load_process_collection("data.json")

# Explore the collection
bp.print_collection_structure(collection, verbosity=1)

# Access a specific process
process = collection.processes["run_1"]

# Validate data integrity
is_valid, messages = bp.validate_process(process)

# Inspect a single process
bp.print_process_structure(process, verbosity=3)

# Plot
fig = bp.plot_process(process)
```

## Modules

| Module | Description |
|--------|-------------|
| `hybrax.format.dataclasses` | Hierarchical data structures (`BioProcessCollection`, `BioProcess`, etc.) |
| `hybrax.format.time_series` | Time-series container with optional fitted spline coefficients (JAX pytree) |
| `hybrax.format.splines` | Pseudobatch transform, segmented spline fitting |
| `hybrax.format.mechanistic` | ODE right-hand side and control splines (integration lives in `hybrax.train`) |
| `hybrax.format.serialization` | JSON save/load for the full data hierarchy |
| `hybrax.format.validate` | Data integrity checks |
| `hybrax.format.inspect` | Text printing and matplotlib visualization |
| `hybrax.format.simulation` | Event bookkeeping for synthetic datasets |
| `hybrax.train` | Preparation, hybrid model training, prediction, and cross-validation |

See the [documentation](https://hybrax.readthedocs.io) for the data structure
and the training workflow.
