emod_api.demographics.Demographics module¶
-
emod_api.demographics.Demographics.
from_template_node
(lat=0, lon=0, pop=1000000.0, name='Erewhon', forced_id=1)¶ This function creates a single-node Demographics instance from the params you give it.
-
emod_api.demographics.Demographics.
from_file
(base_file)¶
-
emod_api.demographics.Demographics.
get_node_ids_from_file
(demographics_file)¶
-
emod_api.demographics.Demographics.
get_node_pops_from_params
(tot_pop, num_nodes, frac_rural)¶
-
emod_api.demographics.Demographics.
from_params
(tot_pop=1000000.0, num_nodes=100, frac_rural=0.3, id_ref='from_params')¶ This function creates an EMOD-compatible Demographics object with the population and number of nodes specified, distributing per the additional parameters.
-
emod_api.demographics.Demographics.
from_csv
(input_file, res=0.008333333333333333)¶ This function uses a csv population-by-node file to create an EMOD-compatible Demographics object.
-
emod_api.demographics.Demographics.
from_pop_csv
(pop_filename_in, pop_filename_out='spatial_gridded_pop_dir', site='No_Site')¶
-
class
emod_api.demographics.Demographics.
Demographics
(nodes, idref='Gridded world grump2.5arcmin', base_file=None)¶ Bases:
emod_api.demographics.BaseInputFile.BaseInputFile
This class is a container of data necessary to produce a EMOD-valid demographics input file. It can be initialized from an existing valid demographics.joson type file or from an array of valid Nodes.
-
generate_file
(name='demographics.json')¶
-
property
node_ids
¶
-
property
node_count
¶
-
get_node
(nodeid)¶ Return the node idendified by nodeid. Search either name or actual id :param nodeid: :return:
-
SetIndividualAttributesWithFertMort
(CrudeBirthRate=0.04, CrudeMortRate=0.02)¶
-
AddIndividualPropertyAndHINT
(Property, Values, InitialDistribution=None, TransmissionMatrix=None)¶ This function takes the HINT configuration json, which are presumed to be correct, and inserts them into the right place in the demoagrphics json struture.
-
AddAgeDependentTransmission
(Age_Bin_Edges_In_Years=[0, 1, 2, - 1], TransmissionMatrix=[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]])¶
-
SetDefaultIndividualAttributes
()¶ NOTE: This is very Measles-ish. We might want to move into MeaslesDemographics
-
SetMinimalNodeAttributes
()¶
-
SetDefaultNodeAttributes
(birth=True)¶
-
SetDefaultIndividualProperties
()¶
-
SetDefaultProperties
()¶
-
SetDefaultPropertiesFertMort
(CrudeBirthRate=0.04, CrudeMortRate=0.02)¶ Set defaults assuming constant birth and mortality rate
-
SetDefaultFromTemplate
(template, setter_fn=None)¶
-
SetNodeDefaultFromTemplate
(template, setter_fn)¶
-
SetOverdispersion
(new_overdispersion_value, nodes=[])¶
-
SetConstantSusceptibility
()¶
-
SetHeteroRiskUniformDist
(min_risk=0, max_risk=1)¶
-
SetHeteroRiskLognormalDist
(mean=1.0, sigma=0)¶
-
SetHeteroRiskExponDist
(mean=1.0)¶
-
SetInfectivityMultiplierByNode
(node_id_to_multplier)¶
-