emodpy_tbhiv.demographics.TBHIVDemographics module

class emodpy_tbhiv.demographics.TBHIVDemographics.TBHIVDemographics(pop=None, nodes=None, idref='Gridded world grump2.5arcmin', base_file=None)[source]

Bases: Demographics

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

SetHIVCoInfectionDistribution()[source]

Insert some notion of a default HIVCoInfection distribution.

SetHIVTBCoInfectionMortalityDistribution()[source]

Insert some notion of a default HIVTBCoInfection Mortality distribution.

emodpy_tbhiv.demographics.TBHIVDemographics.fromBasicNode(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1, implicit_config_fns=None)[source]

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

emodpy_tbhiv.demographics.TBHIVDemographics.from_template_node(lat=0, lon=0, pop=1000000.0, name=1, forced_id=1)[source]

Create a single-node TBHIVDemographics instance from the parameters you supply.

Parameters:
  • lat – Latitude of the centroid of the node to create.

  • lon – Longitude of the centroid of the node to create.

  • pop – Human population of the node.

  • name – The name of the node. This may be a characteristic of the node, such as “rural” or “urban”, or an identifying integer.

  • forced_id – The node ID for the single node.

Returns:

A TBHIVDemographics instance.

emodpy_tbhiv.demographics.TBHIVDemographics.fromData(pop=1000000.0, filename_male=None, filename_female=None)[source]
emodpy_tbhiv.demographics.TBHIVDemographics.from_csv(pop_file, res=0.008333333333333333, id_ref='from_csv', filename_male=None, filename_female=None)[source]

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

Parameters:
  • pop_file – The path to the csv file to ingest.

  • res – Resolution.

  • id_ref – A string to identify the file, needs to match other input files.

  • filename_male – Path to male mortality csv.

  • filename_female – Path to female mortality csv.

Returns:

A TBHIVDemographics instance

emodpy_tbhiv.demographics.TBHIVDemographics.from_params(tot_pop=1000000.0, num_nodes=100, frac_rural=0.3, id_ref='from_params', filename_male=None, filename_female=None)[source]

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

  • filename_male – Path to male mortality csv.

  • filename_female – Path to female mortality csv.

Returns:

A TBHIVDemographics instance.