-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fixes for diarrhoea generic first appointment logic and updating of individual properties across modules #1389
Fixes for diarrhoea generic first appointment logic and updating of individual properties across modules #1389
Conversation
@marghe-molaro this PR should hopefully deal with the issues so once this is reviewed / merged to |
Thank you very much @matt-graham! |
@matt-graham it appears there's an issue with the diarrhoea test |
It looks like Will also updated the tests that are failing here in #1366 to force individual to have diarrhoea symptoms - currently investigating why that was needed and will update test here if necessary. |
I realized the manual setting of |
As this is just a change to the test to keep it up to sync with the changes in the module, this shouldn't affect the validity of any runs with the changes here merged in before the last commit @marghe-molaro, just in case you've already set anything off! |
Hi @matt-graham and @tamuri, quick update: @tbhallett noticed that this PR was based on a version of master that had brought in changes to the HIV/TB/malaria modules which lead to a rescaling of DALYs and scheduled HSIs for those diseases (#1273). By comparing the original runs which included the error with the fixes brought in this PR (#1389), it has therefore become difficult to isolate the effect of modules reordering on the changes to the HIV DALYs evolution. I will submit a new set of test runs from the current version of master where the only change added is the scrambling of the disease modules to recover the order in the original code vs the one introduced by PR #1292. Hopefully this will allow us to establish once and for all whether reordering the modules during the first generic appts leads to any statistically significant changes. Let me know if you have any thoughts on this. |
Hi @marghe-molaro that seems sensible to me. |
Related to #1348 and #1366.
As discussed in software engineering meeting today, this PR addresses two known issues with current refactored generic first appointments logic:
TLOmodel/src/tlo/methods/hsi_generic_first_appts.py
Lines 80 to 103 in df25c76
updates to an individual properties by previous modules in the loop are not reflected necessarily in the
patient_details
structure passed to thedo_at_generic_first_appt
method of the current module in the loop as the updates are only made to the dataframe after the loop has completed. Due the subsequent changes to thePatientDetails
type made in Access individual properties lazily with memoization inPatientDetails
type #1315, this will actually only be an issue if an update is made to a property by a module that has previously been read (and cached) by that or another module and then a subsequent module reads the same property again (as it will get the initial cached value). I'm not sure there are cases where that chain actually happens currently given only very few modules actually output updates to the individual properties and they are for properties usually specific to the module, so this possibly explains why @willGraham01 was able to get consistent dataframe checksums when working on Inconsistency fix between HEAD of master and older PR branches. #1366 even without this fix.The fix for (2) here uses the simple approach I mentioned in #1348 (comment) which will loose some of the performance benefits we currently have by doing updates to the dataframe whenever a module returns properties to update (rather than doing all updates at once). In the longer term #1387 should fix the same issue in a more performant manner.