Skip to main content

Embeddable simulation engine for BioNetGen reaction networks

Project description

bngsim

bngsim

Embeddable simulation engine for BioNetGen reaction networks.

bngsim is a high-performance C++ simulation kernel with Python bindings that replaces BioNetGen's subprocess-based run_network driver. It loads .net files, runs ODE (CVODE) and SSA (Gillespie) simulations in-process, and returns results as NumPy arrays — no file I/O, no subprocess spawning, no Perl dependency.

Highlights

  • Fast — in-process execution with the GIL released during simulation; thread-parallel batch sweeps
  • No toolchain at runtimeimport bngsim; no compilers, no BNGPATH, no Perl
  • Modern SUNDIALS — v7.x CVODE/CVODES with re-entrant SUNContext
  • Multi-format — loads .net, Antimony (.ant), and SBML (.xml) models
  • Rich results — NumPy arrays, named observable access, pandas/xarray, HDF5 save/load
  • Standards interchange.net/cBNGL ⇄ SBML and SED-ML + OMEX packaging, every conversion verified faithful
  • Gradient-ready — CVODES forward sensitivities, Fisher information, JAX-differentiable RHS
  • Validated — matches run_network to ~10⁻¹² (ODE) and cross-checked against RoadRunner and the SBML semantic test suite

Installation

pip install bngsim

Prebuilt wheels ship for common platforms; large / genome-scale models benefit from the optional sparse (KLU) solver. See the installation guide for source builds, the KLU dependency, and optional extras.

Quickstart

import bngsim

# Load a model (.net, Antimony, or SBML) and run an ODE simulation
model = bngsim.Model.from_net_file("model.net")
sim = bngsim.Simulator(model, method="ode")
result = sim.run(t_end=100.0, n_steps=1000)

result.times          # (1001,) NumPy array of time points
result["A"]           # trajectory of observable "A"
result.to_dataframe() # pandas DataFrame of all observables

Stochastic (method="ssa" / "psa"), network-free (NFsim / RuleMonkey), sensitivity analysis, steady-state, and events are all covered in the quickstart and user guide.

Documentation

Full documentation is hosted at bngsim.readthedocs.io and lives in docs/:

Benchmarks & validation

bngsim beats run_network on every SSA/PSA model measured (geometric-mean speedup ~8.7× SSA), agrees with libRoadRunner across the full BioModels ODE corpus, and scores 1577 Match on the SBML semantic test suite with zero wrong-but-plausible answers. The numbers, methodology, and reproducible harnesses are in benchmarks & validation, with the committed cross-engine snapshots under parity_checks/. To re-run the suites and reproduce the numbers — the pinned-fetch model, corpus provenance, tool versions, and a no-download smoke path — see REPRODUCING.md. The supported-construct matrix is in SUPPORT_MATRIX.md.

Contributing

Build-from-source, test, and CI instructions are in CONTRIBUTING.md and the development docs. Release history is in CHANGELOG.md.

License

MIT. See LICENSE for the full text and the Triad/LANL copyright notice.

Third-party code and model/test-data corpora that BNGsim redistributes are listed, with their licenses, in NOTICE.

© 2026. Triad National Security, LLC. All rights reserved. This is a Los Alamos National Laboratory open-source release; LANL software release reference O5098.

Citation

If you use bngsim in your research, please cite:

Preprint coming soon!

Acknowledgments

