Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TB culture HSI #1453

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Git LFS file not shown

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def YEAR_OF_CHANGE_FOR_HSS(self) -> int:
@property
def YEAR_OF_CHANGE_FOR_HTM(self) -> int:
"""Year in which HIV, TB, Malaria scale-up changes are made."""
return 2019
return 2015 # <-- todo changing this to 2015, to match Tara's run. Also note that it's not the same as the Year of change for the HSS

def baseline(self) -> Dict:
"""Return the Dict with values for the parameter changes that define the baseline scenario. """
Expand All @@ -39,6 +39,11 @@ def baseline(self) -> Dict:
},
)

def baseline_mode1(self) -> Dict:
"""Return the Dict with values for the parameter changes that define the baseline scenario when using Mode 1.
"""
return get_parameters_for_status_quo() # <-- Parameters that have been the calibration targets

def double_capacity_at_primary_care(self) -> Dict:
return {
'HealthSystem': {
Expand Down Expand Up @@ -126,7 +131,7 @@ def hiv_scaleup(self) -> Dict:
"""The parameters for the scale-up of the HIV program"""
return {
"Hiv": {
'type_of_scaleup': 'max', # <--- using MAXIMUM SCALE-UP as an experiment
'type_of_scaleup': 'max', # <--- todo: using MAXIMUM SCALE-UP as an experiment
'scaleup_start_year': self.YEAR_OF_CHANGE_FOR_HTM,
}
}
Expand All @@ -135,7 +140,7 @@ def tb_scaleup(self) -> Dict:
"""The parameters for the scale-up of the TB program"""
return {
"Tb": {
'type_of_scaleup': 'max', # <--- using MAXIMUM SCALE-UP as an experiment
'type_of_scaleup': 'max', # <--- todo: using MAXIMUM SCALE-UP as an experiment
'scaleup_start_year': self.YEAR_OF_CHANGE_FOR_HTM,
}
}
Expand All @@ -144,7 +149,7 @@ def malaria_scaleup(self) -> Dict:
"""The parameters for the scale-up of the Malaria program"""
return {
'Malaria': {
'type_of_scaleup': 'max', # <--- using MAXIMUM SCALE-UP as an experiment
'type_of_scaleup': 'max', # <--- todo: using MAXIMUM SCALE-UP as an experiment
'scaleup_start_year': self.YEAR_OF_CHANGE_FOR_HTM,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def __init__(self):
self.seed = 0
self.start_date = Date(2010, 1, 1)
self.end_date = Date(2031, 1, 1)
self.pop_size = 100_000
self.pop_size = 50_000 # <--- todo: N.B. very small population size
self._scenarios = self._get_scenarios()
self.number_of_draws = len(self._scenarios)
self.runs_per_draw = 3 # <--- todo: N.B. Very small number of repeated run, to be efficient for now
self.runs_per_draw = 1 # <--- todo: N.B. Very small number of repeated run, to be efficient for now

def log_configuration(self):
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
"""This Scenario file run the model under different assumptions for the HealthSystem and Vertical Program Scale-up

Run on the batch system using:
```
tlo batch-submit
src/scripts/comparison_of_horizontal_and_vertical_programs/scenario_vertical_programs_with_and_without_hss.py
```

"""

from pathlib import Path
from typing import Dict

from scripts.comparison_of_horizontal_and_vertical_programs.scenario_definitions import (
ScenarioDefinitions,
)
from tlo import Date, logging
from tlo.analysis.utils import mix_scenarios
from tlo.methods.fullmodel import fullmodel
from tlo.methods.scenario_switcher import ImprovedHealthSystemAndCareSeekingScenarioSwitcher
from tlo.scenario import BaseScenario


class HTMWithAndWithoutHSS(BaseScenario):
def __init__(self):
super().__init__()
self.seed = 0
self.start_date = Date(2010, 1, 1)
self.end_date = Date(2031, 1, 1)
self.pop_size = 50_000 # <--- todo: N.B. very small population size
self._scenarios = self._get_scenarios()
self.number_of_draws = len(self._scenarios)
self.runs_per_draw = 1 # <--- todo: N.B. Very small number of repeated run, to be efficient for now

def log_configuration(self):
return {
'filename': 'htm_with_and_without_hss',
'directory': Path('./outputs'),
'custom_levels': {
'*': logging.WARNING,
'tlo.methods.demography': logging.INFO,
'tlo.methods.demography.detail': logging.WARNING,
'tlo.methods.healthburden': logging.INFO,
'tlo.methods.healthsystem': logging.WARNING,
'tlo.methods.healthsystem.summary': logging.INFO,
'tlo.methods.hiv': logging.INFO,
'tlo.methods.tb': logging.INFO,
'tlo.methods.malaria': logging.INFO,
}
}

def modules(self):
return (
fullmodel(resourcefilepath=self.resources)
+ [ImprovedHealthSystemAndCareSeekingScenarioSwitcher(resourcefilepath=self.resources)]
)

def draw_parameters(self, draw_number, rng):
if draw_number < len(self._scenarios):
return list(self._scenarios.values())[draw_number]

def _get_scenarios(self) -> Dict[str, Dict]:
"""Return the Dict with values for the parameters that are changed, keyed by a name for the scenario."""
# Load helper class containing the definitions of the elements of all the scenarios
scenario_definitions = ScenarioDefinitions()

# We are forcing consumables to be available for everything from 2015
consumables_all_available = {
'HealthSystem': {
'year_cons_availability_switch': 2015,
'cons_availability_postSwitch': 'all',
}
}

return {
"Baseline":
mix_scenarios(
scenario_definitions.baseline(),
consumables_all_available,
),

# - - - FULL PACKAGE OF HEALTH SYSTEM STRENGTHENING - - -
"FULL HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.hss_package(),
consumables_all_available,
),

# **************************************************
# VERTICAL PROGRAMS WITH AND WITHOUT THE HSS PACKAGE
# **************************************************

# - - - HIV SCALE-UP WITHOUT HSS PACKAGE- - -
"HIV Programs Scale-up WITHOUT HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.hiv_scaleup(),
consumables_all_available,
),
# - - - HIV SCALE-UP *WITH* HSS PACKAGE- - -
"HIV Programs Scale-up WITH HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.hiv_scaleup(),
scenario_definitions.hss_package(),
consumables_all_available,
),

# - - - TB SCALE-UP WITHOUT HSS PACKAGE- - -
"TB Programs Scale-up WITHOUT HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.tb_scaleup(),
consumables_all_available,
),
# - - - TB SCALE-UP *WITH* HSS PACKAGE- - -
"TB Programs Scale-up WITH HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.tb_scaleup(),
scenario_definitions.hss_package(),
consumables_all_available,
),

