Skip to main content

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 for tutorials, gallery examples, and API reference.

Status: Hybrax is under active development. Until 1.0, minor releases may break the API; the changelog marks breaking changes. The documentation is still under construction as well.

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

Install the latest release from PyPI (requires Python 3.12 or newer):

pip install hybrax

For local development, clone the repository and create the uv environment with the development extras:

uv sync --extra dev

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

Quick start

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 for the data structure and the training workflow.

License

Hybrax is released under the MIT license; see LICENSE. Some example data comes from third parties and keeps its original license; see THIRD_PARTY.md.

Metadata

Release files for hybrax 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hybrax 0.3.0
File Size Uploaded Provenance Actions
hybrax-0.3.0.tar.gz 4.7 MB With provenance Details for hybrax-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hybrax 0.3.0
File Interpreter ABI Platform Actions
hybrax-0.3.0-py3-none-any.whl Python 3 none any Details for hybrax-0.3.0-py3-none-any.whl

Total release size: 5.1 MB

Release files / hybrax-0.3.0.tar.gz

Download URL hybrax-0.3.0.tar.gz
Size 4.7 MB
Tags Source
SHA-256 checksum
How to use checksums
3a41f915211db158dbe5f1b59e63156f9fa5cc7c03036848bb81df8367c7e465
BLAKE2b-256 checksum
How to use checksums
cabd36f794d39cdb0ddb012475dd268193776838fb075e16c77987cf97487346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / hybrax-0.3.0-py3-none-any.whl

Download URL hybrax-0.3.0-py3-none-any.whl
Size 351.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5767f203ad0ebfca3e7633d4a93365ceb9017f0029ee2775359fe6c267ca6234
BLAKE2b-256 checksum
How to use checksums
479b4d8752013742b82c5bd3e8ac99bb8c45328f9457ef867e0c8b6a07cd9820
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for hybrax 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hybrax-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page