Skip to main content

summer2: compartmental disease modelling in Python

Automated Tests

summer2 is a Python-based framework for the creation and execution of compartmental (or "state-based") epidemiological models of infectious disease transmission.

It provides a range of structures for easily implementing compartmental models, including structure for some of the most common features added to basic compartmental frameworks, including:

  • A variety of inter-compartmental flows (infections, transitions, births, deaths, imports)
  • Force of infection multipliers (frequency, density)
  • Post-processing of compartment sizes into derived outputs
  • Stratification of compartments, including:
    • Adjustments to flow rates based on strata
    • Adjustments to infectiousness based on strata
    • Heterogeneous mixing between strata
    • Multiple disease strains

Some helpful links to learn more:

Installation and Quickstart

This project requires at least Python 3.10

Set up and activate an appropriate virtual environment, then install the summerepi2 package from PyPI

pip install summerepi2

You can now use the library to build and run models. See here for some code examples.

Optional (recommended) extras

Summer has advanced interactive plotting tools built in - but they are greatly improved with the addition of the pygraphviz library.

If you are using conda, the simplest method of installation is as follows:

conda install --channel conda-forge pygraphviz

For other install methods, see https://pygraphviz.github.io/documentation/stable/install.html

Development

Poetry is used for packaging and dependency management.

Releases

Releases are numbered using Semantic Versioning

  • 1.0.0/1:
    • Initial release
  • 1.2.1
    • Dropped support for Python 3.7. Variety of bugfixes and expanded features, see documentation
  • 1.2.2
    • Added capture utils
    • Removed inner jit in model building to improve debugging
  • 1.2.4
    • CompartmentValues not functioning previously; include more comprehensive check in graph split
  • 1.2.5
    • Previous issue was not resolved correctly; bugfix-bugfix release
  • 1.2.6
    • Make full (comparment) outputs optional for jax runners
  • 1.2.8
    • Improve time varying functions (allow GraphObjects in x values)
  • 1.2.9
    • Derived output functions matching pandas.Series functionality (rolling, diff)
  • 1.3.0
    • Support initializing whole population via GraphObject
  • 1.3.1
    • Enforce jax minimum version in requirements
  • 1.3.2
    • Fix parameter bug in test models
  • 1.3.3
    • Fix issue with binary search for piecewise functions
  • 1.3.4
    • Update import in ode.py for changed jax API
  • 1.3.5
    • Force specific jax (0.4.24) to stop breaking changes

Metadata

Release files for summerepi2 1.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for summerepi2 1.3.6
File Size Uploaded
summerepi2-1.3.6.tar.gz 66.0 kB Details

Built distribution (wheel)

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

Total release size: 145.7 kB

Release files / summerepi2-1.3.6.tar.gz

Download URL summerepi2-1.3.6.tar.gz
Size 66.0 kB
Tags Source
SHA-256 checksum
How to use checksums
de1bbb68b63655477b3a6f9ad4458afe07ce4d89d6a12ca37d9c3e35ad20f9e3
BLAKE2b-256 checksum
How to use checksums
371b385e2504c69d0001a9561d0625e2eecf2fdfe3e313a573bcdbcc4ccca983
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.10.10 Windows/10

Release files / summerepi2-1.3.6-py3-none-any.whl

Download URL summerepi2-1.3.6-py3-none-any.whl
Size 79.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2803e9d5c8478297c99bd9576cb45545e3f4ff15412034f4dfeabd724654e9ee
BLAKE2b-256 checksum
How to use checksums
25952301570ad169f173a42ba38729a7b83e20f68f935e1f8a1d658e1c1cd0ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.0 CPython/3.10.10 Windows/10
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