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

Uploaded CPython 3.13Windows x86-64

bngsim-0.12.2-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.2-cp313-cp313-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bngsim-0.12.2-cp313-cp313-macosx_10_15_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

bngsim-0.12.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bngsim-0.12.2-cp312-cp312-macosx_10_15_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

bngsim-0.12.2-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.2-cp311-cp311-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bngsim-0.12.2-cp311-cp311-macosx_10_15_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

bngsim-0.12.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.12.2-cp310-cp310-macosx_10_15_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: bngsim-0.12.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5a10f10a361179205112bb67757000af042b1a886f072cb2871b9fe0668763f8
MD5 d82ae05dd7c3f01c9c13d18a71eb9b5d
BLAKE2b-256 7249b95f717cb36a915fb17b4ffaf0d4eb09f20d865885de54c071092d180920

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.2-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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 33d3f1e9589db7e14e06778ce432c47688eede28c1e8b442003f1789f6d52a67
MD5 f8a0d0c89d9f26e34dc314e34f88a4c6
BLAKE2b-256 7057e5aa873d73bd718e8e959f3c069800d56a5c9f50df41f48d369ab18aa32e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3f77a2cbf9c9d002289cd38b0d9954062e5b78717a30b09af93d8ddf5c714c5d
MD5 060f8a5773f44511c9158217e90a9f1b
BLAKE2b-256 1d991563b0dd441f435153e66b79aeac200de397a7213ceb89d57718d87fd3b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75c16dcaac33b967bdebfd7e6d52b03aa157e8de57a844af3e190185636ba36b
MD5 8ca3a568b9273d31ba4e367d62755b34
BLAKE2b-256 5e297ad400dcb27df4996db0e7dfbbe83b4c1db3671ed77017843d34a3f3bdb5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 396c15a2a3c3681b607980d452d0994528b3d92b630d5f17db73773db7214d65
MD5 c8eae224516f4b9f35a182acbf94c8ae
BLAKE2b-256 0db69040052c4d9653fd1abad150782674f9c101992f68af52d1e6f16588e5c8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 addd2788a722b4661acabd2ec494b199f1616c349222b4ac4eafbaf4bc35fbbe
MD5 8d422d30a0a068a6aa25420677d3b48b
BLAKE2b-256 b00dc795015f7e0e9622e9ec8a4a8bc42915dc2ba577e7a65b2ddaaf2d4081e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 820d8dcd716e82e747475ed63b552357846ac78f26e0da5f028237c60e687242
MD5 017760c45d01737efe35e411b7582963
BLAKE2b-256 cc8b742a7d1fe3efa42a8aa40c8f1189ac952442d9053c8d7bfbefb9f77e421d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 abd5d81581f862341ba9d860fd6cb77a0314e4dabfbec687771961ffc29c542c
MD5 49106f4a172839c66b5085dc7126f526
BLAKE2b-256 8cc6094aef55a67a6e687a43d52a04cd7abbae59448a0b985108cac79b714db1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c2b4b506505eb8b5df0ba7ceb01202ed5d6a91155b34b9aaad6733ba6609a5b6
MD5 724163faba49a44fb73c90ef287e8dad
BLAKE2b-256 2c3bf86da6f5ec8b267eaa46834c4f363dfbc5c74eaf790b4d8c5a1c070408e1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.2-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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7c026ef7bd03ec1296d99466a64a11bae17b7f3de9ca77ba748ed126f8fae940
MD5 a4c0c6d451aa397299384f596e7a9a1d
BLAKE2b-256 1240519f51dbcebde78b4d96d794fa39244d26516a36d6fb506c07b91f15d3e4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d0f99b0378c5f118620c13bd66d6b2ce59321d6461807534c80c0c873f8f69d
MD5 97d3b37e10a61d6d530dec64648c143d
BLAKE2b-256 2a083b81c9a08bef8117e0cae38e8ebeb125f31910b8f8baf7ead10cd37599e1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 66da00dd69e9871eb82e3474299f788e509a1086be7dc343e9f8f78259471311
MD5 fbee9964f5f0f4df3ddd725b47f6f268
BLAKE2b-256 81c71a539859e4f9ed0f28a2bbe91812dae1609f5aca0091a652db9791fbf7bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 82d04cb03217e5a9ee8fdbb94e44d30313dea2ff81ae7387ed3557c4382fb6fa
MD5 dd9dd10746e461daff8f952649d10d8e
BLAKE2b-256 6d041573d6b3026dfe2e5a10eac810220df059a3dde1c4fed0a2957b6f31240f

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.12.2-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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2fa9bc82355bb5b923430f45c06c7e27bb9acb35fa98039d08506ae938a176f7
MD5 29ff9954fa2cc890ec7ab1ba5c42a815
BLAKE2b-256 1507ededb95cdca03405be003197ee21cb751ee0306705dd1e8d96c46d8172c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 065894c4f5ada986606cc3eea0118c1638e4a1f1e4c675a9a455280df1b00c2c
MD5 ee68cfc40389da426245a431daa35ab1
BLAKE2b-256 4e5413f5e0bc26ee4169af1fdc51d6e35e5af1569c11c846d1d1109d618481e5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 58a17c0cb3787842c97483a917ecc71e0f1ea8efe35fb7eff8338aa1cbaef734
MD5 e3db754132336d082d35d9c586a0869d
BLAKE2b-256 b4108c577eca0ff1d7deab63e8fcfc21018fe0fe8a136ebb86a564720d864a94

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.12.2-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9ac40cbf886ece94e6e4b623e06508813932db9d83fe6ccef5b631c22dbe5787
MD5 93fe70f2d1edca15778ae775118e3896
BLAKE2b-256 a21f639a3d3414467a2a00461d4b21ac75483b7bdd208dfa75c03bd9414119a7

See more details on using hashes here.

Provenance

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

This release

0.12.2 This release

17 files

0.12.1

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