Welcome to emodpy-measles

emodpy-measles is a collection of Python scripts and utilities created to streamline user interactions with EMOD and idmtools for modeling measles. Much of the functionality is inherited from the emod_api and emodpy packages.

Additional information about how to use idmtools can be found at in Welcome to idmtools. Additional information about EMOD generic parameters for modeling measles can be found in EMOD parameter reference.

Installation

You can install emodpy-measles using the instructions in the GitHub repository README: https://github.com/InstituteforDiseaseModeling/emodpy-measles/tree/master/examples/katherine

emodpy_measles

emodpy_measles package

The emodpy-measles module is intended to house scripts and tools that enable disease modelers to work more easily with the IDM EMOD Measles model.

Subpackages

emodpy_measles.demographics package
Submodules
emodpy_measles.demographics.MeaslesDemographics module
class emodpy_measles.demographics.MeaslesDemographics.MeaslesDemographics(nodes, idref='Gridded world grump2.5arcmin', base_file=None)

Bases: emod_api.demographics.Demographics.Demographics

This class is derived from emod_api.demographics’ Demographics class so that we can set certain defaults for Measles in construction. Keen observers will note thatt SetDefaultProperties does not look like a measles-specific function. But as we add other disease types the generatlizations and speicfics will become clearer. The architectural point is solid.

emodpy_measles.demographics.MeaslesDemographics.from_template_node(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1)

This function creates a single-node MeaslesDemographics instance from the params you give it.

emodpy_measles.demographics.MeaslesDemographics.from_params(tot_pop=1000000.0, num_nodes=100, frac_rural=0.3, id_ref='from_params')

Create a multi-node MeaslesDemographics instance as a synthetic population based on a few parameters.

Parameters
  • tot_pop – The total human population in the node.

  • num_nodes – The number of nodes to create.

  • frac_rural – The fraction of the population that is rural.

  • id_ref – Method describing how the latitude and longitude values are created for each of the nodes in a simulation. “Gridded world” values use a grid overlaid across the globe at some arcsec resolution. You may also generate the grid using another tool or coordinate system. For more information, see Metadata.

Returns

A Measles instance.

emodpy_measles.demographics.MeaslesDemographics.from_pop_csv(pop_filename_in, site='No_Site', min_node_pop=0)

Create a multi-node MeaslesDemographics instance from a CSV file describing a population.

Parameters
  • pop_filename_in – The path to the demographics file to ingest.

  • pop_filename_out – The path to the file to output.

  • site – A string to identify the country, village, or trial site.

Returns

A MalariaDemographics instance.

emodpy_measles.demographics.MeaslesDemographics.get_file_from_http(url)

Get data files from simple http server.

emodpy_measles.interventions package
The below imports let you do stuff like:

from emodpy_measles.interventions import * a = SimpleSIA()

If you want to access all the iv function creates directly without scoping/qualifying them.

Submodules
emodpy_measles.interventions.complex_import module
emodpy_measles.interventions.complex_import.ComplexImportationEvent(camp, dips=[0.00012919896640826872], durs=[100000], timestep=1, nodes=None)

Import the Disease

Parameters
  • DailyImportPressures – How Much? A rate of per-day importation for each node that the intervention is distributed to.

  • Durations – How Long? The durations over which to apply import pressure.

  • timestep – When? Day to start campaign event.

  • nodes – Where? Geographic nodes to target.

Be careful when configuring import pressure in multi-node simulations. Daily_Import_Pressures defines a rate of per-day importation for each node that the intervention is distributed to. In a 10 node simulation with Daily_Import_Pressures = [0.1, 5.0], the total importation rate summed over all nodes will be 1/day and 50/day during the two time periods. You must divide the per-day importation rates by the number of nodes.

emodpy_measles.interventions.complex_import.new_intervention_as_file(camp, timestep, filename=None)
emodpy_measles.interventions.measles_vaccine module
emodpy_measles.interventions.measles_vaccine.SimpleMCV1(camp, timestep, coverage=1.0, nodes=None)
emodpy_measles.interventions.measles_vaccine.SimpleMCV2(camp, timestep, coverage=1.0, nodes=None)
emodpy_measles.interventions.measles_vaccine.new_intervention_as_file(camp, timestep, filename=None)
emodpy_measles.interventions.simple_sia module
emodpy_measles.interventions.simple_sia.SimpleSIA(camp, Event_Name='SIA', timestep=1, Target_Age_Min=0.75, Target_Age_Max=5.0, Coverage=1.0, nodes=None)

This function needs a doc string!

emodpy_measles.interventions.simple_sia.new_intervention_as_file(camp, timestep, filename=None)
emodpy_measles.interventions.targeted_outbreak module
emodpy_measles.interventions.targeted_outbreak.seed(camp, timestep, coverage=0.01, node_ids=None)

This simple function provides a very common piece of functionality to seed an infection.

Submodules

emodpy_measles.campaign module
class emodpy_measles.campaign.CampaignInfo(startday, agemin, agemax, region, coverage, label)

Bases: tuple

property agemax

Alias for field number 2

property agemin

Alias for field number 1

property coverage

Alias for field number 4

property label

Alias for field number 5

property region

Alias for field number 3

property startday

Alias for field number 0

emodpy_measles.campaign.ConstructHistoricalCampaigns()

Building historical campaign calendar by hand from the WHO calendar, rather than trying to process that file, which has a free-form “comment field” with important info. Coverages from scenario files. Ignoring mopup and OBR, including the large OBR in NE in Jan 2017 Format (date, minimum age target, maximum age target, target region, target coverage, SIA ID)