Skip to content

Commit d8e6922

Browse files
committed
Correct use of parameters
1 parent 7af8c70 commit d8e6922

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/tlo/methods/collect_event_chains.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,11 @@ def on_notification_of_birth(self, data):
127127
def on_notification_event_about_to_run(self, data):
128128
"""Do this when notified that an event is about to run. This function checks whether this event should be logged as part of the event chains, and if so stored required information before the event has occurred. """
129129

130-
p = self.parameters
131-
132130
# Only log event if
133131
# 1) generate_event_chains is set to True
134132
# 2) the event belongs to modules of interest and
135133
# 3) the event is not in the list of events to ignore
136-
if p['generate_event_chains'] and (data['module'] in p['modules_of_interest']) and (data['link_info']['EventName'] not in p['events_to_ignore']):
134+
if self.generate_event_chains and (data['module'] in self.modules_of_interest) and (data['link_info']['EventName'] not in self.events_to_ignore):
137135

138136
# Initialise these variables
139137
self.print_chains = False
@@ -175,10 +173,8 @@ def on_notification_event_about_to_run(self, data):
175173

176174
def on_notification_event_has_just_ran(self, data):
177175
""" If print_chains=True, this function logs the event and identifies and logs the any property changes that have occured to one or multiple individuals as a result of the event taking place. """
178-
179-
p = self.parameters
180176

181-
if p['generate_event_chains'] and self.print_chains:
177+
if self.print_chains:
182178

183179
chain_links = {}
184180

0 commit comments

Comments
 (0)