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.1

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.1
File Size Uploaded
smfsb-1.2.1.tar.gz 9.1 MB Details

Built distribution (wheel)

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

Total release size: 9.1 MB

Release files / smfsb-1.2.1.tar.gz

Download URL smfsb-1.2.1.tar.gz
Size 9.1 MB
Tags Source
SHA-256 checksum
How to use checksums
bf80b8e2fa8fa5f1f9c2d319b477e5e53d60344d747fa8604128dd120391d756
BLAKE2b-256 checksum
How to use checksums
00a0789b0d6dacba4c3faaebf236fee5404b6e244fe1d55d80e01125b24496b3
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.1-py3-none-any.whl

Download URL smfsb-1.2.1-py3-none-any.whl
Size 26.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f02c9703b2e65b7de7bad553b409652c8316a91b67c6e9b397f1c385a3588d5
BLAKE2b-256 checksum
How to use checksums
c705ded1c5e9861fead323b85d228328c78cfc246fd6aeb88270d73d3103995f
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

1.2.2

2 release files

This release

1.2.1 This release

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