API Usage

  • instalation through pypy not yet implemented
  • make setup.py installer
  • from a python script, call import cv19

This project is organized as an API to be used from a python prompt.

Steps:

  • Complete the configuration of the experiment
  • All the settings of the experimets are parsed from the configuration files using configparser.

Prerequisites

  • Put data files on the dat directory.
  • Complete the names of the data files in the configuration file

Notebooks

Hasta ahora hay dos notebooks que son mas que nada exploratorios de los datos compilados por Johns Hopkins CSSE

world.ipynb:
carga datos de la poblacion y area de los paises para construir una tabla con esos dos datos. Luego se usará para normalizar las curvas de contagio de los diferentes países.
load_data.ipynb:
Carga los datos de JHU CSSE y analiza las curvas de contagio de algunos países.

DATA

Los datos actualizados son leidos directamente de GitHub, no hace falta bajarlos.

Los datos sobre poblacion y area de los países:

table-1.csv:
source: https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_area preprocessed with https://wikitable2csv.ggor.de/
table-2.csv:
source: https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations) preprocessed with https://wikitable2csv.ggor.de/
world_area.csv:
Tabla limpia con las areas
world_population.csv:
Tabla limpia con las poblaciones
world.ods:
Archivo ODS con las dos tablas (para verificar a ojo)
pop_area.csv:
Tabla con las columnas de poblacion y area combinadas

Data is stored in the dat directory.

filename contents
covid_df.csv Covid-19 world data
pop_area.csv Population of countries
table-1.csv  
table-2.csv  
table_age.csv Age distribution table
table_clean.csv  
table_population_cordoba.csv Age distribution in Cordoba
table_population_world.csv  
world.ods  
world_area.csv  
world_population.csv  

Configuration files

Command line usage

For a simple test, go to src and run:

API usage

To use functionalities, import the cv19 module:

import cv19

First, we must parse the configuration parameters from the .ini file.

All parameters with an assigned value must be read with the configparser module. The ConfigParser class is inherited in cv19.parser.

Variables can be accessed using the names of the sections and the names of the fields. For example, conf[‘clinical’][‘bed_stay’].

conf = cv19.parser()
conf.check_file(argv)
conf.read_config_file()
conf.load_filenames()
conf.load_parameters()

Finally, the simulation is made with the cv19.InfectionCurve class, where the function cv19.InfectionCurve.compute() makes the computations.

c = cv19.InfectionCurve()
t, I = c.compute(conf.p)
c.plt_IC_n(t, [I], conf.filenames.fname_infected)