From 5e292446798c3da7aaf9c7bf3d4483810a388ead Mon Sep 17 00:00:00 2001 From: Eva Janouskova Date: Sun, 19 Nov 2023 18:20:29 +0000 Subject: [PATCH] utils, brc, co & hs: fix mistakes from rebase; TODO added --- src/tlo/analysis/utils.py | 2 +- src/tlo/methods/breast_cancer.py | 5 +++-- src/tlo/methods/contraception.py | 6 ++++-- src/tlo/methods/healthsystem.py | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tlo/analysis/utils.py b/src/tlo/analysis/utils.py index c60281b10a..e2d5db608d 100644 --- a/src/tlo/analysis/utils.py +++ b/src/tlo/analysis/utils.py @@ -263,7 +263,7 @@ def get_multiplier(_draw, _run): )['tlo.methods.population']['scaling_factor']['scaling_factor'].values[0] if custom_generate_series is None: - # If there is no `custom_generate_series` provided, it implies that function required selects a the specified + # If there is no `custom_generate_series` provided, it implies that function required selects the specified # column from the dataframe. assert column is not None, "Must specify which column to extract" else: diff --git a/src/tlo/methods/breast_cancer.py b/src/tlo/methods/breast_cancer.py index 7760340088..2529911d84 100644 --- a/src/tlo/methods/breast_cancer.py +++ b/src/tlo/methods/breast_cancer.py @@ -574,7 +574,7 @@ class BreastCancerMainPollingEvent(RegularEvent, PopulationScopeEventMixin): def __init__(self, module): super().__init__(module, frequency=DateOffset(months=1)) - # scheduled to run every 3 months: do not change as this is hard-wired into the values of all the parameters. + # scheduled to run every month: do not change as this is hard-wired into the values of all the parameters. def apply(self, population): df = population.props # shortcut to dataframe @@ -645,7 +645,8 @@ def __init__(self, module, person_id): self.TREATMENT_ID = "BreastCancer_Investigation" self.EXPECTED_APPT_FOOTPRINT = self.make_appt_footprint({"Over5OPD": 1, "Mammography": 1}) - self.ACCEPTED_FACILITY_LEVEL = '3' # Mammography only available at level 3 and above. + self.ACCEPTED_FACILITY_LEVEL = '3' # Biopsy only available at level 3 and above. + # TODO: but the appt footprints suggests mammography to be provided def apply(self, person_id, squeeze_factor): df = self.sim.population.props diff --git a/src/tlo/methods/contraception.py b/src/tlo/methods/contraception.py index 5b545ad158..88736c98cb 100644 --- a/src/tlo/methods/contraception.py +++ b/src/tlo/methods/contraception.py @@ -353,7 +353,7 @@ def avoid_sterilization_below30(probs): # Increase prob of 'female_sterilization' in older women accordingly probs_30plus = probs.copy() probs_30plus['female_sterilization'] = ( - probs.loc['female_sterilization'] / + probs.loc['female_sterilization'] / self.ratio_n_females_30_49_to_15_49_in_2010 ) # Scale so that the probability of all outcomes sum to 1.0 @@ -633,7 +633,7 @@ def avoid_sterilization_below30(probs): # Increase prob of 'female_sterilization' in older women accordingly probs_30plus = probs.copy() probs_30plus['female_sterilization'] = ( - probs.loc['female_sterilization'] / + probs.loc['female_sterilization'] / self.ratio_n_females_30_49_to_15_49_in_2010 ) # Scale so that the probability of all outcomes sum to 1.0 @@ -736,6 +736,7 @@ def get_item_code_for_each_contraceptive(self): get_items_from_pkg = self.sim.modules['HealthSystem'].get_item_codes_from_package_name _cons_codes = dict() + # items for each method that requires an HSI to switch to _cons_codes['pill'] = get_items_from_pkg('Pill') _cons_codes['male_condom'] = get_items_from_pkg('Male condom') _cons_codes['other_modern'] = get_items_from_pkg('Female Condom') @@ -745,6 +746,7 @@ def get_item_code_for_each_contraceptive(self): _cons_codes['implant'] = get_items_from_pkg('Implant') _cons_codes['female_sterilization'] = get_items_from_pkg('Female sterilization') assert set(_cons_codes.keys()) == set(self.states_that_may_require_HSI_to_switch_to) + # items used when initiating a modern reliable method after not using or switching from non-reliable method _cons_codes['co_initiation'] = get_items_from_pkg('Contraception initiation') return _cons_codes diff --git a/src/tlo/methods/healthsystem.py b/src/tlo/methods/healthsystem.py index cec712ef18..92520004d3 100644 --- a/src/tlo/methods/healthsystem.py +++ b/src/tlo/methods/healthsystem.py @@ -355,7 +355,7 @@ def initialise(self): # If there are bed-days specified, add (if needed) the in-patient admission and in-patient day Appointment # Types. # (HSI that require a bed for one or more days always need such appointments, but this may have been - # missed in the declaration of the `EXPECTED_APPPT_FOOTPRINT` in the HSI.) + # missed in the declaration of the `EXPECTED_APPT_FOOTPRINT` in the HSI.) # NB. The in-patient day Appointment time is automatically applied on subsequent days. if sum(self.BEDDAYS_FOOTPRINT.values()): self.EXPECTED_APPT_FOOTPRINT = health_system.bed_days.add_first_day_inpatient_appts_to_footprint(