diff --git a/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_combined.py b/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_combined.py index a46dfa75fe..c76becfd78 100644 --- a/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_combined.py +++ b/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_combined.py @@ -86,7 +86,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth": mix_scenarios( get_parameters_for_status_quo(), @@ -105,7 +105,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 1": mix_scenarios( get_parameters_for_status_quo(), @@ -124,7 +124,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 3": mix_scenarios( get_parameters_for_status_quo(), @@ -143,7 +143,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 4": mix_scenarios( get_parameters_for_status_quo(), @@ -162,7 +162,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 6": mix_scenarios( get_parameters_for_status_quo(), @@ -181,7 +181,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth FL case 1 const i": mix_scenarios( get_parameters_for_status_quo(), @@ -200,7 +200,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth FL case 2 const i": mix_scenarios( get_parameters_for_status_quo(), @@ -219,7 +219,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth FL case 1 vary i": mix_scenarios( get_parameters_for_status_quo(), @@ -238,7 +238,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth FL case 2 vary i": mix_scenarios( get_parameters_for_status_quo(), diff --git a/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_scaling.py b/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_scaling.py index 28cd7ff171..1b64e1713b 100644 --- a/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_scaling.py +++ b/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_scaling.py @@ -70,11 +70,11 @@ def draw_parameters(self, draw_number, rng): 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. """ - + self.YEAR_OF_CHANGE = 2019 return { - + # =========== STATUS QUO ============ "No growth status quo": mix_scenarios( @@ -85,7 +85,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth status quo": mix_scenarios( self._baseline(), @@ -95,7 +95,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 1 status quo": mix_scenarios( self._baseline(), @@ -105,7 +105,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 3 status quo": mix_scenarios( self._baseline(), @@ -116,7 +116,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: } ), - + "GDP growth fHE growth case 4 status quo": mix_scenarios( self._baseline(), @@ -136,7 +136,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + # =========== PERFECT CONSUMABLES AVAILABILITY ============ "No growth perfect consumables": mix_scenarios( @@ -149,7 +149,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth perfect consumables": mix_scenarios( self._baseline(), @@ -161,7 +161,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 1 perfect consumables": mix_scenarios( self._baseline(), @@ -173,7 +173,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 3 perfect consumables": mix_scenarios( self._baseline(), @@ -186,7 +186,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: } ), - + "GDP growth fHE growth case 4 perfect consumables": mix_scenarios( self._baseline(), @@ -227,7 +227,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth perfect healthsystem": mix_scenarios( self._baseline(), @@ -243,7 +243,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 1 perfect healthsystem": mix_scenarios( self._baseline(), @@ -259,7 +259,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 3 perfect healthsystem": mix_scenarios( self._baseline(), @@ -276,7 +276,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: } ), - + "GDP growth fHE growth case 4 perfect healthsystem": mix_scenarios( self._baseline(), @@ -310,7 +310,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: ), } - + def _baseline(self) -> Dict: """Return the Dict with values for the parameter changes that define the baseline scenario. """ return mix_scenarios( diff --git a/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_test_scaling.py b/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_test_scaling.py index 5d29102e8b..78ffd1dbcb 100644 --- a/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_test_scaling.py +++ b/src/scripts/healthsystem/impact_of_const_capabilities_expansion/scenario_impact_of_capabilities_expansion_test_scaling.py @@ -86,7 +86,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth": mix_scenarios( get_parameters_for_status_quo(), @@ -105,7 +105,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 1": mix_scenarios( get_parameters_for_status_quo(), @@ -124,7 +124,7 @@ def _get_scenarios(self) -> Dict[str, Dict]: }, } ), - + "GDP growth fHE growth case 6": mix_scenarios( get_parameters_for_status_quo(), diff --git a/src/scripts/profiling/run_profiling.py b/src/scripts/profiling/run_profiling.py index 882894d6af..20386fe13b 100644 --- a/src/scripts/profiling/run_profiling.py +++ b/src/scripts/profiling/run_profiling.py @@ -295,7 +295,7 @@ def run_profiling( print(f"Writing {output_ipysession_file}", end="...", flush=True) scale_run_session.save(output_ipysession_file) print("done") - + if write_flat_html: output_html_file = output_dir / f"{output_name}.flat.html" console_renderer = ConsoleRenderer( diff --git a/src/scripts/profiling/scale_run.py b/src/scripts/profiling/scale_run.py index 735d1e7ba3..c4dfa57e46 100644 --- a/src/scripts/profiling/scale_run.py +++ b/src/scripts/profiling/scale_run.py @@ -26,10 +26,10 @@ def save_arguments_to_json(arguments_dict: dict, output_path: Path): with open(output_path, "w") as f: json.dump( { - k: str(v) if isinstance(v, Path) else v + k: str(v) if isinstance(v, Path) else v for k, v in arguments_dict.items() - }, - f, + }, + f, indent=4 ) diff --git a/src/scripts/task_runner/generate_html.py b/src/scripts/task_runner/generate_html.py index b9116c57f2..1a9b4a385b 100644 --- a/src/scripts/task_runner/generate_html.py +++ b/src/scripts/task_runner/generate_html.py @@ -101,8 +101,8 @@ def get_html_for_commit(commit_dir: Path) -> str:
- This page was generated on $generated_time. The - calibration workflow runs every + This page was generated on $generated_time. The + calibration workflow runs every night on the latest new commit on the master branch. toggle incomplete
$body diff --git a/src/tlo/analysis/utils.py b/src/tlo/analysis/utils.py index 2808ab57a5..4a71c8500b 100644 --- a/src/tlo/analysis/utils.py +++ b/src/tlo/analysis/utils.py @@ -1131,7 +1131,7 @@ def get_parameters_for_status_quo() -> Dict: "equip_availability": "all", # <--- NB. Existing calibration is assuming all equipment is available }, } - + def get_parameters_for_standard_mode2_runs() -> Dict: """ Returns a dictionary of parameters and their updated values to indicate diff --git a/src/tlo/core.py b/src/tlo/core.py index 9fbbf08893..c6364458dc 100644 --- a/src/tlo/core.py +++ b/src/tlo/core.py @@ -170,7 +170,7 @@ def _default_value(self) -> Any: """ Default value for this property, which will be used to fill the respective columns of the population dataframe, for example. - + If not explicitly set, it will fall back on the ``PANDAS_TYPE_DEFAULT_TYPE_MAP``. If a value is provided, it must: @@ -386,8 +386,8 @@ def initialise_population(self, population: Population) -> None: Modules that wish to implement this behaviour do not need to implement this method, it will be inherited automatically. Modules that wish to perform additional steps - during the initialise_population stage should reimplement this method and call - + during the initialise_population stage should reimplement this method and call + ```python super().initialise_population(population=population) ``` diff --git a/src/tlo/logging/helpers.py b/src/tlo/logging/helpers.py index 99fc51c473..ec6239239c 100644 --- a/src/tlo/logging/helpers.py +++ b/src/tlo/logging/helpers.py @@ -59,11 +59,11 @@ def get_dataframe_row_as_dict_for_logging( columns: Optional[Iterable[str]] = None, ) -> dict: """Get row of a pandas dataframe in a format suitable for logging. - + Retrieves entries for all or a subset of columns for a particular row in a dataframe and returns a dict keyed by column name, with values NumPy or pandas extension types which should be the same for all rows in dataframe. - + :param dataframe: Population properties dataframe to get properties from. :param row_label: Unique index label identifying row in dataframe. :param columns: Set of column names to extract - if ``None``, the default, all diff --git a/src/tlo/methods/alri.py b/src/tlo/methods/alri.py index f004e19819..b9f3048071 100644 --- a/src/tlo/methods/alri.py +++ b/src/tlo/methods/alri.py @@ -3040,7 +3040,7 @@ def apply(self, person_id): assert 'fast_breathing_pneumonia' == \ self.module.get_imci_classification_based_on_symptoms( - child_is_younger_than_2_months=False, + child_is_younger_than_2_months=False, symptoms=self.sim.modules['SymptomManager'].has_what(person_id=person_id) ) diff --git a/src/tlo/methods/consumables.py b/src/tlo/methods/consumables.py index 674035ad98..01264cb1f0 100644 --- a/src/tlo/methods/consumables.py +++ b/src/tlo/methods/consumables.py @@ -266,7 +266,7 @@ def _lookup_availability_of_consumables(self, def on_simulation_end(self): """Do tasks at the end of the simulation. - + Raise warnings and enter to log about item_codes not recognised. """ if self._not_recognised_item_codes: diff --git a/src/tlo/methods/demography.py b/src/tlo/methods/demography.py index e58f3895f4..3b4d20265e 100644 --- a/src/tlo/methods/demography.py +++ b/src/tlo/methods/demography.py @@ -134,7 +134,7 @@ def __init__(self, name=None, resourcefilepath=None, equal_allocation_by_distric ), 'district_num_of_residence': Property( - Types.CATEGORICAL, + Types.CATEGORICAL, 'The district number in which the person is resident', categories=['SET_AT_RUNTIME'] ), diff --git a/src/tlo/population.py b/src/tlo/population.py index 37f5fccfdf..26af2f3185 100644 --- a/src/tlo/population.py +++ b/src/tlo/population.py @@ -212,7 +212,7 @@ def individual_properties( In this case on exit from the ``with`` block in which the context is entered, any updates to the individual properties will be written back to the population dataframe. - + Once the ``with`` block in which the context is entered has been exited the view returned will raise an error on any subsequent attempts at reading or writing properties. diff --git a/tests/test_healthburden.py b/tests/test_healthburden.py index 585549e9db..a01a00f585 100644 --- a/tests/test_healthburden.py +++ b/tests/test_healthburden.py @@ -131,7 +131,7 @@ def test_arithmetic_of_disability_aggregation_calcs(seed): rfp = Path(os.path.dirname(__file__)) / '../resources' class ModuleWithPersonsAffected(Module): - + def __init__(self, persons_affected, name=None): super().__init__(name=name) self.persons_affected = persons_affected @@ -249,7 +249,7 @@ def report_daly_values(self): DiseaseThatCausesB(persons_affected=1), DiseaseThatCausesAandB(persons_affected=2), # intentionally two instances of DiseaseThatCausesC - DiseaseThatCausesC(persons_affected=3, name='DiseaseThatCausesC1'), + DiseaseThatCausesC(persons_affected=3, name='DiseaseThatCausesC1'), DiseaseThatCausesC(persons_affected=3, name='DiseaseThatCausesC2'), DiseaseThatCausesNothing(), # Disable sorting to allow registering multiple instances of DiseaseThatCausesC diff --git a/tests/test_symptommanager.py b/tests/test_symptommanager.py index 73ea7619d0..05981a8867 100644 --- a/tests/test_symptommanager.py +++ b/tests/test_symptommanager.py @@ -237,7 +237,7 @@ def test_has_what_via_individual_properties(seed, supply_disease_module: bool): 5 0 1 0 6 0 0 1 7 0 0 0 - + We will then assert that has_what returns the expected symptoms for the individuals, and that supplying either the person_id keyword or the individual_properties keyword gives the same answer.