Skip to main content

Generic, SI/SIR/SEIR/etc., disease models implemented with the LASER toolkit.

Project description

Overview

Documentation Build Status GitHub Actions Build Status Coverage Status PyPI Package latest release PyPI Wheel Supported versions Supported implementations Commits since latest release

LASER (Lightweight Agent Spatial modeling for ERadication) is a framework for building agent-based infectious disease models with an emphasis on spatial modeling and efficient computation at scale.

laser-generic builds on top of laser-core, offering a set of ready-to-use, generic disease model components (e.g., SI, SIS, SIR dynamics, births, deaths, vaccination).

  • Free software: MIT license

Documentation

https://laser-base.github.io/laser-generic/

New model components

laser-generic adds additional modeling components to those developed for laser-core. They include:

Infection & transmission

  • Infection() / Infection_SIS() – intrahost progression for SI and SIS models.
  • Susceptibility() – manages agent susceptibility.
  • Exposure() – models exposed (latent) state with timers.
  • Transmission() / TransmissionSIR() – interhost transmission dynamics.
  • Infect_Agents_In_Patch() / Infect_Random_Agents() – stochastic infection events.

Births & demographics

  • Births() – demographic process, assigning DOB and node IDs.
  • Births_ConstantPop() – keeps population constant by matching births to deaths.
  • Births_ConstantPop_VariableBirthRate() – constant population but with variable crude birth rates.

Immunization

  • ImmunizationCampaign() – age-targeted, periodic campaigns.
  • RoutineImmunization() – ongoing routine immunization at target ages.
  • immunize_in_age_window() – helper to immunize within an age band.

Initialization & seeding

  • seed_infections_in_patch() / seed_infections_randomly() / seed_infections_randomly_SI() – seed infections at start.
  • set_initial_susceptibility_in_patch() / set_initial_susceptibility_randomly() – initialize susceptibility.

Utilities

  • calc_capacity() – computes population capacity given births and ticks.
  • calc_distances() – helper for spatial coupling via geocoordinates.
  • get_default_parameters() – returns baseline parameters.

Installation

We recommend using uv for faster, more reliable installs:

uv pip install laser-generic

Alternatively, you can use regular pip:

pip install laser-generic

To install the latest in-development version:

pip install https://github.com/InstituteforDiseaseModeling/laser-generic/archive/main.zip

Development

To run all the tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows:

set PYTEST_ADDOPTS=--cov-append
 tox

Other:

PYTEST_ADDOPTS=--cov-append tox

Disclaimer

The code in this repository was developed by IDM and other collaborators to support our joint research on flexible agent-based modeling. We've made it publicly available under the MIT License to provide others with a better understanding of our research and an opportunity to build upon it for their own work. We make no representations that the code works as intended or that we will provide support, address issues that are found, or accept pull requests. You are welcome to create your own fork and modify the code to suit your own modeling needs as permitted under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

laser_generic-1.0.0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file laser_generic-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: laser_generic-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for laser_generic-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9efbb46644182c59296abe2ce7fd3db91ad706802f90f8cf9d75238fc7c94ee0
MD5 4607fcecc7733163a91443816905df1a
BLAKE2b-256 1447e0dbf30688e1483e85a8da612507f40cf7e9adde4b8b0d5b0a471a81ab07

See more details on using hashes here.

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