Skip to main content

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

Project description

Overview

Documentation Build Status build 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

Getting Started and Documentation

We recommend using the LASER documentation to familiarize yourself with the LASER disease modeling framework. However, the instructions below may be sufficient for those who want to jump right in.

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/laser-core/laser-generic/archive/main.zip

Using laser-generic

laser-generic can be used in your code after importing it into your project:

import laser.generic as lg

print(lg.__version__)

Development

  1. clone the laser-generic repository with
git clone https://github.com/laser-base/laser-generic.git
  1. install uv _in your system [Python], i.e., before creating and activating a virtual environment

  2. install tox as a tool in uv with the tox-uv plugin with

uv tool install tox --with tox-uv
  1. change to the laser-generic directoryh with
cd laser-generic
  1. create a virtual environment for development with
uv venv .venv
  1. activate the virtual environment with

Mac or Linux:

source .venv/bin/activate

Windows:

.venv\bin\Activate

Building Code in Development

Option 1: build "live" code - Python scripts using laser.generic will import the code directly from the repository clone. Edits to the source code will take effect upon restarting the Python environment and importing laser.generic.

with pip:

pip install -e ".[dev]"

with uv:

uv pip install -e ".[dev]"

Option 2: build an installable package - this package must be installed into an environment to be used and changes to the source code on disk will not be picked up by consumers of laser.generic until the package is rebuilt and reinstalled. However this process mirrors using laser.generic as a dependency better than the "live code" option above.

Option 2A: build with pip

  • install the build package: python3 -m pip install build
  • build the laser-generic Python packge: python3 -m build
  • find the wheel file, .whl, in the dist directory: ls -l dist

Option 2B: build with uv

  • uv build
  • find the wheel file, .whl, in the dist directory: ls -l dist

Running Tests

Now you can run tests in the tests directory or run the entire check+docs+test suite with tox. Running tox will run several consistency checks, build documentation, run tests against the supported versions of Python, and create a code coverage report based on the test suite. Note that the first run of tox may take a few minutes (~5). Subsequent runs should be quicker depending on the speed of your machine and the test suite (~2 minutes). You can use tox to run tests against a single version of Python with, for example, tox -e py312.


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.1-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: laser_generic-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 39.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 679f243da56a495425e16b771a2e88289ca8c39e5bca2134dfbf70971da7b218
MD5 fb2f90c5d8fd5e0c5d37c8273328f76b
BLAKE2b-256 c75f5598f630ea2c0751e994c6a911a770b3d09363382e3f63e924efd8405574

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