Skip to main content

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.

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.12.1.tar.gz (6.7 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.12.1-cp313-cp313-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.13Windows x86-64

bngsim-0.12.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

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

bngsim-0.12.1-cp313-cp313-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.12.1-cp313-cp313-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

bngsim-0.12.1-cp312-cp312-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.12Windows x86-64

bngsim-0.12.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

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

bngsim-0.12.1-cp312-cp312-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.12.1-cp312-cp312-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

bngsim-0.12.1-cp311-cp311-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.11Windows x86-64

bngsim-0.12.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

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

bngsim-0.12.1-cp311-cp311-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bngsim-0.12.1-cp311-cp311-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

bngsim-0.12.1-cp310-cp310-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.10Windows x86-64

bngsim-0.12.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.8 MB view details)

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

bngsim-0.12.1-cp310-cp310-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.12.1-cp310-cp310-macosx_10_15_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: bngsim-0.12.1.tar.gz
  • Upload date:
  • Size: 6.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.1.tar.gz
Algorithm Hash digest
SHA256 bb39dae47f06ba96f3d0cb4c17035d162573b7a9eac90fd53d760532dd99f95e
MD5 ee7a22343575835435c9526dd93507e5
BLAKE2b-256 a043a8e3effb7f81689d3923afa405fa751c30a8e926fe7d2a2cff052e6c33ed

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4f3bf6b400b929945dd2c67b22dc2b5e6b99deceff7f43a115e75760da70209e
MD5 58e5187bbd00c5f7ed529e548d7b117c
BLAKE2b-256 57783be5e89cc71929f86ff99eb8a799425b11c3c795729467e5409babdcf68b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0c5d7b1dca2a2472dd981f64bc232acdc13469c92c949d8e556b472fe3463aa9
MD5 fdb663c4380be12b194b2ae408845119
BLAKE2b-256 eaa1d3dd4877c006bd40f3942ef353f2206912b84ba371e9b43eb2ab134ce8e9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aeab0363ec5e24744d35d9a49dc15a9425256aae6f8df9035836653465d0020a
MD5 c32ab24c23c75f7ec229a72b961d934d
BLAKE2b-256 ef4ac05a1dd8308954f6f467f1825547eb6dca4ea7bf8dce355c47f6a88a9537

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4e1596a393c38e1ee08c813c7c7691ae94dab02c684b16e0403ec7c39deab96f
MD5 cd457dcac325770aa3339c96bcac19a8
BLAKE2b-256 7bafd0f6db7632e4e06816ab2cb13c098195cd3006beeb8641c867213376fdce

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 31ef481534a7e953eec3be60538f2081c1c48cc05fc03c9e2de0b470c13a6638
MD5 292da1d345ff8de3ae1dcf0842b77e4b
BLAKE2b-256 2f7769cb481beebea83cc6420b2aaa7a25d0661459bef7bbe0be4540a9f5f7d1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4d36c439830f8932dc6f8fadeefdae6e41ad4023cb843d3ce8bbb63988d2ded
MD5 e0494484fb250f1cbe6381f450e16372
BLAKE2b-256 bd2ecd578db1ff1e84578fef3a510cd8988dc767714c4d42954f4f4b473b2166

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e5cadbfc50e0cf07ad448106ce4e4cf4247497541a12ab8cd63e9e37bff0450
MD5 10bd217dc294eaa908d3fe1c80c2420d
BLAKE2b-256 eebfae7310b785aa535b8b83352096885180b5d746e087c191e70fb32d2a393f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0d9c32983125858a217ccd7679f4a6f1dd9b9edcf50232ac4b578ceb449eeb44
MD5 517babeaac9ac362658f081eee1e9004
BLAKE2b-256 6489c3578b045d03fa25c9e5cd2dbd22bae254cd0b01359b7a585580db52bc6f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 32aa1ed94468be55409f4949da60c6b055a77f79d42798d45cfccfb7cdaf56df
MD5 b39ef714dd4a18c10a3447d17dd034c3
BLAKE2b-256 8c51036398e82c5b85843d0cb1b3b52cd0fe4fc5f55a31061471a84086fbfe00

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 49f86cab10c3a139a2eca2e1e585ce0da33afb4748873d5889f15b7cf6114ae8
MD5 97aef60f72ce78212165259c0766e6f4
BLAKE2b-256 f6154666710d6dda18eff598f7e18d74a9786f244c0ba75d3931f39ad8e972bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83499393170593e2c11c3b9bbb2b505bc3559b7b05a70dbdb7f763824b7e7bcb
MD5 951fe20054e1e13b8f2b97fba1ef2d8a
BLAKE2b-256 57bd147ddced1db0a0ebecd494a8743214fae2146bc5925feaf8923f1dd33da4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 193d5eb2971ae228e7ff9ffbff4c2a222718daaaa3972253a7bd4ef105f7fc65
MD5 a10a29839fb3a4a4048ef7c8e485c3be
BLAKE2b-256 5d7537aedcd9626210c7c7fa0467630352e3a7378eb70eb8462e5326875e731c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bngsim-0.12.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 12fc1911f8db9a4abebdf88df610d828770b6a18a83ae262735f3f4417c4f32e
MD5 618026c4224627456ea168ce5aca0b0b
BLAKE2b-256 9ddf83401b901196ed64727e00559e1379ad407824cf4e160df00a9f93c85a86

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa12c86a9698b13cd0d292d420abf77b2ed723ffe305c85fb15382e8dd3ab201
MD5 64b2cb4733c6ebef7c2a25b4f75ebda1
BLAKE2b-256 f88459eac150b3b4042e2d9dab92772c530272bc491bd033138249fb13ac4d4b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 25776e73d9543387faa666af91d296e66d8b777792b4f17841a00bd967381eed
MD5 ebe3881e93ee25809e239bc9a33582c5
BLAKE2b-256 2889f017b1a5f51b8eae60f9c1f34f3a54e7e5ce4fed5c9105768605f5f0ccf6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6a78a0c62dc7777417d821cdbd3a5134e099b9f81fe36fd599724f8dbaa8f180
MD5 f4396a2ae66e0c0d08cee16eda5ee1ec
BLAKE2b-256 7e0a7f555893524615c352a341f76cfaa9c51a3ba76cec1c3e5115d78999d515

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

0.15.1

17 files

0.15.0

17 files

0.14.0

17 files

0.13.0

17 files

0.12.2

17 files

This release

0.12.1 This release

17 files

0.12.0

17 files

0.11.35

17 files

0.11.34

17 files

0.11.33

17 files

0.11.32

17 files

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