Skip to content
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

New tag: Colbourn_etal2023_contraception_v2.0 #1166

Open
wants to merge 28 commits into
base: contraception/Colbourn_etal2023_submitted
Choose a base branch
from

Conversation

EvaJanouskova
Copy link
Collaborator

@EvaJanouskova EvaJanouskova commented Oct 23, 2023

Purpose of this draft PR

  1. to check out whether there is no bug which would make the results, that we sent with revision 2 of the contraception paper, wrong (note: last commit to fix PEP8 is not included in the tag)
  2. to determine which changes we would like to include into master as well (my suggestions: see the marks below -- (y)/(n) = yes/no answer to the question whether to add that change to the master branch), (?) = not sure what we want for the master branch

The main changes:

src/scripts/data_file_processing

formatting_demography_data.py

  • (y) Working files updated to use workingfolder to set the folder with original data just once in the script, making it easier for everyone to set that to the folder in their computer.

  • (y) Demography RFs names changed to indicate year of WPP, i.e. suffix WPP -> now WPP2019 or WPP2022
    !!! note: The names are updated in all scripts & methods files where these RFs are called.

  • (y) Some variable names changed to indicate year of WPP, e.g. tot_births -> tot_births_wpp19.

  • (y) ResourceFile_Pop_WPP renamed to specify details of what data it contains -> ResourceFile_Pop_Every5years_age_sex_WPP2019.

  • (y) ResourceFile_Pop_Annual_WPP renamed to specify details of what data it contains -> ResourceFile_Pop_Annual_age_sex_WPP2019 and script updated to prepare two RFs, for WPP 2019 & WPP 2022 data. Also, the male/female data concatenated using the concat_excel_sheets fnc (to ensure consistency across both datasets if some changes are made).

  • (y) New ResourceFile_Pop_Annual_sex_WPP2019 created.

  • (y) Duplicates for year 2020 have been removed from ResourceFile_Pop_Annual_age_sex_WPP2019, leaving only Estimates.

  • (y) ResourceFile_TotalBirths_WPP updated so two RFs are prepared, for WPP 2019 & WPP 2022 data.

  • (?, if y, it makes it a bit more complicated to prepare and use RFs for both WPP data as these have to be distinguished then; if n, there's higher risk that incorrect data will be used) The prefix used with variants in the RFs updated to reflect the year of WPP data, e.g. WPP_Low variant -> WPP2019_Low variant. And the missing prefix added in ResourceFile_TotalBirths_WPP2019. (note: I haven't check if it's missing in any of the RFs I didn't need to work with for the paper revision.)

src/scripts/calibration_analyses/analysis_scripts

analysis_all_calibration.py

  • (n/a) Updated to match master version.

analysis_demography_calibrations.py

Pop_Over_Time.. figures:

  • (y) Uncertainty for WPP data (Low-to-High variant area) added (ie the new ResourceFile_Pop_Annual_sex_WPP2019 used).
  • (y, but comment the plot for WPP 2022) Plotting pop size over time made as a fnc for which the year of WPP data has to be specified. Plot pop size over time for both WPP 2019 & 2022.
  • (?) In WPP label, the year of WPP data specified -> WPP (2019) or WPP (2022).
  • (y, but it can be defined to 'upper left', where I can see it on website) Legend position defined to 'lower right'.
  • (n) Dotted vertical line for the intervention start year added.
  • (n) The end year of shown time period changed 2030 -> 2100 and hence the y axis .
  • (y, if uncertainty no covered up to the year 2030) y axis prolonged to cover entire WPP uncertainty area.