BNGsim was developed and validated against RoadRunner, AMICI, COPASI, BioNetGen, and the SBML/DSMTS test suites. See ACKNOWLEDGMENTS.md for citations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bngsim-0.11.33.tar.gz (6.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bngsim-0.11.33-cp313-cp313-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.11.33-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.11.33-cp313-cp313-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.11.33-cp313-cp313-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

bngsim-0.11.33-cp312-cp312-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.12Windows x86-64

bngsim-0.11.33-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.11.33-cp312-cp312-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.11.33-cp312-cp312-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

bngsim-0.11.33-cp311-cp311-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.11Windows x86-64

bngsim-0.11.33-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.11.33-cp311-cp311-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bngsim-0.11.33-cp311-cp311-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

bngsim-0.11.33-cp310-cp310-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.10Windows x86-64

bngsim-0.11.33-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bngsim-0.11.33-cp310-cp310-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.11.33-cp310-cp310-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

Details for the file bngsim-0.11.33.tar.gz.

File metadata

  • Download URL: bngsim-0.11.33.tar.gz
  • Upload date:
  • Size: 6.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bngsim-0.11.33.tar.gz
Algorithm Hash digest
SHA256 5ac2d8ee2fd230ab57c7837a5a653561112e2df2adacfd2059235f607184fc61
MD5 ab76f386b1f99b55e1073424f2d2abd3
BLAKE2b-256 b53c0e0e4518b95544c8ff878cdf7fb732cee7b0def34e23e7208e32384a4cd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33.tar.gz:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.33-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bngsim-0.11.33-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5bc6853bead3109913ebc9a676c16556f06d5612f7609033e49ed198c87a7bfd
MD5 2dd43acd941e96e26db0ff33873af68c
BLAKE2b-256 045df42b283b66b8f48b22f7c6d180370f588150bfb58b5286c1607cf4851820

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp313-cp313-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf05161b710ea881aa59beb8e151ecee42847050cddbd4dae0d92023d43ee2bc
MD5 66a924670bcc43b702d2f048457aec44
BLAKE2b-256 be199f542145dd7d6082e1962f92babdf86825451f85d15c981e913411104150

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28da2c48993f29b1fe646feacb598baef8e28fd5e7b9dd7ad9787fcd7032cdc8
MD5 ceefa86ae5cf108bd08d6378d00b7902
BLAKE2b-256 4c919246e848f7d9efe1f4a16b504dbf4b38984dda42ca719ba83bdc3b0482c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 96752e9aec38ae4322a55d34f080f9f09c47cef86138846e51b2a651aacdb303
MD5 4758b8fff5158bc25c8680b776b99a06
BLAKE2b-256 a4cc5921376c7eabe8aa16907192f5be21d40656a0c0aef8069b4df2fc310ffc

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp313-cp313-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.33-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bngsim-0.11.33-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 447f269c3381e9e3ae7f7c68607fe724e1f3cedda60bddbaa1c35b19585f7c00
MD5 3706af965988f4cc26ccacf4ccdd05f8
BLAKE2b-256 499cac19c9245f395795f751ae47d7c93a0402e7b923e3ce1c89233e6b29a9e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp312-cp312-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c89dc8bbd8312e281c0facffc940235533834be91c369cf004d1f1236f43d2e2
MD5 d7447fe1adc06abba676397e75bd7aa0
BLAKE2b-256 22a44b1f8f0b0f3e7fe32e42dc6e16468cbc23cea9810b4bdf8a857b5daa2cd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0a5340c7dace5a3da5f44f067b6538c001317fdc59850112de61ea5b20bac6c
MD5 ae648c6418ccaf052007c4df094300a7
BLAKE2b-256 2b9a1774864b3be908af68cd6a710b963e7562f60b6d1a48d324733680ad0701

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4e8ab292b536f64bd5e634c314e1e4c538230bc8d684bada29205ab35743b4b7
MD5 364dabe86340e7e34930556b52af66d7
BLAKE2b-256 9693b680066bdf14c8cbb33a1e469f4fb18e3e4f8b4306a35267df59dd11f6a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp312-cp312-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.33-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bngsim-0.11.33-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cb27e3921d2c8f63a2cece2e6db6c8165f4026338f24ae27c55e8ebcec6ee6fe
MD5 4c12e245d1e6fb14ee28508728ae1a62
BLAKE2b-256 5be8e5099317430744ae0026576816223167ba0ba72a3da266828923845e1eae

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp311-cp311-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 167b1a29862c8305d44ae2591a61d5c26b63adc6c7e587756187e976609a0ef1
MD5 3f4afad7edb3a5560e52531c505d6abd
BLAKE2b-256 bc78cf6eda94d8e4d1bbf92685477d6fbd4a4c3c3afd894c92ce48cb19158ef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84ad00096607b31ba1ed4f6773a03904889b5fd7d143ab4c3faf5aee39a0713a
MD5 131c71d3b5c4cf2f31d8c57035550069
BLAKE2b-256 5bc26c75037b1ea6b0d5114afa7f3af3f071e2b358d0060337a8b9043b194fb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 734a4acb00ca21c7132605c2f6158b7a3c341640b52e4ffa3b5db611c6434a77
MD5 3b16f7cc5b470f9161551f19d4c02218
BLAKE2b-256 4d4f42bb4f2a61969ce65baf1be246e89cb51d5c05a77771a301c398a1712948

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp311-cp311-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.33-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.6 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bngsim-0.11.33-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b92fde1b5d768126c71f45c2a8ec325341e7896183d5c3b0d52772cab4c88b82
MD5 b42674d5ff8bfac159a5df863fc7ee0b
BLAKE2b-256 7ea33e2b4cf536ef56c85c37d8d0ce27007629acf0950b6b30b76f3c1bd24524

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp310-cp310-win_amd64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f508acb7156bb9cc66e4e37fcf4700a1efaabe749dc170d9b13121697445cdd
MD5 6a3e0c4383d1b21b7613a1bbf55b4a3e
BLAKE2b-256 ecf52ff7802dc9554496f56d2c8cf328888148424e5e85bac2938b200acee068

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 48df3f56b796d02a39cd10035e774b1a2d7914a91c378b8dceeb7fdb51e7f2cb
MD5 eb080ab434876fdf522b76b3e13e3864
BLAKE2b-256 46edd792aaced92ca96b0fd3a3c7f966e8aaab60d163549ffeec8c7e4e1b9d29

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bngsim-0.11.33-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.33-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 249c7d7b738c3b22aabed28740632c9fa9f772f92b8d6599ca0f9c018f9853b2
MD5 7a5bd9849bce461645e0541ae424b3ac
BLAKE2b-256 069f28be65f6d73c2662b012ca16af28037e591f020eb20f1f120031a0ed5a5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.33-cp310-cp310-macosx_10_15_x86_64.whl:

Publisher: release.yml on lanl/bngsim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page