Skip to content

Commit

Permalink
hs: typos/minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaJanouskova committed Sep 29, 2023
1 parent 67196fd commit 522985d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/tlo/methods/healthsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ def run_population_level_events(self, _list_of_population_hsi_event_tuples: List
def run_individual_level_events_in_mode_0_or_1(self,
_list_of_individual_hsi_event_tuples:
List[HSIEventQueueItem]) -> List:
"""Run a list of individual level events. Returns: list of events that did not run (maybe an empty a list)."""
"""Run a list of individual level events. Returns: list of events that did not run (maybe an empty list)."""
_to_be_held_over = list()
assert self.mode_appt_constraints in (0, 1)

Expand Down Expand Up @@ -2181,9 +2181,9 @@ class HealthSystemScheduler(RegularEvent, PopulationScopeEventMixin):
If the event is to be run, then the following events occur:
* The HSI event itself is run.
* The occurence of the event is logged
* The occurrence of the event is logged
* The resources used are 'occupied' (if individual level HSI event)
* Other disease modules are alerted of the occurence of the HSI event (if individual level HSI event)
* Other disease modules are alerted of the occurrence of the HSI event (if individual level HSI event)
Here is where we can have multiple types of assumption regarding how these capabilities are modelled.
"""
Expand Down Expand Up @@ -2249,7 +2249,7 @@ def _get_events_due_today(self,) -> Tuple[List, List]:

if next_event_tuple.priority == self.module.lowest_priority_considered:
# Check the priority
# If the next event is not due and has lowest allowed priority, then stop looking
# If the next event is not due and has the lowest allowed priority, then stop looking
# through the heapq as all other events will also not be due.
break

Expand Down Expand Up @@ -2299,7 +2299,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
set_capabilities_still_available = {k for k, v in capabilities_monitor.items() if v > 0.0}

# Here use different approach for appt_mode_constraints = 2: rather than collecting events
# due today all at once, run event immediately at time of querying. This ensure that no
# due today all at once, run event immediately at time of querying. This ensures that no
# artificial "midday effects" are introduced when evaluating priority policies.

# To avoid repeated dataframe accesses in subsequent loop, assemble set of alive
Expand Down Expand Up @@ -2352,7 +2352,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:

if next_event_tuple.priority == self.module.lowest_priority_considered:
# Check the priority
# If the next event is not due and has lowest allowed priority, then stop looking
# If the next event is not due and has the lowest allowed priority, then stop looking
# through the heapq as all other events will also not be due.
break

Expand All @@ -2373,7 +2373,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
# based on queue information, and we assume no squeeze ever takes place.
squeeze_factor = 0.

# Check if any of the officers required have ran out.
# Check if any of the officers required have run out.
out_of_resources = False
for officer, call in original_call.items():
# If any of the officers are not available, then out of resources
Expand Down Expand Up @@ -2453,7 +2453,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
# Subtract this from capabilities used so-far today
capabilities_monitor.subtract(updated_call)

# If any of the officers have ran out of time by performing this hsi,
# If any of the officers have run out of time by performing this hsi,
# remove them from list of available officers.
for officer, call in updated_call.items():
if capabilities_monitor[officer] <= 0:
Expand All @@ -2466,7 +2466,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
f"officers than expected_footprint.")
)

# Update today's footprint based on actuall call and squeeze factor
# Update today's footprint based on actual call and squeeze factor
self.module.running_total_footprint -= original_call
self.module.running_total_footprint += updated_call

Expand All @@ -2490,7 +2490,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
# were exhausted, so here ensure if any events expired were left unchecked they are properly
# removed from the queue, and did_not_run() is invoked for all postponed events.
# (This should still be more efficient than querying the queue as done in mode_appt_constraints
# = 0 and 1 while ensuring mid-day effects are avoided.)
# = 0 and 1 while ensuring midday effects are avoided.)
while len(self.module.HSI_EVENT_QUEUE) > 0:

next_event_tuple = hp.heappop(self.module.HSI_EVENT_QUEUE)
Expand Down Expand Up @@ -2519,7 +2519,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:

if next_event_tuple.priority == self.module.lowest_priority_considered:
# Check the priority
# If the next event is not due and has lowest allowed priority, then stop looking
# If the next event is not due and has the lowest allowed priority, then stop looking
# through the heapq as all other events will also not be due.
break

Expand All @@ -2532,7 +2532,7 @@ def process_events_mode_2(self, hold_over: List[HSIEventQueueItem]) -> None:
if is_pop_level_hsi_event:
list_of_population_hsi_event_tuples_due_today.append(next_event_tuple)
else:
# In previous iteration, have already ran all the events for today that could run
# In previous iteration, have already run all the events for today that could run
# given capabilities available, so put back any remaining events due today to the
# hold_over queue as it would not be possible to run them today.

Expand Down

0 comments on commit 522985d

Please sign in to comment.