Skip to content

fenfisdi/cdslib_agents

Repository files navigation

CDSLib - Agents

Welcome to CDSLib - Agents package.

Open Source Love svg2 PyPI PyPI - Python Version Maintenance GitHub contributors

License

license

Sponsors

Sponsored by Sponsored by Sponsored by
UdeA logo Minciencias logo Sena logo

Code quality metrics

Quality Gate Status Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

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.

repo_logo

Authors and main contributors

GitHub 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.

About

CDSLib - Agent Based Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages