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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.15+ x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.15+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

bngsim-0.11.34-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.34.tar.gz.

File metadata

  • Download URL: bngsim-0.11.34.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.34.tar.gz
Algorithm Hash digest
SHA256 d4b08e8db1045a987a9f968b0019997c9542fde50b186aa4747aa5ac73bc830e
MD5 0c06877c6b5c4b120a9b9e8fab41160c
BLAKE2b-256 4c242f0878a4b1bfb524ce8bcdb0dd7a2a21b784292164af9685a4ac4423e246

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.11.34-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.34-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 90b657763addf2a5e5acca12f461b54823f860df93ca9a5b5fa379d93f28aef5
MD5 81c282647e7500ba78591902f5fbc7fb
BLAKE2b-256 358de944605a39d10f1662d8451cc878fdc5f9c93d6a3a0a1a81da0d642f3475

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 161d3c8ca0f6e4fa8adcb97113f9361f14a3dba3099422961b6bc7c826a8a6f4
MD5 e3668b731594f74e9dc888d3f95fe573
BLAKE2b-256 f0b7ae3e89e392262bf3a3437392a178e018c62e0fb17d505630c6630d079f45

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc4c91ece5caa6749358350c5fc47ffc4e4f42d3bc70dd38b40b1c03e6cbeb2b
MD5 b064107ac53d46f5e3c67b6d4e5ef0fd
BLAKE2b-256 e7a8037f71df4f8e40b5beb5d05bd5c13f1aa8ca5746575cb9d6544641aae689

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 48556b5b930c338cdc9539cb3014922f42bcc7baa87426e1f26b4dae3efe2502
MD5 3f6b0da3378723f02b1fe74c0812f7c2
BLAKE2b-256 e498f76df04988cfda74d2f8542910bdc8d9fdc1e3a1e956ff12eaf0b11e9600

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.11.34-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.34-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a6680fb1c625b806b7028a9ae43fe8fa48e6e268f66bd19a97a345b5eeb56960
MD5 1d8162a5136756f9d474b8dc99f6e34a
BLAKE2b-256 70916cab49d63b21726ae709274a2a3ac85a60771c6a89cce9f074877c557add

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f3e450d7d77f3fb374cf96e9ea5c49280da81942f6112ac56ae6a6f47eafacf8
MD5 bfc2bfb9877a080793b49d1b3b2993ef
BLAKE2b-256 d73a816991d81898362aa8e6379bbecd65aea87c0fd333915b6b4efb99907707

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4998c012204aea8caa586dbf6320c52a4fea8225d88b0e70a371eeff4f3c2218
MD5 f21b11159ed1d61d3130170dd48ab1bc
BLAKE2b-256 e9c1bf13f0538eb30c87b5bd65646410b809c47e96a9a0ecc41b8716cd7fa38e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9f7aa9aa475dde91018952aaf3ae2856bcf5e1e989d432587845f4fbfdd5d292
MD5 c2927a3b997b12bee1c7d75ae73187e1
BLAKE2b-256 17f47865e15c7ced2087cc2986cf6376880fa9a39aa8f2515d03d8bd2bd3f963

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.11.34-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.34-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 70a18b25e18c5e6638d0843a52b9ec546d78a0e62cf3fe87ae4e254afe5ddfed
MD5 09dcee41fe61f0332bd89146ac3931d6
BLAKE2b-256 6a7ec8a443dd5cbde0f26247b2f7a9a0a04f893fc8eb9ca5193b7343d0974a3d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 056ae4d825e384b645726b5062a4fe78b2e986ab88b940de7a2d30eccd65bc5a
MD5 1064ab38f78a04fe40d2aabab24dcac5
BLAKE2b-256 e9c691ee20d9b2256c72442ec29ca45e40ff1e10baeec620d9fbe2e03dfabbdb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f23bedc2b87340ce8072af70a9b54716a28488f794b0b85dcf626777fe607886
MD5 ff4fc3f307cd2614cab89168e4882675
BLAKE2b-256 ff1270edd8a3a6a122366c79e9f2bc0c5561ba404a291a8475580813855c9ca4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 933c5a11caaec688c6fbd9493ba754cb675e7af5e69144c632647d716ced8751
MD5 9f7b44ad255ba87f8ec1e7043a79f284
BLAKE2b-256 3e6a518ef8bbca939ea8f6217a3b87c35c90c1693b3c23e7d01d8b610add70a8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bngsim-0.11.34-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.34-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5f77cef596b24d68a6618d7cd393bb595801c689bd6de4666f82fc5e72b571bd
MD5 6390ef6ae8088db8afbdc3833c692124
BLAKE2b-256 fb324aa11f016cc2e4452bf030f59f89dcf8c77752489a714d4914f3d388e246

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 04fb8ccd039c8f38fd5d664c09fecda66a6961d2fa16e60ac074c94b11e7f061
MD5 df101e6eb7dce7389d97269b22acd049
BLAKE2b-256 e1fc657e6637b14fc6627da7da51fdea18d9ab7ff25050baa7a52cb6839d68f0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 608fa2cf355790f814678d278fcc15f7bf2b91db1c9363a3da818f202d22de70
MD5 598d91422a8b3bc4ad04eda9dddc8f51
BLAKE2b-256 f7690542ac9b6f32c282813107998a7a913707016b985b7d9dfcfdb798788358

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bngsim-0.11.34-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 33e0405673bc2ded5d8a704e07f62c5a9653eaed6d103e4ed906b089bdc673ab
MD5 b023bdf4f00c516d57908873f0223754
BLAKE2b-256 3916f7312294528a38f4e7798bbc3f190712d3e972a572328806759b83f1aa4c

See more details on using hashes here.

Provenance

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