smfsb for python
Python library for the book, Stochastic modelling for systems biology, third edition. This library is a Python port of the R package associated with the book.
Install
Latest stable version:
pip install smfsb
You can test your installation by typing
import smfsb
at a python prompt. If it returns silently, then it is probably installed correctly.
Note that a major breaking change has been introduced in version 1.2.0, and that the documentation has been updated to reflect this change. Following recommended good practice for numpy random number generation, random number generators are now explicity threaded through the code. This has the side-benefit of making the API more similar to the JAX version of the library.
Documentation
Note that the book, and its associated github repo is the main source of documentation for this library. The code in the book is in R, but the code in this library is supposed to mirror the R code, but in Python.
For an introduction to this library, see the python-smfsb tutorial.
Further information
For further information, see the demo directory and the API documentation. Within the demos directory, see sbmlsh-demo.py for an example of how to specify a (SEIR epidemic) model using SBML-shorthand and sbml-params.py for how to modify the parameters of models parsed from SBML (or SBML-shorthand). Also see step_cle_2df.py for a 2-d reaction-diffusion simulation. For parameter inference (from time course data), see abc-cal.py for ABC inference, abc_smc.py for ABC-SMC inference and pmmh.py for particle marginal Metropolis-Hastings MCMC-based inference. There are many other demos besides these.
You can see this package on PyPI or GitHub.
Fast simulation and inference
If you like this library but find it a little slow, you should know that there is a JAX port of this package: jax-smfsb. It requires a JAX installalation, and the API is (very) slightly modified, but it has state-of-the-art performance for simulation and inference.
Copyright 2023-2026 Darren J Wilkinson
Metadata
Release files for smfsb 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smfsb-1.2.2.tar.gz | 9.1 MB | Without provenance | Details for smfsb-1.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smfsb-1.2.2-py3-none-any.whl | Python 3 | none | any | Details for smfsb-1.2.2-py3-none-any.whl |
Total release size: 9.1 MB
Release files / smfsb-1.2.2.tar.gz
| Download URL | smfsb-1.2.2.tar.gz |
|---|---|
| Size | 9.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3e096d193d1b7f9c2bff781b1777427f1f5a6f3c2008624f460e76379c7f76c
|
|
BLAKE2b-256 checksum How to use checksums |
b2fe9c874ffb6667bcbce50d7f886e0139fe789617c750e68f91eb0d3b281e34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / smfsb-1.2.2-py3-none-any.whl
| Download URL | smfsb-1.2.2-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07d158d272dc470fd9a0b4be60b273d6dddbf72aa1319ff7e0ebb2aff1ab6cdd
|
|
BLAKE2b-256 checksum How to use checksums |
1f0d6e16d89a7a715ca678bcc7af3bd61f20305f3f95a418b63ca7c699fb073e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for smfsb 1.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.