Skip to main content

smfsb for python

Code style: black

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

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)

Source distribution for smfsb 1.2.2
File Size Uploaded
smfsb-1.2.2.tar.gz 9.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for smfsb 1.2.2
File Interpreter ABI Platform
smfsb-1.2.2-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release 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