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.
See Welcome to idmtools for a diagram showing how idmtools and each of the related packages are used in an end-to-end workflow using EMOD as the disease transmission model.
emodpy-tbhiv installation¶
Follow the steps below to install emodpy-tbhiv.
Prerequisites¶
First, ensure the following prerequisites are met.
Windows 10 Pro or Enterprise, Linux, or Mac
Python 3.6 64-bit (https://www.python.org/downloads/release)
A file that indicates the pip index-url:
Windows
Linux
In C:\Users\Username\pip\pip.ini, containing the following:
[global] index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
In $HOME/.config/pip/pip.conf, containing the following:
[global] index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
Installation instructions¶
Open a command prompt and create a virtual environment in any directory you choose. The command below names the environment “v-emodpy-tbhiv”, but you may use any desired name:
python -m venv v-emodpy-tbhiv
Activate the virtual environment:
Windows
Linux
Enter the following:
v-emodpy-tbhiv\Scripts\activate
Enter the following:
source v-emodpy-tbhiv/bin/activate
Install emodpy-tbhiv packages:
pip install emodpy-tbhiv
If you are on Python 3.6, also run:
pip install dataclasses
If you are on Linux, also run:
pip install keyrings.alt
When you are finished, deactivate the virtual environment by entering the following at a command prompt:
deactivate
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¶
-
class
emodpy_tbhiv.demographics.TBHIVDemographics.
TBHIVDemographics
(pop, 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.
-
-
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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¶
-
class
emodpy_tbhiv.reporters.plugin.
Report_TBHIV_ByAge
(name: str = 'Report_TBHIV_ByAge', Enabled: bool = True, Reports: list = <factory>, dll_file: str = 'libreport_TBHIV_ByAge.dll')¶ Bases:
emodpy.reporters.base.CustomReporter
-
configure_report
(max_age_yrs, min_age_yrs, start_year, stop_year, events=None)¶
-