# - - - MALARIA SCALE-UP WITHOUT HSS PACKAGE- - -
"Malaria Programs Scale-up WITHOUT HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.malaria_scaleup(),
consumables_all_available,
),
# - - - MALARIA SCALE-UP *WITH* HSS PACKAGE- - -
"Malaria Programs Scale-up WITH HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.malaria_scaleup(),
scenario_definitions.hss_package(),
consumables_all_available,
),

# - - - HIV & TB & MALARIA SCALE-UP WITHOUT HSS PACKAGE- - -
"HIV/Tb/Malaria Programs Scale-up WITHOUT HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.hiv_scaleup(),
scenario_definitions.tb_scaleup(),
scenario_definitions.malaria_scaleup(),
consumables_all_available,
),
# - - - HIV & TB & MALARIA SCALE-UP *WITH* HSS PACKAGE- - -
"HIV/Tb/Malaria Programs Scale-up WITH HSS PACKAGE":
mix_scenarios(
scenario_definitions.baseline(),
scenario_definitions.hiv_scaleup(),
scenario_definitions.tb_scaleup(),
scenario_definitions.malaria_scaleup(),
scenario_definitions.hss_package(),
consumables_all_available,
),
}


if __name__ == '__main__':
from tlo.cli import scenario_run

scenario_run([__file__])
Loading