Pop_Size_.. figures (the population pyramids):

  • (y) Plotting pyramids made as a fnc for which the year of WPP data has to be specified.
  • (?) In WPP label, the year of WPP data specified -> WPP (2019) or WPP (2022).
  • (y) For pyramids using WPP 2019 data in years included in ResourceFile_Pop_Every5years_age_sex_WPP2019 the WPP uncertainty added; for all other years still without uncertainty. For pyramids using WPP 2022 the WPP uncertainty always shown.
  • (y, but comment the plots for WPP 2022 and comment the new list of years, keep the old one) Plotting pyramids for both data, WPP 2019 & 2022, in years [2010, 2015, 2018, 2029, 2030, 2049, 2050] instead of originally [2010, 2015, 2018, 2029, 2049], to have some pyramids with the WPP uncertainty for WPP 2019.
  • (y, even for the year>2025 as for 2029 it already crosses the bars) The labels Males/Females moved to be visible, not to cross the bars.
  • (?) The x-axis extended to be the same for all pyramids and to cover all (incl. pyramid in year 2050 with WPP 2019).

Births_Over_Time_.. figures:

  • (y, but comment the plot for WPP 2022) Plotting births made as a fnc for which the year of WPP data has to be specified. Plot births for both WPP 2019 & 2022.
  • (?) In WPP label, the year of WPP data specified -> WPP (2019) or WPP (2022).
  • (n) Dashed line for model line is used for the paper only when plotting the results with interventions.
  • (n) Dotted vertical line for the intervention start year added.
  • (y) y axis prolonged to cover entire WPP uncertainty area.

src/scripts/contraception

analysis_contraception_plot_table.py & bar_chart_costs.py

Consumables and Interventions Costs figure (bars with consumables + Pop intervention implementation + PPFP intervention implementation costs per decades Without X With interventions):

  • (y) added ON/OFF option whether we want to add TOTAL costs for the entire period shown as the last bars in the figure or not

example if ON:
Fig4__v3 21apr2023_comments_EC_EJ_update
example if OFF:
Fig4_revision02

fnc_analyse_contraception

Contraception Use By Method & Prop Fem1549 Using Method figures:

  • (y) The underscores from the names of contraception methods removed.

The minor changes

  • (n/a) A few changes made to be able to run the needed parts of scripts after the update to Pandas 2.0.

  • (y, may open issue for this, or mention it in the PR where they are fixing the demography calibrations script that uses these RFs) Some TODO: fix added where I noticed the script is not working, but I didn't need it, so didn't bother to fix it right away. (note: I didn't check all the parts I didn't use, so there may be more to be fixed in the formatting_demography_data script.)

TODO:

(Who would do that?)

  • Add suffix _WPP_2019 to all other figures using these data.

…nclude totals in plot of costs by periods; warn if cost fig requested, but cost table not; print info about consumables list saved
… RF_Pop_Annual_sex_WPP19; *some names changed to distinguish from the new RF; *TODO: fix spotted issue with RF_Under_Five_Mortality_DHS
…os moved for pop size (Colbourn et al. 2023)
…added to WPP variants names, wpp19 marking added to variable names, updated to work with pandas 2.0 (append->concat, split fixed); *WPP 2022: new RF created
…r WPP 2019 updated to use new version of RF); WPP 2022 commented for future use
…sum fixed not to sum category types values); WPP 2022 commented for future use; RF_Pop_Annual_age_sex_WPP2019 used only later => load there and add wpp19 marking
…ead of 2022); Age_Grp in wpp(19|22)_ann specified
@EvaJanouskova EvaJanouskova force-pushed the contraception/Colbourn_etal2023_revision02 branch from 4a80145 to 77f5242 Compare October 23, 2023 22:04
@EvaJanouskova EvaJanouskova marked this pull request as draft October 24, 2023 17:33
@EvaJanouskova
Copy link
Collaborator Author

@tbhallett, While reading the TLO Model: Overview paper, I noticed that the figure of proportion of females using contraceptive methods is not as nice as what we used for the contraception paper:
Prop Fem1549 Using Method 2023-05-06T170512_without_UpTo2050_co_rev03_yaxis-lims-united_useTo_1000 0_MWKcostsTo_1000000 0_250K
I prepared this in one of the contraception analysis scripts, but it could be updated in the all calibration analysis script if you like.

@EvaJanouskova EvaJanouskova marked this pull request as ready for review May 24, 2024 10:23
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.

None yet

1 participant