Skip to main content

Embeddable simulation engine for BioNetGen reaction networks

Project description

bngsim

bngsim

Embeddable simulation engine for biochemical reaction networks.

bngsim is a high-performance C++ simulation kernel with Python bindings that replaces BioNetGen's subprocess-based run_network driver. The library also includes two network-free simulators. It loads BioNetGen .net and .xml files, runs deterministic and stochastic 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 BioNetGen .net and .xml, Antimony (.ant), and SBML (.xml) models SBML Test Suite results
  • 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
  • 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 models may 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 (BioNetGen .net/.xml, 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.35.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.35-cp313-cp313-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

bngsim-0.11.35-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.6 MB view details)

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

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

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.11.35-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.35.tar.gz.

File metadata

  • Download URL: bngsim-0.11.35.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.35.tar.gz
Algorithm Hash digest
SHA256 d4cd1eb4a1895e4770a2c4965af98536195e7cf9f1bcae76bc163fb0d8a3f63c
MD5 bf0317f7d42d4966d48030118871d9bc
BLAKE2b-256 9e9523d76ef388211cda95be4745af28d36782b30c474be0d5cc4cce56e51d8e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.11.35-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.35-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3c6bc20ee4c2b28827773a245e1a6e2f319e83bfee3297e689605871efd3280f
MD5 b5d6ea52d9e0d23ea6baad71fa3c24f4
BLAKE2b-256 f783fc83c9b60cebaa8a9caf099205f5e30121b465b71222693f85d09bca2130

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 55c3802fdd9534924d87cea0cf669c2c4327b14cc3baa93a1a36c6c255beae40
MD5 2d766ce0d78c9def7b5d54c36a7b95d8
BLAKE2b-256 22beefe2dab9db7d5e5d4cb004250a61068e6eebfadeb85d8c36d525560c0d49

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 275fe01559544789d0653d53bd5d711e1ba4b111a8559f8efafca029c90203ed
MD5 60fed42c12176cb90795cedc65f703c4
BLAKE2b-256 3629b2ee577a1ccdecb73b16b6241d1254fd0679fb2cb56982bc4e3b42b1e9c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 57686a159dadee4e0c582af55d2b8f2dc10842ba545f59ec58e1c3bd644feac2
MD5 bb5d27745a2034752a387c16c817a889
BLAKE2b-256 19f20d864720a7ec05d2e2d77186f9435f412f3a51da6a032ccf9512ad4436b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.35-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.35-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.35-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.35-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 06c9a37b9f9fcc8bd9c0cc54974b6267c8b9a06eca110c84912e5f82a2b47cd0
MD5 80149ba0df13bf5ad6824fa55e8f4d0f
BLAKE2b-256 766523648e6ea25dec4aa712bdc1d57dec9ed822160707715fdb62a12c5d8681

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f7540e8c69a5ee87dfbb5b2a0769e81afc42c7d301a3cd5ae3ae9427c24b62f
MD5 c0cd33dbc4e77431aeb79967952f4b65
BLAKE2b-256 6962a6d1d7519670af7c2c97299cc1b0042ab06020390fd0389d274d89e3e857

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8443aa3a1e816fcd47155b3e0a99f2df1e0b3766b88cdef625a6f738de959960
MD5 b5c2cc64ef05b4491243a2e981fa1e3d
BLAKE2b-256 26f434ba3740cfb681a7d28d2dc3b8a7b13a420108529f1bfd6531f45dddee80

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9bfa26a9aed963c4f72a5d5eeb1d1306aac75b10b31eca8153f484a4d1ea7667
MD5 a564bce20eb16db77cf92104946a509d
BLAKE2b-256 35e7d88d8e8ea99aa5e8c51cf57722c399938f8d36adebb5c33ce132d0d310c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.35-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.35-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.35-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.35-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8a67d0c12577bfd6961ab1c61085bea4a738f9f81926755d7edb58b90b5ca474
MD5 315e86aa35f2603a475d4cd607df1866
BLAKE2b-256 d0b6b446f7f94f5d321911e2b33428a5cfb1c0e3c365647dd28f76489e3b6436

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a6d0cf07057877389553d102bd20d55fd8e52dfd9d4495729b33f65a1125b750
MD5 7dbda169a209d874cbb5771f084683a7
BLAKE2b-256 8eba619bd78ce079b770d3d5d650e3a5cc414aabd9d2583ee6f37318e59cfb1b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0ae053df80a4e10f466d53482230a71ae82bd609eef9924cb55a0a58f9c7ad06
MD5 ecc9b056adc54087616742ad19fb2a6b
BLAKE2b-256 bd1e0d658b782f959a074d4131061d8839da03dd726e6db8f3aaed40162d5f70

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 b682eb3e6e297feae7680c063a5a5bd14817467648d335e05c2571846bc19f32
MD5 ef90c6e49293dd3c66abe2849c6c0bc7
BLAKE2b-256 bbba2354ec673f575e3036b81ab5c0b4cfe73d5cd80fbea2e2610fa144c2e422

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.35-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.35-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bngsim-0.11.35-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.35-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 86e6e6807f9cd6401e72915c0d39d6a5e9e6b8c591d9fda351823fffe09026ce
MD5 b985758af678738479992ab517e3de54
BLAKE2b-256 e0f84aa31d8990c70e7a2e05ea5d89532325469f1675fc3fb4e2017e1731468e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9f91f6446e47c43e6fb063f6fa0893895528c42250702ea467091291e74878a
MD5 8a930cbb68669df9487994a8bcce62f7
BLAKE2b-256 4fdf3ae2748c65cf63fa3d149781b2afa9c13f9cfe3a70e157f34e0ad01b6a5e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 06dcfbc8f1caca7f105cab52228321143c72c598980870f9e61fa46ee813d84a
MD5 a2182412668b048349462fcb2cb90fd8
BLAKE2b-256 51cb1c083d17422212090f183bf1768169c317d4344d08f2eb6a7b48e4081e16

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.35-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 87cd077963d0cb5ec43f17cd9f34eb8eba8e360adcae7a96075fd03caeb60b04
MD5 4cdbdd808a779addb4fc07d2ddeb7264
BLAKE2b-256 491d26a99654f15edf654e595414de31f82fd2d466fc00eebc1a89623ca8fd74

See more details on using hashes here.

Provenance

The following attestation bundles were made for bngsim-0.11.35-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