Skip to content

Conversation

@mmsuarezcosta
Copy link
Collaborator

@mmsuarezcosta mmsuarezcosta commented Sep 29, 2025

Refactoring

  • Parameterized mda_execute and single_district as scenario parameters. This required refactoring in the schisto.py file as well as all corresponding test, analysis, calibration, and scenario files that required this function.
  • _get_age_groups: created this function do define age groups from the parameters. This required refactoring as age groups were initially defined before the parameters were read, and these age groups had been parameterized.
  • Renamed Parameters.csv to parameter_values.csv

Files and File Structure

  • Files deleted because legacy and are not referenced in any part of code base:
    • DALYs.csv
    • ESPEN_codebook.csv
    • ESPEN.csv
    • InitialData_haematobium.csv
    • InitialData_mansoni.csv
    • MDA_historical_Coverage.csv
    • Symptoms.csv
  • Of the files that are used and are not parameter_values.csv, most have historical data. The outputs of the model are compared against this historical data for calibration purposes. I have created a column in these files called param_label and added the label calibration data. I believe it is not important to add prior min and max values to this data due to its use case. In team discussion, this approach marked as OK✅. The files for which I added the calibration data label are as follows:
    • ESPEN_MDA.csv
    • LatestData_haematobium.csv
    • LatestData_mansoni.csv
    • District_Params_haematobium.csv
    • District_Params_mansoni.csv
      ASK: Confirm that Emmanuel review is not required for this module as no addt modifications are to be made to these files.

Parameters

Remain hard coded

  • Consumable and equipment remains hardcoded (including medication dosages)

Local - For Review / Confirmation

  • delay_till_hsi_a_repeated, delay_till_hsi_b_repeated: Defined these as local because associated with local health seeking behavior. (✅ confirmed OK in chat with Margherita)
  • rr_WASH: Reference meta-analysis here: https://pmc.ncbi.nlm.nih.gov/articles/PMC4256273/
    Defined to be as local given high location-based elements + high uncertainty described in the study (✅ confirmed OK in chat with Margherita)

Universal - For Review / Confirmation

  • Average weight of age groups (avg_weight_psac_kg, avg_weight_sac_kg, avg_weight_adult_kg): Defined these as universal parameters because based on WHO avg weights. Uncertain if this is OK, or if they should be marked as undetermined - structural like the structural parameter of age ranges that they correspond to?

Undetermined - For Review / Confirmation

  • Age group of individuals (PSAC, SAC, ...): Defined as undetermined with comment structural. (✅ confirmed OK in chat with Margherita)
  • main_polling_frequency: currently using it both for the parameter in the initialize_simulation function and within the main SchistoInfectionWormBurdenEvent that it calls. These parameters seem to represent the same polling logic. Is this correct?

Assumption

The following variables have been marked as an 'assumption'. I am documenting here for reference for future developers:

  • heavy_intensity_threshold_PSAC_haematobium
  • low_intensity_threshold_haematobium
  • heavy_intensity_threshold_PSAC_mansoni
  • low_intensity_threshold_mansoni

Scripts

Future Considerations:@tdm32 to define which schisto related files should remain in master.

As mentioned above, I had to refactor functions when making mda_execute and single_district scenario parameters. I worked to update the schisto analysis files. in this process, I realized that most were not running in their current state. I updated the files to align with the new refactoring and ensured that these files had the same errors that I was receiving before implementing my changes.

I am documenting the error of the files below for reference:
- Schisto_analysis.py (TypeError: Simulation._configure_logging() got an unexpected keyword argument 'custom_levels ')
○ Run_simulation outdated as it has haem and mandoni as parameters
- Baseline_run.py (TypeError: Demography.__init__() got an unexpected keyword argument 'resourcefilepath')
- Schisto_calibration_check (TypeError: unsupported operand type(s) for /: 'str' and 'str')
- Schisto_single_run_local (Runs and generates log files, but ends in following error:)

Traceback (most recent call last):
  File "/Users/marianasuarez/PycharmProjects/TLOmodel/src/scripts/schistosomiasis/schisto_single_run_local.py", line 122, in <module>
    dfs = construct_dfs(output['tlo.methods.schisto'])
                        ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'tlo.methods.schisto' 

@mmsuarezcosta mmsuarezcosta linked an issue Sep 29, 2025 that may be closed by this pull request
@mmsuarezcosta mmsuarezcosta marked this pull request as ready for review October 10, 2025 13:32
@mmsuarezcosta
Copy link
Collaborator Author

@marghe-molaro PR ready for review !

@marghe-molaro
Copy link
Collaborator

Thanks @mmsuarezcosta - happy for @tdm32 to review this!

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.

Schisto Module

3 participants