-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing recurrence of HSIs in RTI #1408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GREAT work, thanks very much.
src/tlo/methods/rti.py
Outdated
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']): | ||
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above about moving this outside the new clause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @thewati
I just made those few other changes about the positioning of some of those places where there is writing the sim.populations.props dataframe. I think these changes ensure that we preserve the logic that was originally intended. Let me know if it looks right to you....?
src/tlo/methods/rti.py
Outdated
if self._number_of_times_this_event_has_run < self._maximum_number_times_event_should_run: | ||
self.sim.modules['RTI'].schedule_hsi_event_for_tomorrow(self) | ||
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']): | ||
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if self._number_of_times_this_event_has_run < self._maximum_number_times_event_should_run: | |
self.sim.modules['RTI'].schedule_hsi_event_for_tomorrow(self) | |
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']): | |
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7) | |
if self._number_of_times_this_event_has_run < self._maximum_number_times_event_should_run: | |
self.sim.modules['RTI'].schedule_hsi_event_for_tomorrow(self) | |
if pd.isnull(df.loc[person_id, 'rt_date_death_no_med']): | |
df.loc[person_id, 'rt_date_death_no_med'] = self.sim.date + DateOffset(days=7) |
Thanks again @thewati -- this looks good to me now. |
Fixing recurring HSI_Events of RTI module. Reworked logic #1403