Skip to content

Commit

Permalink
Revert temporary fix (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaJanouskova authored Nov 13, 2023
1 parent 02ed59f commit 85e322c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
4 changes: 2 additions & 2 deletions resources/ResourceFile_ContraceptionParams.csv
Git LFS file not shown
24 changes: 2 additions & 22 deletions src/tlo/methods/contraception.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,9 @@ class Contraception(Module):
Types.INT, "The maximum delay (in days) between the decision for a contraceptive to change and the `topen` "
"date of the HSI that is scheduled to effect the change (when using the healthsystem)."),

# TODO: needs to be fixed to be BOOL parameter (together with resolving the temporary fix below)
'use_interventions': Parameter(
Types.STRING, "if 'On': FP interventions (pop & ppfp) are simulated since 'interventions_start_date',"
" if 'Off': FP interventions (pop & ppfp) are not simulated."),

Types.BOOL, "if True: FP interventions (pop & ppfp) are simulated from the date 'interventions_start_date',"
" if False: FP interventions (pop & ppfp) are not simulated."),
'interventions_start_date': Parameter(
Types.DATE, "The date since which the FP interventions (pop & ppfp) are implemented, if at all (ie, if "
"use_interventions==True")
Expand Down Expand Up @@ -193,24 +191,6 @@ def read_parameters(self, data_folder):
Path(self.resourcefilepath) / 'ResourceFile_ContraceptionParams.csv'
))

# Temporary fix of loading the boolean parameter 'use_interventions':
co_params = pd.read_csv(
Path(self.resourcefilepath) / 'ResourceFile_ContraceptionParams.csv'
)
self.parameters['use_interventions_loaded'] =\
co_params['value'].loc[co_params['parameter_name'] == 'use_interventions'].values[0]
self.parameters['use_interventions'] = self.parameters['use_interventions_loaded'] == 'On'
if self.parameters['use_interventions_loaded'] not in ('On', 'Off'):
warnings.warn(UserWarning(f"'use_intervention' parameter set to 'Off' (=False) as the given value "
f"{self.parameters['use_interventions_loaded']} was not recognised."))
logger.info(
key="use_intervention",
data={"input_given": self.parameters['use_interventions_loaded'],
"value_used": self.parameters['use_interventions']
},
description='Unrecognised value given for use_intervention parameter replaced.'
)

# Import the Age-specific fertility rate data from WPP
self.parameters['age_specific_fertility_rates'] = \
pd.read_csv(Path(self.resourcefilepath) / 'demography' / 'ResourceFile_ASFR_WPP.csv')
Expand Down

0 comments on commit 85e322c

Please sign in to comment.