emodpy_generic.demographics.GenericDemographics module

class emodpy_generic.demographics.GenericDemographics.GenericDemographics(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 Generic in construction. As we add other disease types, the generalizations and speicfics will become clearer.

emodpy_generic.demographics.GenericDemographics.fromBasicNode(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1)

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

Parameters
  • lat – latitude (not really used)

  • lon – longitude (not really used)

  • pop – population. Defaults to 1 million.

  • name – node name (not really used)

  • forced_id – node id (not really used)

Returns

GENERIC_SIM demographics instance which can be customized and/or written to file.

emodpy_generic.demographics.GenericDemographics.from_template_node(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1)

Create a single-node GenericDemographics instance from the params you give it.

Parameters
  • lat – latitude (not really used)

  • lon – longitude (not really used)

  • pop – population. Defaults to 1 million.

  • name – node name (not really used)

  • forced_id – node id (not really used)

Returns

GENERIC_SIM demographics instance which can be customized and/or written to file.

emodpy_generic.demographics.GenericDemographics.from_params(tot_pop=1000000.0, num_nodes=100, frac_rural=0.3, id_ref='from_params')

Create a multi-node genericDemographics 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 generic instance.

emodpy_generic.demographics.GenericDemographics.from_csv(pop_filename_in, site='No_Site', min_node_pop=0)

Create a multi-node GenericDemographics 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.