Generic, SI/SIR/SEIR/etc., disease models implemented with the LASER toolkit.
Project description
Overview
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file laser_generic-0.1.0-py3-none-any.whl.
File metadata
- Download URL: laser_generic-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c5d6cff189f938d87808749443971e67b141bb0e042d16f242ed178b1bd1317
|
|
| MD5 |
f8b59a56aea293e6668bd7b3c74f592b
|
|
| BLAKE2b-256 |
e009f915cf0cd635e9fe0e784965f4b0ae9b5ba09ff2e8b9c247ddcc5c76bbaa
|