emodpy_hiv.interventions.utils module#

emodpy_hiv.interventions.utils.set_tvmap_lists_from_map(tvmap, param)[source]#

These are mostly temporary hacks that clean up the output json; should go away with subsequent cherry-picks of schema enhancements from other branches.

emodpy_hiv.interventions.utils.broadcast_event_immediate(camp, event_trigger: str = 'Births')[source]#
emodpy_hiv.interventions.utils.broadcast_event_delayed(camp, event_trigger, delay=None)[source]#
emodpy_hiv.interventions.utils.set_intervention_properties(iv, intervention_name: str | None = None, disqualifying_properties: List[str] | None = None, new_property_value: str | None = None)[source]#

Set properties of an intervention.

  • iv – an intervention object.

  • intervention_name (str) – The optional name used to refer to this intervention as a means to differentiate it from others that use the same class. The default name is the name of the class, but providing a unique name allows for distinguishing different configurations. For example, if you were distributing two vaccines where one had a higher efficacy than the other, you could use this parameter to call one ‘HighEfficacyVaccine’ and the other ‘LowEfficacyVaccine’. Doing this would allow you to collect data in reports on each version.

  • disqualifying_properties (List[str]) – A list of IndividualProperty key:value pairs that cause an intervention to be aborted. Right before an intervention is updated, it will check to see if the individual has one of the property values defined in this list. If it does, the intervention will not update and immediately expire.

  • new_property_value (str) – An optional IndividualProperty key:value pair that will be assigned when the intervention is first updated. After the individual gets the intervention and goes to update/apply it for the first time, the intervention first checks to see if the individual has any disqualifying properties. If they do not, then this property value will be assigned.


None, but the intervention object is modified in place.