Skip to content

Weather Disruptions Module#1790

Draft
RachelMurray-Watson wants to merge 62 commits intomasterfrom
rmw/climate_change_module
Draft

Weather Disruptions Module#1790
RachelMurray-Watson wants to merge 62 commits intomasterfrom
rmw/climate_change_module

Conversation

@RachelMurray-Watson
Copy link
Copy Markdown
Collaborator

@RachelMurray-Watson RachelMurray-Watson commented Jan 29, 2026

This PR aims to develop a separate "WeatherDisruptions" module. This modularizes code developed in rmw/climate_change_switch and rmw/climate_troubleshoot_LHS.

The module aims to do the following:

  1. Assign individuals facilities based on their districts*
  2. Read in data on the weather disruptions**
  3. Determine whether a disruption will occur (and consequence e.g. reseeking healthcare)
  4. Feed this back to the health system
  5. Log disrupted HSIs by district
  • This is a necessary but, also, distinct functionality that could instead be included in the demography module.
    ** Currently these are csv files with the proportion of ANC appointments disrupted for each facility by month. @marghe-molaro previously suggested saving the coefficients of the ANC model instead and doing the LM each time. This will probably save us space (as we would only need the details for each facility to be loaded in) but it seems more computationally intensive (as would need to look up all details for each facility and do calculation each time a HSI is processed).

To Do:

  • Framework of WeatherDisruptions module
  • Parameter file separated from health system file
  • Tests of functionality
  • Decide on points * and ** above
  • Add new logging to HealthBurden module

…n code developed in rmw/climate_change_switch and rmw/climate_troubleshoot_LHS.
@marghe-molaro
Copy link
Copy Markdown
Collaborator

Hi @RachelMurray-Watson,

Great to see this being formalised this way!

Just a few comments:

  1. Agreed
  2. You can initialise the disruption dfs upon initialisation of the module based on the specified coefficients without any repercussions on simulation runtime. (Basically, instead of reading in your 'look up' climate disruption df, you 'create it' based on the coefficients and any other relevant info (e.g. climate projections, facility location, ...) upon initialisation - unless I am missing something)
    Advantages:
  • Reduce resource files required (now you only need the climate projections)
  • Make your assumptions around how climate relates to disruptions more explicit (i.e. you declare coefficients explicitly) and therefore amenable to modifications later on;

@RachelMurray-Watson
Copy link
Copy Markdown
Collaborator Author

Hi @RachelMurray-Watson,

Great to see this being formalised this way!

Just a few comments:

  1. Agreed
  2. You can initialise the disruption dfs upon initialisation of the module based on the specified coefficients without any repercussions on simulation runtime. (Basically, instead of reading in your 'look up' climate disruption df, you 'create it' based on the coefficients and any other relevant info (e.g. climate projections, facility location, ...) upon initialisation - unless I am missing something)
    Advantages:
  • Reduce resource files required (now you only need the climate projections)
  • Make your assumptions around how climate relates to disruptions more explicit (i.e. you declare coefficients explicitly) and therefore amenable to modifications later on;

Ah I see! I misinterpreted what you meant initially. Grand so, I can do it that way.

@RachelMurray-Watson
Copy link
Copy Markdown
Collaborator Author

Hi @RachelMurray-Watson,
Great to see this being formalised this way!
Just a few comments:

  1. Agreed
  2. You can initialise the disruption dfs upon initialisation of the module based on the specified coefficients without any repercussions on simulation runtime. (Basically, instead of reading in your 'look up' climate disruption df, you 'create it' based on the coefficients and any other relevant info (e.g. climate projections, facility location, ...) upon initialisation - unless I am missing something)
    Advantages:
  • Reduce resource files required (now you only need the climate projections)
  • Make your assumptions around how climate relates to disruptions more explicit (i.e. you declare coefficients explicitly) and therefore amenable to modifications later on;

Ah I see! I misinterpreted what you meant initially. Grand so, I can do it that way.

