Contagious diseases simulation using Agent-Based Models
Project description
CDSLib - Agents
Welcome to CDSLib - Agents package.
License
Sponsors
Code quality metrics
Description
As part of the Contagious Disease Simulation Library, the CDSLib - Agents package is intended to be used for modelling and simulating contagious diseases using Agent-Based Models and it has been used for the development of the Contagious Disease Simulation Laboratory.
The package consists of different implementations of a heterogeneous population of agents following rules of behavior that determine their movement and the evolution of their infectious and clinical states.
The current implementation allows Agents to move in a bidemensional space following a distribution of velocities based on population data. This can be achieved thanks to the inclusion Distribution module which is a wrapper for different tools that provides distribution-like function support.
In regards to the disease states, the current implementation also allows the user to add as much states as preferred, and to create custom natural history of the disease (i.e. the design a custom graph for evolution of disease states).
For more information, please refer to the official documentation of the project.
Testing
All the tests were developed with the python tool pytest. To see them properly, type in the command line:
$ poetry run pytest <name_of_test_file>
in the same ubication of the test file.
Flags are used with pytest for modifying the aspect of the output
report. Typing flags using pytest might be tedious, however, it is possible modify the pytest.init
file for
change defaulting command line options. This allows to adopt as many flags
as necesary. In our case, it was adopted the flags: -s
, --no-header
, -rA
, -vv
,
--cov
, --cov-branch
.
During test execution with pytest, any output sent to stdout and stderr is
captured. The -s
flag
disable all capturing and lets the user look at all the outputs, this is very
important because the description of all tests was typed in the docstring of each method.
The --no-header
flag disables the initial header.
The -rA
flag shows extra test summary info of all the tests.
The -vv
flag indicates to pytest run in verbosity mode, this controls all the pytest outputs.
The flag --cov
produces a coverage reports. It shows the percentage of code lines covered by the test, while --cov-branch
shows the branches covered. A branch is
a decision taken by the code when it finds an if sentence or similar.
For more information about pytest flags.
Instead of running one test, it is possible to run all the tests at the same time. You must be inside of tests
directory, and type in the command line:
$ poetry run pytest
So as to Modify the initial conditions of the test, use the fixtures methods at the beginning of all the tests files.
Authors and main contributors
This package is authored by Camilo Hincapié (main author), Ian Mejía, Emil Rueda, Nicole Rivera and Carolina Rojas Duque and the conceptual contributions about epidemiology of Lina Marcela Ruiz Galvis.
Other remarkably contributors to this work were Alejandro Campillo and Daniel Alfonso Montoya.
Contact us
For any suggestion on the development of this type of models, please our official channels of dicussions provided by GitHub.
Development
Create the virtualenv
This package is managed using Pyenv and Poetry. In order to create the virtualenv correctly use:
$ pyenv install 3.9.7
$ poetry env use 3.9.7
$ poetry install
Then activate the virtualenv running poetry shell
, and to deactivate the virtual
environment and exit this new shell type exit
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cdslib_agents-0.0.9.tar.gz
.
File metadata
- Download URL: cdslib_agents-0.0.9.tar.gz
- Upload date:
- Size: 134.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.0 Linux/5.13.0-44-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af8c78d766797d588a287396a3cd3ebe43326e01cbaba23bbf7d9eb5d2836c17 |
|
MD5 | 7d6831673e819fb45fbb42f7042b1db1 |
|
BLAKE2b-256 | 0451f05ddca76df506d31fd74e8d5cf96f16221015b393346b15238df2f985bc |
File details
Details for the file cdslib_agents-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: cdslib_agents-0.0.9-py3-none-any.whl
- Upload date:
- Size: 68.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.0 Linux/5.13.0-44-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd3046909c09239bdd7119c7bcb3c70f0133bd1dcaa0eb72a6e3cd18b1f7a2c1 |
|
MD5 | 935f593c4a4f798d5c6cd4ba69647241 |
|
BLAKE2b-256 | b52e6330dc0797c8f73cbc02b5e57c1899938e67a794316287bef2e440bd2793 |