Welcome to emodpy-tbhiv

emodpy-tbhiv is a collection of Python scripts and utilities created to streamline user interactions with EMOD and idmtools for modeling measles. Much of the functionality is inherited from the emod_api and emodpy packages.

Additional information about how to use idmtools can be found at in Welcome to idmtools. Additional information about EMOD TBHIV parameters for modeling tuberculosis can be found in EMOD parameter reference.

Installation

You can install emodpy-tbhiv using the instructions in the GitHub repository README.

emodpy_tbhiv

emodpy_tbhiv package

The emodpy-tbhiv module is intended to house scripts and tools that enable disease modelers to work more easily with the IDM EMOD TBHIV model.

Subpackages

emodpy_tbhiv.demographics package
Submodules
emodpy_tbhiv.demographics.TBHIVDemographics module
class emodpy_tbhiv.demographics.TBHIVDemographics.TBHIVDemographics(nodes=None, 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 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()

Insert some notion of a default HIVCoInfection distribution.

SetHIVTBCoInfectionMortalityDistribution()

Insert some notion of a default HIVTBCoInfection Mortality distribution.

class emodpy_tbhiv.demographics.TBHIVDemographics.TBHIVDemographicsWithGenderExtrapolation(file_male, file_female, pop=1000000.0, regression_interval=[1970, 1980], which_point='mid', predict_horizon=2050)

Bases: emodpy_tbhiv.demographics.TBHIVDemographics.TBHIVDemographics

do_extrapolation(add_to_list=True)
makeplots(save=None)
create_json_overlay(template, output_name='Extract_demog.json', csv_out=False, n=0, results_scale_factor=0.0027397260273972603)

This almost certainly needs to be refactored to use the base class ‘generate_file’ functionality.

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

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

emodpy_tbhiv.demographics.TBHIVDemographics.fromData(pop=1000000.0, filename_male='Malawi_male_mortality.csv', filename_female='Malawi_female_mortality.csv')
emodpy_tbhiv.interventions package
emodpy_tbhiv.interventions.purge_campaign_event(camp_event)
Submodules
emodpy_tbhiv.interventions.active_diagnostic module
emodpy_tbhiv.interventions.active_diagnostic.ActiveDiagnostic(camp, trigger_treatment_list, active_sensitivity=1.0, active_specificity=1.0, pos_event='TBTestPositive', treatment_fraction=1, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='TB Diagnosis Active Simple')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.active_diagnostic.new_intervention_as_file(camp, start_day=1, filename=None)
emodpy_tbhiv.interventions.art module
emodpy_tbhiv.interventions.art.ART(camp, trigger_treatment_list, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='ART')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.art.new_intervention_as_file(camp, filename='art.json')
emodpy_tbhiv.interventions.bcg module
emodpy_tbhiv.interventions.bcg.BCG(camp, trigger_treatment_list, initial_efficacy=1.0, vaccine_take=1, age_take_decay=1.0, box_duration=365, immune_decay=3650, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='Vaccine Health Seeking')

BCG Vaccine :param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.bcg.new_intervention_as_file(camp, filename=None)
emodpy_tbhiv.interventions.cd4diag module
emodpy_tbhiv.interventions.cd4diag.get_thresh(name, low, high, camp)
emodpy_tbhiv.interventions.cd4diag.get_threshes(group_names, camp)
emodpy_tbhiv.interventions.cd4diag.CD4Diag(camp, trigger_treatment_list, event_200='Below200', event_350='Below350', event_500='Below500', event_above_500='Above500', start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='CD4 Diagnostic')

ART :param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.cd4diag.new_intervention_as_file(camp, filename='cd4.json')
emodpy_tbhiv.interventions.diag_treat_neg module
emodpy_tbhiv.interventions.diag_treat_neg.DiagnosticTreatNeg(camp, trigger_treatment_list, base_sensitivity_smearpos=1.0, base_sensitivity_smearneg=1.0, pos_event='TBTestPositive', neg_event='TBTestNegative', def_event='TBTestDefault', treatment_fraction=1, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='TB Diagnosis')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.diag_treat_neg.new_intervention_as_file(camp, filename='dtn.json')
emodpy_tbhiv.interventions.hiv_diag module
emodpy_tbhiv.interventions.hiv_diag.HIVDiagnostic(camp, trigger_treatment_list, base_sensitivity=1.0, base_specificity=1.0, pos_event='HIVTestedPositive', neg_event='HIVTestedNegative', treatment_fraction=1, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='HIV Diagnostic')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.hiv_diag.new_intervention_as_file(camp, filename=None)
emodpy_tbhiv.interventions.hiv_seeding module
emodpy_tbhiv.interventions.hiv_seeding.HIV(camp, time_offset=0, disease='HIV', reps=- 1, interval=1, start_day=0, nodeIDs=[], event_name='HIV Incidence')
emodpy_tbhiv.interventions.hiv_seeding.new_intervention_as_file(camp, filename='hiv.json')
emodpy_tbhiv.interventions.hsb module
emodpy_tbhiv.interventions.hsb.HSB(camp, trigger_treatment_list, output_event, probability_per_step=1.0, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='HSB')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.hsb.new_intervention_as_file(camp, filename='hsb_diag.json')
emodpy_tbhiv.interventions.ramp_dtn module
emodpy_tbhiv.interventions.ramp_dtn.RampDTN(camp, trigger_treatment_list, ramp_time=30, base_sensitivity_smearpos=1.0, base_sensitivity_smearneg=1.0, base_sensitivity_smearpos2=1.0, base_sensitivity_smearneg2=1.0, treatment_fraction=1.0, treatment_fraction2=1.0, pos_event='TBTestPositive', neg_event='TBTestNegative', defaulters_event='TBTestDefault', pos_event2='TBTestPositive', neg_event2='TBTestNegative', defaulters_event2='TBTestDefault', start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='RampDTN')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.ramp_dtn.new_intervention_as_file(camp, filename='ramp.json')
emodpy_tbhiv.interventions.resist_diag module
emodpy_tbhiv.interventions.resist_diag.ResistanceDiagnostic(camp, trigger_treatment_list, sensitivity=1.0, specificity=1.0, pos_event='TBMDRTestPositive', neg_event='TBMDRTestNegative', def_event='TBMDRTestDefault', treatment_fraction=1, treatment_fraction_negative_test=1, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='TB Diagnosis MDR')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.resist_diag.new_intervention_as_file(camp, filename='resist_diag.json')
emodpy_tbhiv.interventions.smear_diag module
emodpy_tbhiv.interventions.smear_diag.SmearDiagnostic(camp, trigger_treatment_list, base_sensitivity_smearpos=1.0, base_sensitivity_smearneg=1.0, pos_event='TestPositiveOnSmear', treatment_fraction=1, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='TB Diagnosis Smear Simple')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.smear_diag.new_intervention_as_file(camp, filename='smear_diag.json')
emodpy_tbhiv.interventions.tb_treat_basic module
emodpy_tbhiv.interventions.tb_treat_basic.TBDrugTreatment(camp, trigger_treatment_list, drug_name='DOTS', inactivation_rate=0, mortality_rate=0, clearance_rate=0, resistance_rate=0, relapse_rate=0, reduced_transmit=1.0, start_day=0, treatment_duration=180, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='TBDrugTreatment')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.tb_treat_basic.new_intervention_as_file(camp, filename=None)
emodpy_tbhiv.interventions.tbhiv_treat module
emodpy_tbhiv.interventions.tbhiv_treat.TBHIVDrugTreatment(camp, trigger_treatment_list, drug_name, latent_multiplier=1.0, active_multiplier=1.0, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='TBHIVDrugTreatment')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.tbhiv_treat.new_intervention_as_file(camp, filename='tb_drug_treat.json')
emodpy_tbhiv.interventions.triggered_pvc module
emodpy_tbhiv.interventions.triggered_pvc.TPVC(camp, trigger_treatment_list, property_to_change, final_prop_value, revert=0, daily_prob=1, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='PropertyValueChanger')

Triggered Property Value Changer :param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.triggered_pvc.new_intervention_as_file(camp, filename='tpvc.json')
emodpy_tbhiv.interventions.vaccine module
emodpy_tbhiv.interventions.vaccine.Vaccine(camp, trigger_treatment_list, initial_efficacy=1.0, vaccine_take=1, vtype='AcquisitionBlocking', box_duration=365, immune_decay=3650, start_day=0, duration=- 1, property_restrictions_list=[], nodeIDs=[], black_period=0, black_trigger='Blackout', event_name='Vaccine')

:param TBD Note start_day is initialized as 1, recommend that this be aligned with the start of the simulation

emodpy_tbhiv.interventions.vaccine.new_intervention_as_file(camp, filename='vaccine.json')
emodpy_tbhiv.reporters package
Submodules
emodpy_tbhiv.reporters.plugin module
class emodpy_tbhiv.reporters.plugin.Report_TBHIV_ByAge(name: str = 'Report_TBHIV_ByAge', Enabled: bool = True, Reports: list = <factory>, dll_file: str = 'lib_customreport_TBHIV_ReportByAge.dll')

Bases: emodpy.reporters.base.CustomReporter

name: str = 'Report_TBHIV_ByAge'
dll_file: str = 'lib_customreport_TBHIV_ReportByAge.dll'
configure_report(max_age_yrs, min_age_yrs, start_year, stop_year, events=None)