Actually @marghe-molaro I am unsure it does reduce the files, as for each scenario I still need to read in the precipitation files (which still gives one for model for each scenario). However, for your point about transparency, I think it is still worthwhile.

@marghe-molaro
Copy link
Copy Markdown
Collaborator

Hi @RachelMurray-Watson,
Great to see this being formalised this way!
Just a few comments:

  1. Agreed
  2. You can initialise the disruption dfs upon initialisation of the module based on the specified coefficients without any repercussions on simulation runtime. (Basically, instead of reading in your 'look up' climate disruption df, you 'create it' based on the coefficients and any other relevant info (e.g. climate projections, facility location, ...) upon initialisation - unless I am missing something)
    Advantages:
  • Reduce resource files required (now you only need the climate projections)
  • Make your assumptions around how climate relates to disruptions more explicit (i.e. you declare coefficients explicitly) and therefore amenable to modifications later on;

Ah I see! I misinterpreted what you meant initially. Grand so, I can do it that way.

Actually @marghe-molaro I am unsure it does reduce the files, as for each scenario I still need to read in the precipitation files (which still gives one for model for each scenario). However, for your point about transparency, I think it is still worthwhile.

Oh I see, so before you weren't loading the precipitation files at all, only the pre-computed disruptions in that scenario?

I think this way is still more future-proof, because later on you might want to link precipitation to a number of other things (e.g. specific risks to flooding, food security, etc) as well as making assumptions more explicit. But point taken!

…rameters needed to determine (a) drop in HSI appointments (from linear model) and (b) if disruption will occur, nature of disruption. Additionally including the precipitation files for 245 low/medium/high models
…ded for the weather disruptions). Uses code from rmw/climate_health_switch and rmw/climate_troublesheet_LHS. Also records population by district.
Renamed files for clarity
In params file for WeatherDisruptions, removed duplicated params
Also renamed first column for read-in by csv files
Initial code for LM *not working yet*
… added in the South West predictor

Added index to ensure the first 12 months were used, then skipped (2024, so needed to calculate lag)
…dded to the queue, but all gandled internally to the module.

Updated too so that the list is not just essential equipment, but "meets all conditions" (not weatehr disrupted, has equipment).
Added reset of counters (could all go into one log??)

Changed linear model to remove month - see not on parameter commit

Handling on NAN

Added check_for_hsi_disruption check if conditions are met, to call the linear model to calculate the disruptions

_handle_disruption determines if the disruption is supply or demand side, if mode 2, deducts from daily capabilities

_determine_reschudling handles the healthcare seeking behaviour post-disruption

_calculate_delay determines what the number of days delay there will be
# Conflicts:
#	src/tlo/methods/healthsystem.py
Also add in handling of climate disruptions in mode 2
RachelMurray-Watson and others added 30 commits March 5, 2026 15:34
… population template

- Set level_0–3 PROPERTIES categories in pre_initialise_population using
  level-specific facility names from facilities_info, replacing placeholder
  SET_AT_RUNTIME values before new_row is built
- Remove possible_facilities parameter (now unused)
- Remove undeclared facility_used_level_X assignments from initialise_population
- Add level_0–3 to on_birth child dict so newborns inherit facility assignments
- Remove level_4 from assign_closest_facility_level (Zomba Mental Hospital not present)
…on of (a) the big facilities file and (b) the key information from the pared down FacilityCharacters file.

Also fixed the indexing in the facility characteristics in the build probabilities

And the date in the schedule event
…on of (a) the big facilities file and (b) the key information from the pared down FacilityCharacters file.

Also fixed the indexing in the facility characteristics in the build probabilities

And the date in the schedule event
added a scenario file for basic runs
Added in tests of logging, scale factors, assigning facilities, mode 2 capabilities reduction
Added in tests of logging, scale factors, assigning facilities, mode 2 capabilities reduction
…erested in disruptions, i.e. decrease in attendance, only).
…lth/year) structure; move district tracking to separate 5-level dataframes to preserve existing test compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants