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.32.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.32-cp313-cp313-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.11.32-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.32-cp313-cp313-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

bngsim-0.11.32-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.32-cp312-cp312-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

bngsim-0.11.32-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.32-cp311-cp311-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

bngsim-0.11.32-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.32-cp310-cp310-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.11.32-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.32.tar.gz.

File metadata

  • Download URL: bngsim-0.11.32.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.32.tar.gz
Algorithm Hash digest
SHA256 6ec55149e5362032a5a095782a826affc1e256a309f5891d8f53e140e22b4069
MD5 df8477ef67c3562c343b17a0cfce0738
BLAKE2b-256 d29a143b9626d991d99e1625f1ee1369b00690c56c4feaca2fd1cf4830c6e646

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32.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.32-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.32-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.32-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 541dff4091c5dde7f3b324ba4f7993ae514d565c52c9f30012784928e5f3dce8
MD5 c82ff12d88f7fa87fe69bde11d8c3ba5
BLAKE2b-256 6ac886487375dd0957c4e2a9d9c77a378c4c485388b4dbc3447482297f8c788c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9bc9d6cfc946eb0f9e34763eae1d821564c5ff295d91d30594f534d2655f6653
MD5 ffd47e5134c67593a9e286a620183808
BLAKE2b-256 3afe6cba1144b5bfe2964dbfb2e6fde1ce6e5da2aa8483bd613e80c59f220bf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39d7791463cc195bc0d4369bf6307d744b5fd5ed1d53fc4cf894ca0dd161ff91
MD5 4b8f339022cb20930bd917202f4fe82b
BLAKE2b-256 76c452b5c7b511b22d707efef8c1b2c19703126aaf25b8a12f3723d9226ce123

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp313-cp313-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 aa91c5dd3e506428cbf3d38b0c9ae884783c0b640106b40b3c56973b83ca6085
MD5 539b8914a7940553039f8c732aa81612
BLAKE2b-256 839b6a783ec53a6bd45401b4cc231066a17b7b08b2a5215d99a5f97fad675857

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bngsim-0.11.32-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.32-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 699e834749b18e8a91d63dbbf99d1782adedae6bceaecdc097c5ae77ee4d5ab2
MD5 7f896e9ba44b3a30d1f2f4325593c5d0
BLAKE2b-256 08041c1831774e3bced55ceb5aa278c99cf42e0632181474f02ec8daa08e0874

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9beebb697f28b05b656deb7210d6a0b4519a8ee01dc89f6dc7a3dc907ba361ee
MD5 dede44f2d3bef4ef466d6bc2b49a9ca2
BLAKE2b-256 e245f7cae17b67d6b346f5b7817d20d2f25750c3231f30e13f975a7c90baa8f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0f9f1c42f9a43a68a29ce25fd8589858354e123e1231ec8ed0834762924b930e
MD5 9659ecf273f0c091971fc6ea9019a6ac
BLAKE2b-256 e58d2c3886972291b3068eeb63476fbd0b3f745b2f25f3f89a35f5d7794534d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d61f99b7a420d0ebc08a1ac7c8441c68f79bf0f3bc7bb2f72e675ad22a5f0d0f
MD5 4a2782ea8e7dca88115512f90fb357dc
BLAKE2b-256 548e3a7311f29ef437d64d1044740a7843ba30ad3042dbe0210512028c3b921b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bngsim-0.11.32-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.32-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fda220aec0dc9032c2bfe718a039b5d3675613116a03e99e0277591e2be198ed
MD5 40afe8d3fb00a7f2bab377a118dceaba
BLAKE2b-256 427ad80e34e131c5ba4809f66d5691a2f53fca2ef50c8d72941527d2ad66f1d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2e760f80707f2b8ebaebd45be6e83707c504fd9012ba6bc850e5427a4dd48a10
MD5 82b95135a57b350c57d1ce445fd58b4a
BLAKE2b-256 0fb1825954c333b545cfcb3c428d1eac6fcb0e114060c859d11c13d03537457c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14a9333b2ca4ca95ad256119159c9af16b592f1bbf9caf502284f0bed06a1745
MD5 26ce4f43720a0dea98d3f7adb6e4a7b6
BLAKE2b-256 18bc28af39e847557a5d4599ed2280954cb7a7c7177f35cafc9068e33af425f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 dbbeb42cc6c51b25fb53d8d6b1e9680de3ce7d1714d091250964c2d083706967
MD5 965d4491e3fdfb40834633a3e1e0635c
BLAKE2b-256 c9cf858e3733a7f1b6f564ad6bba12c61300a05201f5df1093175e0df9ee4f69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bngsim-0.11.32-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.32-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 1d3aa9f2f34cade64058dd181d1acbd777ee44b9dd3f65645d52212d0d3e74af
MD5 effbc8453ab5caccdaa1767ecd1daf49
BLAKE2b-256 d2237d0a0500da4bd14da50b4a402e644723edba21b92da41848d96860602f81

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a0644e274706bf73bf40dd7e2aa3fa5ed7940e2d3ccbd3d914e5833db02675bd
MD5 1cedb811f5f8f9b218a17bb9a9d46bf3
BLAKE2b-256 99ff6efe9948379b9e8dddf1ded125210044f4a7a56afd0a9d5de41306b2aaf1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 219543dbcd0c9ae0c2b12e2c406ab59c0e817809637dddae34040f580716c3e2
MD5 feba286244654c41abffccd8e4fa6bba
BLAKE2b-256 e2f79607276cc656f01f4ba67932388ff1d3ad514a84380c3a0959c5b6b24019

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.32-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.32-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for bngsim-0.11.32-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c0c2c68eab8f66a5adc12b0b5646f6b8a4517b5f19ed837fd5b9be3379889fde
MD5 db64c2e4a77ecedbd52e5cad0aedb3c4
BLAKE2b-256 64c6c76b0d61908bfd2a80616db0fb9d2a16b9a78b931e88f5f03ad2cda9eba4

See more details on using hashes here.

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