Skip to content

Commit

Permalink
Remove instances of trailing whitespace + whitespace on new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-graham committed Sep 23, 2024
1 parent d772561 commit db883e1
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -105,7 +105,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 1":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -124,7 +124,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 3":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -143,7 +143,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 4":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -162,7 +162,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 6":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand All @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -85,7 +85,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth status quo":
mix_scenarios(
self._baseline(),
Expand All @@ -95,7 +95,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 1 status quo":
mix_scenarios(
self._baseline(),
Expand All @@ -105,7 +105,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 3 status quo":
mix_scenarios(
self._baseline(),
Expand All @@ -116,7 +116,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
}
),


"GDP growth fHE growth case 4 status quo":
mix_scenarios(
self._baseline(),
Expand All @@ -136,7 +136,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

# =========== PERFECT CONSUMABLES AVAILABILITY ============
"No growth perfect consumables":
mix_scenarios(
Expand All @@ -149,7 +149,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth perfect consumables":
mix_scenarios(
self._baseline(),
Expand All @@ -161,7 +161,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 1 perfect consumables":
mix_scenarios(
self._baseline(),
Expand All @@ -173,7 +173,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 3 perfect consumables":
mix_scenarios(
self._baseline(),
Expand All @@ -186,7 +186,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
}
),


"GDP growth fHE growth case 4 perfect consumables":
mix_scenarios(
self._baseline(),
Expand Down Expand Up @@ -227,7 +227,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth perfect healthsystem":
mix_scenarios(
self._baseline(),
Expand All @@ -243,7 +243,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 1 perfect healthsystem":
mix_scenarios(
self._baseline(),
Expand All @@ -259,7 +259,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 3 perfect healthsystem":
mix_scenarios(
self._baseline(),
Expand All @@ -276,7 +276,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
}
),


"GDP growth fHE growth case 4 perfect healthsystem":
mix_scenarios(
self._baseline(),
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -105,7 +105,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 1":
mix_scenarios(
get_parameters_for_status_quo(),
Expand All @@ -124,7 +124,7 @@ def _get_scenarios(self) -> Dict[str, Dict]:
},
}
),

"GDP growth fHE growth case 6":
mix_scenarios(
get_parameters_for_status_quo(),
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/profiling/run_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/profiling/scale_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
4 changes: 2 additions & 2 deletions src/scripts/task_runner/generate_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def get_html_for_commit(commit_dir: Path) -> str:
<body>
<h1>$title</h1>
<p style="font-size: small;">
This page was generated on $generated_time. The
<a href="https://github.com/UCL/TLOmodel/actions/workflows/calibration.yaml">calibration workflow</a> runs every
This page was generated on $generated_time. The
<a href="https://github.com/UCL/TLOmodel/actions/workflows/calibration.yaml">calibration workflow</a> runs every
night on the latest new commit on the master branch. <a href="#" id="toggleIncomplete">toggle incomplete</a>
</p>
$body
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/analysis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/tlo/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
```
Expand Down
4 changes: 2 additions & 2 deletions src/tlo/logging/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/alri.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/consumables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/methods/demography.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
),
Expand Down
2 changes: 1 addition & 1 deletion src/tlo/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_healthburden.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_symptommanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit db883e1

Please sign in to comment.