emodpy_hiv.interventions.cascade_helpers module

emodpy_hiv.interventions.cascade_helpers.reset(camp)[source]

Utility function to clear out the campaign object, mostly useful to test. This function is not auto-imported with the module like the rest of the functions in this submodule. Caller has to explicitly import emodpy_hiv.interventions.cascade_helpers. :param camp: emod_api.campaign object.

Returns:

None.

emodpy_hiv.interventions.cascade_helpers.seed_infection(camp, timestep, coverage)[source]

Seed an infection by time and %age of population infected.

emodpy_hiv.interventions.cascade_helpers.add_triggered_event(camp, in_trigger, out_iv, coverage=1.0, target_sex='All', target_risk='', event_name='')[source]

An alias for triggered_event_common.

Parameters:
  • camp – The central campaign accumulator, from emod_api.campaign.

  • in_trigger (list) – The trigger aka signal for the event. E.g., “NewInfection”

  • out_iv – The output intervention of the event.

  • coverage (float) – The coverage of the event (default is 1.0).

  • target_sex (str) – The target sex for the event (default is “All”).

  • target_risk (str) – The target risk for the event (default is an empty string).

  • event_name (str) – The name of the event (default is an empty string).

Returns:

New campaign event.

emodpy_hiv.interventions.cascade_helpers.triggered_event_common(camp, in_trigger, out_iv, coverage=1.0, target_sex='All', target_risk='', event_name='', delay=None)[source]

Parameterized utility function used by rest of functions in this submodule; listens for a trigger (signal) and distributes an intervention (or list thereof) as a result, based on coverage and targeting.

Parameters:
  • camp – The central campaign accumulator, from emod_api.campaign.

  • in_trigger (list) – The trigger aka signal for the event. E.g., “NewInfection”

  • out_iv – The output intervention of the event.

  • coverage (float) – The coverage of the event (default is 1.0).

  • target_sex (str) – The target sex for the event (default is “All”).

  • target_risk (str) – The target risk for the event (default is an empty string).

  • event_name (str) – The name of the event (default is an empty string).

Returns:

New campaign event.

emodpy_hiv.interventions.cascade_helpers.add_choice(camp, sympto_signal='NewlySymptomatic', get_tested_signal='GetTested')[source]

Listen for a trigger. Defaults to ‘NewlySymptomatic’. Then toss a fair coin; in case of heads, Distribute diagnostic (and publish signal – default is ‘GetTested’; tails maybe it’s just a cold (‘Ignore’).

Parameters:
  • camp – The central campaign accumulator, from emod_api.campaign.

  • sympto_signal (str) – The signal or trigger we are listening for. Doesn’t have to be anything to do with

symptomaticity but defaults to “NewlySymptomatic”.

get_tested_signal (str): The signal/trigger published if coin toss is heads and person gets tested.

emodpy_hiv.interventions.cascade_helpers.add_test(camp, get_tested_signal='GetTested')[source]

Listen for get_tested_signal signal (defaults to “GetTested”). Then give HIV RapidDiagnostic test after a delay of 30 days. Publish ‘HIVPositiveTest’ on +ve or ‘HIVNegativeTest’ on -ve.

emodpy_hiv.interventions.cascade_helpers.trigger_art_from_pos_test(camp, input_signal='HIVPositiveTest', output_signal='StartTreatment', lag_time=30)[source]

Listen for HIVPositiveTest trigger. Then Trigger ART. Note that Trigger ART isn’t same as starting it.

emodpy_hiv.interventions.cascade_helpers.add_art_from_trigger(camp, signal='StartTreatment')[source]

Actually distribute ART if a StartTreatment signal/trigger is observed. Broadcast a StartedART signal synchronously.

emodpy_hiv.interventions.cascade_helpers.trigger_art(camp, timestep, coverage, trigger='StartTreatment')[source]

Schedule a broadcast of StartTreatment (or equivalent), not based on any observed signals.