From 61551eab8d7e596ff1e409be210d87c081d8ab98 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Wed, 6 Nov 2024 16:55:57 +0300 Subject: [PATCH 01/12] convert excel files to csv equivalent - Joe modules --- resources/ResourceFile_AntenatalCare.xlsx | 3 --- resources/ResourceFile_AntenatalCare/parameter_values.csv | 3 +++ resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv | 3 +++ resources/ResourceFile_LabourSkilledBirthAttendance.xlsx | 3 --- .../parameter_values.csv | 3 +++ .../parameter_values_old.csv | 3 +++ resources/ResourceFile_NewbornOutcomes.xlsx | 3 --- resources/ResourceFile_NewbornOutcomes/parameter_values.csv | 3 +++ resources/ResourceFile_PostnatalSupervisor.xlsx | 3 --- .../ResourceFile_PostnatalSupervisor/parameter_values.csv | 3 +++ .../ResourceFile_PostnatalSupervisor/parameter_values_old.csv | 3 +++ resources/contraception/ResourceFile_Contraception.xlsx | 3 --- .../DELETE_Discontinuation by age.csv | 3 +++ .../ResourceFile_Contraception/DELETE_Guttmacher.csv | 3 +++ .../ResourceFile_Contraception/DELETE_Initiation1 by age.csv | 3 +++ .../ResourceFile_Contraception/DELETE_Initiation2 by age.csv | 3 +++ .../ResourceFile_Contraception/DELETE_Mortality Rate.csv | 3 +++ .../ResourceFile_Contraception/DELETE_Prob_NND_days.csv | 3 +++ .../ResourceFile_Contraception/DELETE_Total Pop.csv | 3 +++ .../contraception/ResourceFile_Contraception/DELETE_USAID.csv | 3 +++ .../contraception/ResourceFile_Contraception/DELETE_WHO.csv | 3 +++ .../ResourceFile_Contraception/DELETE_cprev2010.csv.csv | 3 +++ .../ResourceFile_Contraception/DELETE_drates_12m.csv | 3 +++ .../ResourceFile_Contraception/DELETE_interventions.csv | 3 +++ .../ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv | 3 +++ .../ResourceFile_Contraception/DELETE_irate1_5years.csv | 3 +++ .../DELETE_irate1_all__1116_by age.csv | 3 +++ .../DELETE_irate1_individual years.csv | 3 +++ .../contraception/ResourceFile_Contraception/DELETE_irate2.csv | 3 +++ .../ResourceFile_Contraception/DELETE_irate2_5years.csv | 3 +++ .../DELETE_irate2_individual years.csv | 3 +++ .../ResourceFile_Contraception/DELETE_lit summary.csv | 3 +++ .../ResourceFile_Contraception/DELETE_r_init2_age.csv | 3 +++ .../ResourceFile_Contraception/DELETE_switching_matrix (n).csv | 3 +++ .../DELETEswitching_matrix (cell %).csv | 3 +++ .../DELETInterpolated Pop Structure.csv | 3 +++ .../DELFert contracep proj interpol.csv | 3 +++ .../DEL_Contracep proj (Table 5.1).csv | 3 +++ .../ResourceFile_Contraception/DEL_consumables.csv | 3 +++ .../ResourceFile_Contraception/Discontinuation_ByAge.csv | 3 +++ .../ResourceFile_Contraception/Discontinuation_ByMethod.csv | 3 +++ .../ResourceFile_Contraception/Failure_ByMethod.csv | 3 +++ .../ResourceFile_Contraception/Initiation_AfterBirth.csv | 3 +++ .../ResourceFile_Contraception/Initiation_ByAge.csv | 3 +++ .../ResourceFile_Contraception/Initiation_ByMethod.csv | 3 +++ .../ResourceFile_Contraception/Interventions_PPFP.csv | 3 +++ .../ResourceFile_Contraception/Interventions_Pop.csv | 3 +++ .../ResourceFile_Contraception/Method_Use_In_2010.csv | 3 +++ .../Pregnancy_NotUsing_HIVeffect.csv | 3 +++ .../ResourceFile_Contraception/Pregnancy_NotUsing_In_2010.csv | 3 +++ .../ResourceFile_Contraception/Prob_Switch_From.csv | 3 +++ .../ResourceFile_Contraception/Prob_Switch_From_And_To.csv | 3 +++ .../contraception_failure_discontin.csv | 3 +++ .../simplified_labour_parameters.csv | 3 +++ 54 files changed, 147 insertions(+), 15 deletions(-) delete mode 100644 resources/ResourceFile_AntenatalCare.xlsx create mode 100644 resources/ResourceFile_AntenatalCare/parameter_values.csv create mode 100644 resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv delete mode 100644 resources/ResourceFile_LabourSkilledBirthAttendance.xlsx create mode 100644 resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values.csv create mode 100644 resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv delete mode 100644 resources/ResourceFile_NewbornOutcomes.xlsx create mode 100644 resources/ResourceFile_NewbornOutcomes/parameter_values.csv delete mode 100644 resources/ResourceFile_PostnatalSupervisor.xlsx create mode 100644 resources/ResourceFile_PostnatalSupervisor/parameter_values.csv create mode 100644 resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv delete mode 100644 resources/contraception/ResourceFile_Contraception.xlsx create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation by age.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Initiation1 by age.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Initiation2 by age.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Mortality Rate.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Total Pop.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual years.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual years.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_lit summary.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETEswitching_matrix (cell %).csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELETInterpolated Pop Structure.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DELFert contracep proj interpol.csv create mode 100644 resources/contraception/ResourceFile_Contraception/DEL_Contracep proj (Table 5.1).csv create mode 100644 resources/contraception/ResourceFile_Contraception/DEL_consumables.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Discontinuation_ByAge.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Discontinuation_ByMethod.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Failure_ByMethod.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Initiation_AfterBirth.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Initiation_ByAge.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Initiation_ByMethod.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Interventions_PPFP.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Interventions_Pop.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Method_Use_In_2010.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_HIVeffect.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_In_2010.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Prob_Switch_From.csv create mode 100644 resources/contraception/ResourceFile_Contraception/Prob_Switch_From_And_To.csv create mode 100644 resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv create mode 100644 resources/contraception/ResourceFile_Contraception/simplified_labour_parameters.csv diff --git a/resources/ResourceFile_AntenatalCare.xlsx b/resources/ResourceFile_AntenatalCare.xlsx deleted file mode 100644 index 907ee62369..0000000000 --- a/resources/ResourceFile_AntenatalCare.xlsx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4da00560fd62d440d90dd3f054d999370a9cb3a83dd5516347ba8edef8275662 -size 19087 diff --git a/resources/ResourceFile_AntenatalCare/parameter_values.csv b/resources/ResourceFile_AntenatalCare/parameter_values.csv new file mode 100644 index 0000000000..546fd29a26 --- /dev/null +++ b/resources/ResourceFile_AntenatalCare/parameter_values.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5cf6bb4312c4e315d004ef769bac35560be3fe423fe648e9ea5549b5e3342d1 +size 1258 diff --git a/resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv b/resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv new file mode 100644 index 0000000000..caff5b26da --- /dev/null +++ b/resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93ff1058ccb481f3cd3f5bbc9634dc8ad70284892d2692777778cc3102bd55df +size 2754 diff --git a/resources/ResourceFile_LabourSkilledBirthAttendance.xlsx b/resources/ResourceFile_LabourSkilledBirthAttendance.xlsx deleted file mode 100644 index 9d61093db8..0000000000 --- a/resources/ResourceFile_LabourSkilledBirthAttendance.xlsx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ebd3aff1d77254f7cd7bb1dc019e2e6a86700dcd6009cecd11a70da4b85a3c93 -size 31777 diff --git a/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values.csv b/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values.csv new file mode 100644 index 0000000000..e7d18b8251 --- /dev/null +++ b/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be621298177fff272051d8b519dd890f812c427603f24e70a66386e528157047 +size 11243 diff --git a/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv b/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv new file mode 100644 index 0000000000..02a8494930 --- /dev/null +++ b/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e84e495241cbf479dd079a9e66b77e14d10a77fb8dd56c300f61cce4e2ae5f59 +size 8866 diff --git a/resources/ResourceFile_NewbornOutcomes.xlsx b/resources/ResourceFile_NewbornOutcomes.xlsx deleted file mode 100644 index e915c6814a..0000000000 --- a/resources/ResourceFile_NewbornOutcomes.xlsx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f81564a2128891c5e97da78a6d8dd63819016857d5ef9817993874002cb2a658 -size 15349 diff --git a/resources/ResourceFile_NewbornOutcomes/parameter_values.csv b/resources/ResourceFile_NewbornOutcomes/parameter_values.csv new file mode 100644 index 0000000000..85ae021aa4 --- /dev/null +++ b/resources/ResourceFile_NewbornOutcomes/parameter_values.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f805646e16fe9912a68da5a10b901086e8a531f4802b04a7ec2b1216eedfac4e +size 3737 diff --git a/resources/ResourceFile_PostnatalSupervisor.xlsx b/resources/ResourceFile_PostnatalSupervisor.xlsx deleted file mode 100644 index 4c5e85cfc7..0000000000 --- a/resources/ResourceFile_PostnatalSupervisor.xlsx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28757e4b9e6ffc0f0d12e8a76d4b4ac6704ce5bcbe781ec0c0d99bdce852cf04 -size 22888 diff --git a/resources/ResourceFile_PostnatalSupervisor/parameter_values.csv b/resources/ResourceFile_PostnatalSupervisor/parameter_values.csv new file mode 100644 index 0000000000..ac0f082139 --- /dev/null +++ b/resources/ResourceFile_PostnatalSupervisor/parameter_values.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dac89c4cc638a6f65cc21effb521380e3d6ca06600af737244e41ef0f71b4a9 +size 3573 diff --git a/resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv b/resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv new file mode 100644 index 0000000000..563de05a44 --- /dev/null +++ b/resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:962369fe11bf6a905bef6c87e4394545177a323c263428a8232eb905455d5012 +size 5400 diff --git a/resources/contraception/ResourceFile_Contraception.xlsx b/resources/contraception/ResourceFile_Contraception.xlsx deleted file mode 100644 index 660f29830b..0000000000 --- a/resources/contraception/ResourceFile_Contraception.xlsx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86fc4eae9bd0525d08994b51bc25de83bffb7f142b43fa8816cd44ed842878bf -size 975198 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation by age.csv new file mode 100644 index 0000000000..951dd92dc2 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation by age.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd5d278e1162a4bcb4b6acec3542d78ce1add0f568742d1ae182543919b9d079 +size 2535 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv new file mode 100644 index 0000000000..b29431b85b --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7ea9e27898a07cd65ca1112a561b7b26f8de7d856c0b0341665e5862e10bdb1 +size 9584 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1 by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1 by age.csv new file mode 100644 index 0000000000..5add15b3b1 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1 by age.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c5943e5f77e220ea48b0d5b27343f0cd65fbf0d7957d5153d6325cb407003fb +size 2639 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2 by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2 by age.csv new file mode 100644 index 0000000000..651191337a --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2 by age.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a773ff756318437f888439d732a3a57d8f166c9ace2e5dca6d7df7bf7afed6c9 +size 3555 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Mortality Rate.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Mortality Rate.csv new file mode 100644 index 0000000000..08da0655a8 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Mortality Rate.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9db2913992fa4a2a7c7640819cc06db730916343ea1a76320da02e979d0093a2 +size 33666 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv new file mode 100644 index 0000000000..2bc79877e1 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd6b27b6294c9726ae05d869eb164177e4f193a2548ff80c812f5dc78be3a1e4 +size 511 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Total Pop.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Total Pop.csv new file mode 100644 index 0000000000..2444cf50ac --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_Total Pop.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59e7625913fdb1de8fa339e88fcf6244c266255cc67232576232c31cad33ecc6 +size 7746 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv b/resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv new file mode 100644 index 0000000000..5209a0f3a0 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ddc0e99bd905c8cdf62fe99fa1f93823e1b193ddf31763eb3725f53cd724499c +size 369 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv b/resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv new file mode 100644 index 0000000000..85c0a5ee07 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:955e02a159d925e7f84a0a417dc6bd462af40b129e1772f631955cc1d959dc65 +size 6020 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv.csv b/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv.csv new file mode 100644 index 0000000000..9cffb7fe87 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee6b1c4a9eb3777c6b155cca226bcaf7189310621c0ea54215c3c216181fe4b3 +size 602 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv b/resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv new file mode 100644 index 0000000000..694370c7a3 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41e40811b91305b7cc090db46cd9710e8a5712811fde9e2c6b3dfdea2ee86c45 +size 1920 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv b/resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv new file mode 100644 index 0000000000..740a112623 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:700d158ecce96e11fdd6026df6d7130cc49aeb1ac3d4de612307a4431b4a83a0 +size 293 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv new file mode 100644 index 0000000000..287e20a25b --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f310f88b3578c279aa6f919616217103a60300d7954281a8c6cc1287d9dd115 +size 956 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv new file mode 100644 index 0000000000..5316449db1 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfc577436f68df1cdeaccabbeab8f445b88a8578b7f4f3f997cf1d48b4a20946 +size 2406 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv new file mode 100644 index 0000000000..aae1cdc25c --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6488c769d448b6d8b71cc4ae55338d1b2c7b29e9da444277ba494352ebd8086 +size 4484 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual years.csv new file mode 100644 index 0000000000..89a78134a2 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual years.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7db23e87e153a851e7df96fb0d048c67e8cc423cef0424e264ffdada3ae40337 +size 2455 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv new file mode 100644 index 0000000000..1a7dee68fc --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8a660cafc3ba1f1ad9a464cf51f1919f52a1d1dd0e47dff4fffb563acde2830 +size 1010 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv new file mode 100644 index 0000000000..b8d830cfdf --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32a6d851a3c9506575fad3a624a93f13a0be451fa32fff06a4ad77a1a32ab72f +size 2376 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual years.csv new file mode 100644 index 0000000000..56f19e4143 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual years.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72ad135c7666a42454e639e119c06a803da08743be90ab6e4c16cf852696a5e0 +size 2269 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_lit summary.csv b/resources/contraception/ResourceFile_Contraception/DELETE_lit summary.csv new file mode 100644 index 0000000000..404d2d48b4 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_lit summary.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfa46eaa9a63f0183bc2062f179e9a0041ec0da53fc10cc4b6cb4fc5d0f1b442 +size 4413 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv new file mode 100644 index 0000000000..9144d4fa2e --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a7492819e738133315edab3f895703e3098e9e81a6076f90e809047a2267bae +size 797 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv b/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv new file mode 100644 index 0000000000..68d2be2037 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008538b821a5e3af54bd22a413f4b1e28e1bc8ba99dd2e91219100c81a5be219 +size 626 diff --git a/resources/contraception/ResourceFile_Contraception/DELETEswitching_matrix (cell %).csv b/resources/contraception/ResourceFile_Contraception/DELETEswitching_matrix (cell %).csv new file mode 100644 index 0000000000..42df33e380 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETEswitching_matrix (cell %).csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70a66f109ee030aca18361680bf9e90cd7db45be0061db03695d9417c8bdbde6 +size 1537 diff --git a/resources/contraception/ResourceFile_Contraception/DELETInterpolated Pop Structure.csv b/resources/contraception/ResourceFile_Contraception/DELETInterpolated Pop Structure.csv new file mode 100644 index 0000000000..ea3ba4a663 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELETInterpolated Pop Structure.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a765cc4ca88edb4ee1ad81ba6e873f4ae95a6519ed4165cc7f245a70139cf7a5 +size 791719 diff --git a/resources/contraception/ResourceFile_Contraception/DELFert contracep proj interpol.csv b/resources/contraception/ResourceFile_Contraception/DELFert contracep proj interpol.csv new file mode 100644 index 0000000000..e6726e0195 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DELFert contracep proj interpol.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb6b7ff12189b9fc07c3bf31e70a4a083a06ee927372179c078a305d4a4a54e6 +size 9537 diff --git a/resources/contraception/ResourceFile_Contraception/DEL_Contracep proj (Table 5.1).csv b/resources/contraception/ResourceFile_Contraception/DEL_Contracep proj (Table 5.1).csv new file mode 100644 index 0000000000..94d68ac2b7 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DEL_Contracep proj (Table 5.1).csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f4337974ba84a171f3b28ce90ac8fd53fce15a8645501b40e7f6aabf3574af5 +size 4323 diff --git a/resources/contraception/ResourceFile_Contraception/DEL_consumables.csv b/resources/contraception/ResourceFile_Contraception/DEL_consumables.csv new file mode 100644 index 0000000000..6ec42cfabf --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/DEL_consumables.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58c294f46576dfc63f7d554d1d424057e59e26086f8c633ff289a9796c0a8f20 +size 3326 diff --git a/resources/contraception/ResourceFile_Contraception/Discontinuation_ByAge.csv b/resources/contraception/ResourceFile_Contraception/Discontinuation_ByAge.csv new file mode 100644 index 0000000000..c4b70b9182 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Discontinuation_ByAge.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3b8d2085d10f1680cf7d521ba415777b194ef26a964c14bca473cbdd76c7982 +size 770 diff --git a/resources/contraception/ResourceFile_Contraception/Discontinuation_ByMethod.csv b/resources/contraception/ResourceFile_Contraception/Discontinuation_ByMethod.csv new file mode 100644 index 0000000000..0736824d4b --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Discontinuation_ByMethod.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ab5f87adb1c35d4ff2fa0e6226a32840ef4d3d4a8d130404cf74e9f2a13528a +size 296 diff --git a/resources/contraception/ResourceFile_Contraception/Failure_ByMethod.csv b/resources/contraception/ResourceFile_Contraception/Failure_ByMethod.csv new file mode 100644 index 0000000000..399ed60f1d --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Failure_ByMethod.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d54deeb3a78189d18f1e18e20132aa4e965d5e780ab6299e4ef5434627449dfe +size 259 diff --git a/resources/contraception/ResourceFile_Contraception/Initiation_AfterBirth.csv b/resources/contraception/ResourceFile_Contraception/Initiation_AfterBirth.csv new file mode 100644 index 0000000000..1aa855046b --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Initiation_AfterBirth.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dec00bfe6c52595dbac43cc05bfa00771408dd3ceddc2a0c843ffe232453fd04 +size 270 diff --git a/resources/contraception/ResourceFile_Contraception/Initiation_ByAge.csv b/resources/contraception/ResourceFile_Contraception/Initiation_ByAge.csv new file mode 100644 index 0000000000..e1bf896912 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Initiation_ByAge.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb59b96ca917f218d48b349790092ea04d612c3545669c219ae25a65930a38d1 +size 810 diff --git a/resources/contraception/ResourceFile_Contraception/Initiation_ByMethod.csv b/resources/contraception/ResourceFile_Contraception/Initiation_ByMethod.csv new file mode 100644 index 0000000000..658921c98f --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Initiation_ByMethod.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62709e4159aff94254a843ad726cfb0b5d655bce4c7d209cff03fed2adde3534 +size 268 diff --git a/resources/contraception/ResourceFile_Contraception/Interventions_PPFP.csv b/resources/contraception/ResourceFile_Contraception/Interventions_PPFP.csv new file mode 100644 index 0000000000..64cf469ff6 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Interventions_PPFP.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66624dbc15b3f8299e218c97e1f9ebd2e79fc382e25b55f214cdfbe50cd85ee3 +size 150 diff --git a/resources/contraception/ResourceFile_Contraception/Interventions_Pop.csv b/resources/contraception/ResourceFile_Contraception/Interventions_Pop.csv new file mode 100644 index 0000000000..64cf469ff6 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Interventions_Pop.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66624dbc15b3f8299e218c97e1f9ebd2e79fc382e25b55f214cdfbe50cd85ee3 +size 150 diff --git a/resources/contraception/ResourceFile_Contraception/Method_Use_In_2010.csv b/resources/contraception/ResourceFile_Contraception/Method_Use_In_2010.csv new file mode 100644 index 0000000000..84880f7550 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Method_Use_In_2010.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fafc2deddb6c9f1a341f0dc45097aaf0770cb09b49ec26ffa7133f35e748044 +size 5983 diff --git a/resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_HIVeffect.csv b/resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_HIVeffect.csv new file mode 100644 index 0000000000..bd377c879b --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_HIVeffect.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f6848831b52ab636cf78cd6c3ddc999ad01a46d9d5471987d0e406c479f75ef0 +size 263 diff --git a/resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_In_2010.csv b/resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_In_2010.csv new file mode 100644 index 0000000000..c05c8a2649 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Pregnancy_NotUsing_In_2010.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57d060bdd1a4ad87630853291de818144eeb15c5d2a5ba54a4d2507b31f879ff +size 509 diff --git a/resources/contraception/ResourceFile_Contraception/Prob_Switch_From.csv b/resources/contraception/ResourceFile_Contraception/Prob_Switch_From.csv new file mode 100644 index 0000000000..072f28484a --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Prob_Switch_From.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9340fdca9143fd824c0074986c0fc4c7620120517ecbf67bce75b32d4fa240d +size 295 diff --git a/resources/contraception/ResourceFile_Contraception/Prob_Switch_From_And_To.csv b/resources/contraception/ResourceFile_Contraception/Prob_Switch_From_And_To.csv new file mode 100644 index 0000000000..6a3770c232 --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/Prob_Switch_From_And_To.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3784438c4ccc28e3886cc8244880364a3b73581598e2b73e515f2309fd14a281 +size 1219 diff --git a/resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv b/resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv new file mode 100644 index 0000000000..0212c0683f --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2817c661bbd4087068911d69dce0970362babda973df761a6c32982351c4015a +size 13592 diff --git a/resources/contraception/ResourceFile_Contraception/simplified_labour_parameters.csv b/resources/contraception/ResourceFile_Contraception/simplified_labour_parameters.csv new file mode 100644 index 0000000000..38c6f58d9e --- /dev/null +++ b/resources/contraception/ResourceFile_Contraception/simplified_labour_parameters.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71c1d00707d77dcba8ec87532a9ac3f122cb4bbb2c6cd473d57c0157259b16e3 +size 95 From bafe66a526412804636d2a87a2b01117a0158883 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Wed, 6 Nov 2024 16:57:05 +0300 Subject: [PATCH 02/12] use new method to read newly converted csv files --- src/tlo/methods/care_of_women_during_pregnancy.py | 5 +++-- src/tlo/methods/contraception.py | 10 +++++----- src/tlo/methods/labour.py | 8 ++++---- src/tlo/methods/newborn_outcomes.py | 6 +++--- src/tlo/methods/postnatal_supervisor.py | 5 +++-- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/tlo/methods/care_of_women_during_pregnancy.py b/src/tlo/methods/care_of_women_during_pregnancy.py index 69ce038299..1e77ce9b44 100644 --- a/src/tlo/methods/care_of_women_during_pregnancy.py +++ b/src/tlo/methods/care_of_women_during_pregnancy.py @@ -12,6 +12,7 @@ from tlo.methods.labour import LabourOnsetEvent from tlo.methods.malaria import HSI_MalariaIPTp from tlo.methods.tb import HSI_Tb_ScreeningAndRefer +from tlo.util import read_csv_files logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -176,8 +177,8 @@ def __init__(self, name=None, resourcefilepath=None): } def read_parameters(self, data_folder): - parameter_dataframe = pd.read_excel(Path(self.resourcefilepath) / 'ResourceFile_AntenatalCare.xlsx', - sheet_name='parameter_values') + parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_AntenatalCare', + files=['parameter_values']) self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/contraception.py b/src/tlo/methods/contraception.py index ab6c633f4c..301bd1e6be 100644 --- a/src/tlo/methods/contraception.py +++ b/src/tlo/methods/contraception.py @@ -8,7 +8,7 @@ from tlo.analysis.utils import flatten_multi_index_series_into_dict_for_logging from tlo.events import Event, IndividualScopeEventMixin, PopulationScopeEventMixin, RegularEvent from tlo.methods.hsi_event import HSI_Event -from tlo.util import random_date, sample_outcome, transition_states +from tlo.util import random_date, sample_outcome, transition_states, read_csv_files logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -164,7 +164,7 @@ def read_parameters(self, data_folder): """Import the relevant sheets from the ResourceFile (excel workbook) and declare values for other parameters (CSV ResourceFile). """ - workbook = pd.read_excel(Path(self.resourcefilepath) / 'contraception' / 'ResourceFile_Contraception.xlsx', sheet_name=None) + workbook = read_csv_files(Path(self.resourcefilepath) / 'contraception' / 'ResourceFile_Contraception') # Import selected sheets from the workbook as the parameters sheet_names = [ @@ -1346,10 +1346,10 @@ def __init__(self, *args): super().__init__(name='Labour') def read_parameters(self, *args): - parameter_dataframe = pd.read_excel(self.sim.modules['Contraception'].resourcefilepath / + parameter_dataframe = read_csv_files(self.sim.modules['Contraception'].resourcefilepath / 'contraception' / - 'ResourceFile_Contraception.xlsx', - sheet_name='simplified_labour_parameters') + 'ResourceFile_Contraception', + files=['simplified_labour_parameters']) self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/labour.py b/src/tlo/methods/labour.py index 35081b7d27..0a0141b293 100644 --- a/src/tlo/methods/labour.py +++ b/src/tlo/methods/labour.py @@ -17,7 +17,7 @@ from tlo.methods.hsi_event import HSI_Event from tlo.methods.hsi_generic_first_appts import GenericFirstAppointmentsMixin from tlo.methods.postnatal_supervisor import PostnatalWeekOneMaternalEvent -from tlo.util import BitsetHandler +from tlo.util import BitsetHandler, read_csv_files if TYPE_CHECKING: from tlo.methods.hsi_generic_first_appts import HSIEventScheduler @@ -620,9 +620,9 @@ def __init__(self, name=None, resourcefilepath=None): } def read_parameters(self, data_folder): - parameter_dataframe = pd.read_excel(Path(self.resourcefilepath) / 'ResourceFile_LabourSkilledBirth' - 'Attendance.xlsx', - sheet_name='parameter_values') + parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_LabourSkilledBirth' + 'Attendance', + files=['parameter_values']) self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/newborn_outcomes.py b/src/tlo/methods/newborn_outcomes.py index 3691bc6003..46536e3033 100644 --- a/src/tlo/methods/newborn_outcomes.py +++ b/src/tlo/methods/newborn_outcomes.py @@ -10,7 +10,7 @@ from tlo.methods.causes import Cause from tlo.methods.hsi_event import HSI_Event from tlo.methods.postnatal_supervisor import PostnatalWeekOneNeonatalEvent -from tlo.util import BitsetHandler +from tlo.util import BitsetHandler, read_csv_files logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -311,8 +311,8 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): - parameter_dataframe = pd.read_excel(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes.xlsx', - sheet_name='parameter_values') + parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes', + files=['parameter_values']) self.load_parameters_from_dataframe(parameter_dataframe) # Here we map 'disability' parameters to associated DALY weights to be passed to the health burden module diff --git a/src/tlo/methods/postnatal_supervisor.py b/src/tlo/methods/postnatal_supervisor.py index 25bce6013f..caba4cb826 100644 --- a/src/tlo/methods/postnatal_supervisor.py +++ b/src/tlo/methods/postnatal_supervisor.py @@ -9,6 +9,7 @@ from tlo.methods import Metadata, postnatal_supervisor_lm, pregnancy_helper_functions from tlo.methods.causes import Cause from tlo.methods.hsi_event import HSI_Event +from tlo.util import read_csv_files logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -230,8 +231,8 @@ def __init__(self, name=None, resourcefilepath=None): } def read_parameters(self, data_folder): - parameter_dataframe = pd.read_excel(Path(self.resourcefilepath) / 'ResourceFile_PostnatalSupervisor.xlsx', - sheet_name='parameter_values') + parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_PostnatalSupervisor', + files=['parameter_values']) self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): From 8227e70068039e3911be88167a701ae3d44128b8 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Thu, 7 Nov 2024 10:21:30 +0300 Subject: [PATCH 03/12] sort imports --- src/tlo/methods/contraception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tlo/methods/contraception.py b/src/tlo/methods/contraception.py index 301bd1e6be..e627f6eb37 100644 --- a/src/tlo/methods/contraception.py +++ b/src/tlo/methods/contraception.py @@ -8,7 +8,7 @@ from tlo.analysis.utils import flatten_multi_index_series_into_dict_for_logging from tlo.events import Event, IndividualScopeEventMixin, PopulationScopeEventMixin, RegularEvent from tlo.methods.hsi_event import HSI_Event -from tlo.util import random_date, sample_outcome, transition_states, read_csv_files +from tlo.util import random_date, read_csv_files, sample_outcome, transition_states logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) From 3c33ffb915aafef8910f11c891cbeccf61005c71 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Thu, 7 Nov 2024 10:28:55 +0300 Subject: [PATCH 04/12] used read_csv_files method --- src/tlo/methods/simplified_births.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tlo/methods/simplified_births.py b/src/tlo/methods/simplified_births.py index 50408f21e9..b6eb1c73f9 100644 --- a/src/tlo/methods/simplified_births.py +++ b/src/tlo/methods/simplified_births.py @@ -11,6 +11,7 @@ from tlo import DateOffset, Module, Parameter, Property, Types, logging from tlo.events import PopulationScopeEventMixin, RegularEvent from tlo.methods.contraception import get_medium_variant_asfr_from_wpp_resourcefile +from tlo.util import read_csv_files logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -111,7 +112,7 @@ def read_parameters(self, data_folder): self.parameters['months_between_pregnancy_and_delivery'] = 9 # Breastfeeding status for newborns (importing from the Newborn resourcefile) - rf = pd.read_excel(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes.xlsx') + rf = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes') param_as_string = rf.loc[rf.parameter_name == 'prob_breastfeeding_type']['value'].iloc[0] parameter = json.loads(param_as_string)[0] self.parameters['prob_breastfeeding_type'] = parameter From 733c2bd80aff0e131f5c4a83d03c50d32d1da103 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Thu, 7 Nov 2024 11:47:12 +0300 Subject: [PATCH 05/12] read csv files using the new read_csv_files method, disable pylint error, update doc string --- src/scripts/contraception/f_steril_use_2010vs2020.py | 2 +- src/tlo/methods/simplified_births.py | 1 + tests/test_contraception.py | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/contraception/f_steril_use_2010vs2020.py b/src/scripts/contraception/f_steril_use_2010vs2020.py index a266533136..013e704312 100644 --- a/src/scripts/contraception/f_steril_use_2010vs2020.py +++ b/src/scripts/contraception/f_steril_use_2010vs2020.py @@ -1,7 +1,7 @@ """ A helper script to see the numbers of women of reproductive age having female sterilisation per 5-years age categories + total, and the number of all women in the population in 2010 and 2020, to help to calibrate the intervention multipliers -(saved in ResourceFile_Contraception.xlsx in the sheets Interventions_Pop & Interventions_PPFP). +(saved in ResourceFile_Contraception folder in the Interventions_Pop & Interventions_PPFP CSV files). """ from pathlib import Path diff --git a/src/tlo/methods/simplified_births.py b/src/tlo/methods/simplified_births.py index b6eb1c73f9..b170e4a75d 100644 --- a/src/tlo/methods/simplified_births.py +++ b/src/tlo/methods/simplified_births.py @@ -112,6 +112,7 @@ def read_parameters(self, data_folder): self.parameters['months_between_pregnancy_and_delivery'] = 9 # Breastfeeding status for newborns (importing from the Newborn resourcefile) + # pylint: disable=E1101 rf = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes') param_as_string = rf.loc[rf.parameter_name == 'prob_breastfeeding_type']['value'].iloc[0] parameter = json.loads(param_as_string)[0] diff --git a/tests/test_contraception.py b/tests/test_contraception.py index 388b834393..6847165043 100644 --- a/tests/test_contraception.py +++ b/tests/test_contraception.py @@ -12,6 +12,7 @@ from tlo.methods import contraception, demography, enhanced_lifestyle, healthsystem, symptommanager from tlo.methods.contraception import HSI_Contraception_FamilyPlanningAppt from tlo.methods.hiv import DummyHivModule +from tlo.util import read_csv_files def run_sim(tmpdir, @@ -918,8 +919,8 @@ def test_input_probs_sum(): # Import relevant sheets from the workbook resourcefilepath = Path(os.path.dirname(__file__)) / '../resources' - workbook = pd.read_excel(Path(resourcefilepath) / 'contraception' / 'ResourceFile_Contraception.xlsx', - sheet_name=None) + workbook = read_csv_files(Path(resourcefilepath) / 'contraception' / 'ResourceFile_Contraception', + files=None) sheet_names = [ 'Initiation_ByMethod', 'Interventions_Pop', From 8bb93f32b36773055a49e4255b7e1887a55280c7 Mon Sep 17 00:00:00 2001 From: joehcollins Date: Thu, 7 Nov 2024 14:49:43 +0000 Subject: [PATCH 06/12] edits --- resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv | 3 --- .../parameter_values_old.csv | 3 --- .../ResourceFile_PostnatalSupervisor/parameter_values_old.csv | 3 --- 3 files changed, 9 deletions(-) delete mode 100644 resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv delete mode 100644 resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv delete mode 100644 resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv diff --git a/resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv b/resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv deleted file mode 100644 index caff5b26da..0000000000 --- a/resources/ResourceFile_AntenatalCare/parameter_values_OLD.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:93ff1058ccb481f3cd3f5bbc9634dc8ad70284892d2692777778cc3102bd55df -size 2754 diff --git a/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv b/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv deleted file mode 100644 index 02a8494930..0000000000 --- a/resources/ResourceFile_LabourSkilledBirthAttendance/parameter_values_old.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e84e495241cbf479dd079a9e66b77e14d10a77fb8dd56c300f61cce4e2ae5f59 -size 8866 diff --git a/resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv b/resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv deleted file mode 100644 index 563de05a44..0000000000 --- a/resources/ResourceFile_PostnatalSupervisor/parameter_values_old.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:962369fe11bf6a905bef6c87e4394545177a323c263428a8232eb905455d5012 -size 5400 From 3acf7f64757fc7ffac1f1c7ef713bdf8eecf14ce Mon Sep 17 00:00:00 2001 From: mnjowe Date: Fri, 8 Nov 2024 09:37:57 +0300 Subject: [PATCH 07/12] convert Excel to csv file(s), change from read_excel to read_csv_files for newly created csv file(s) --- resources/ResourceFile_PregnancySupervisor.xlsx | 3 --- .../ResourceFile_PregnancySupervisor/parameter_values.csv | 3 +++ src/tlo/methods/pregnancy_supervisor.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 resources/ResourceFile_PregnancySupervisor.xlsx create mode 100644 resources/ResourceFile_PregnancySupervisor/parameter_values.csv diff --git a/resources/ResourceFile_PregnancySupervisor.xlsx b/resources/ResourceFile_PregnancySupervisor.xlsx deleted file mode 100644 index 3ee3406d7a..0000000000 --- a/resources/ResourceFile_PregnancySupervisor.xlsx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fbd0974016b374a3286e379ef3cb1f297307ef410880c3f902e9439194a6d37d -size 22225 diff --git a/resources/ResourceFile_PregnancySupervisor/parameter_values.csv b/resources/ResourceFile_PregnancySupervisor/parameter_values.csv new file mode 100644 index 0000000000..05cfe2f3e2 --- /dev/null +++ b/resources/ResourceFile_PregnancySupervisor/parameter_values.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:702d26f19582a9fc603265da9f0b61f89fede8aa3582ab8cee551cf4109a49b1 +size 12966 diff --git a/src/tlo/methods/pregnancy_supervisor.py b/src/tlo/methods/pregnancy_supervisor.py index 7dd8819ab6..26121a3071 100644 --- a/src/tlo/methods/pregnancy_supervisor.py +++ b/src/tlo/methods/pregnancy_supervisor.py @@ -27,7 +27,7 @@ ) from tlo.methods.causes import Cause from tlo.methods.hsi_generic_first_appts import GenericFirstAppointmentsMixin -from tlo.util import BitsetHandler +from tlo.util import BitsetHandler, read_csv_files if TYPE_CHECKING: from tlo.methods.hsi_generic_first_appts import HSIEventScheduler @@ -434,8 +434,8 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): # load parameters from the resource file - parameter_dataframe = pd.read_excel(Path(self.resourcefilepath) / 'ResourceFile_PregnancySupervisor.xlsx', - sheet_name='parameter_values') + parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_PregnancySupervisor', + files=['parameter_values']) self.load_parameters_from_dataframe(parameter_dataframe) # Here we map 'disability' parameters to associated DALY weights to be passed to the health burden module. From 211327dea451cd8dca2621f2356af9c37d2107c7 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Tue, 26 Nov 2024 09:55:45 +0300 Subject: [PATCH 08/12] rename resource files. added underscores and removed some unwanted characters and duplicate extensions --- ...scontinuation by age.csv => DELETE_Discontinuation_by_age.csv} | 0 ...ELETE_Initiation1 by age.csv => DELETE_Initiation1_by_age.csv} | 0 ...ELETE_Initiation2 by age.csv => DELETE_Initiation2_by_age.csv} | 0 .../{DELETE_Mortality Rate.csv => DELETE_Mortality_Rate.csv} | 0 .../{DELETE_Total Pop.csv => DELETE_Total_Pop.csv} | 0 .../{DELETE_cprev2010.csv.csv => DELETE_cprev2010.csv} | 0 ...{DELETE_irate1_1116_all.csv.csv => DELETE_irate1_1116_all.csv} | 0 ...e1_individual years.csv => DELETE_irate1_individual_years.csv} | 0 ...e2_individual years.csv => DELETE_irate2_individual_years.csv} | 0 .../{DELETE_lit summary.csv => DELETE_lit_summary.csv} | 0 ...ng_matrix (cell %).csv => DELETE_switching_matrix_cell_%_.csv} | 0 ...ated Pop Structure.csv => DELETInterpolated_Pop_Structure.csv} | 0 ...acep proj (Table 5.1).csv => DEL_Contracep_proj_Table_5_1.csv} | 0 ...cep proj interpol.csv => DEL_Fert_contracep_proj_interpol.csv} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename resources/contraception/ResourceFile_Contraception/{DELETE_Discontinuation by age.csv => DELETE_Discontinuation_by_age.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_Initiation1 by age.csv => DELETE_Initiation1_by_age.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_Initiation2 by age.csv => DELETE_Initiation2_by_age.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_Mortality Rate.csv => DELETE_Mortality_Rate.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_Total Pop.csv => DELETE_Total_Pop.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_cprev2010.csv.csv => DELETE_cprev2010.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_irate1_1116_all.csv.csv => DELETE_irate1_1116_all.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_irate1_individual years.csv => DELETE_irate1_individual_years.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_irate2_individual years.csv => DELETE_irate2_individual_years.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETE_lit summary.csv => DELETE_lit_summary.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETEswitching_matrix (cell %).csv => DELETE_switching_matrix_cell_%_.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELETInterpolated Pop Structure.csv => DELETInterpolated_Pop_Structure.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DEL_Contracep proj (Table 5.1).csv => DEL_Contracep_proj_Table_5_1.csv} (100%) rename resources/contraception/ResourceFile_Contraception/{DELFert contracep proj interpol.csv => DEL_Fert_contracep_proj_interpol.csv} (100%) diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation_by_age.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation by age.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation_by_age.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1 by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1_by_age.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_Initiation1 by age.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_Initiation1_by_age.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2 by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2_by_age.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_Initiation2 by age.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_Initiation2_by_age.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Mortality Rate.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Mortality_Rate.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_Mortality Rate.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_Mortality_Rate.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Total Pop.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Total_Pop.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_Total Pop.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_Total_Pop.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv.csv b/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual_years.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual years.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual_years.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual_years.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual years.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual_years.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_lit summary.csv b/resources/contraception/ResourceFile_Contraception/DELETE_lit_summary.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETE_lit summary.csv rename to resources/contraception/ResourceFile_Contraception/DELETE_lit_summary.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETEswitching_matrix (cell %).csv b/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix_cell_%_.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETEswitching_matrix (cell %).csv rename to resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix_cell_%_.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETInterpolated Pop Structure.csv b/resources/contraception/ResourceFile_Contraception/DELETInterpolated_Pop_Structure.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELETInterpolated Pop Structure.csv rename to resources/contraception/ResourceFile_Contraception/DELETInterpolated_Pop_Structure.csv diff --git a/resources/contraception/ResourceFile_Contraception/DEL_Contracep proj (Table 5.1).csv b/resources/contraception/ResourceFile_Contraception/DEL_Contracep_proj_Table_5_1.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DEL_Contracep proj (Table 5.1).csv rename to resources/contraception/ResourceFile_Contraception/DEL_Contracep_proj_Table_5_1.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELFert contracep proj interpol.csv b/resources/contraception/ResourceFile_Contraception/DEL_Fert_contracep_proj_interpol.csv similarity index 100% rename from resources/contraception/ResourceFile_Contraception/DELFert contracep proj interpol.csv rename to resources/contraception/ResourceFile_Contraception/DEL_Fert_contracep_proj_interpol.csv From a967a29dd11399445ecf03026818ae4e6119096e Mon Sep 17 00:00:00 2001 From: mnjowe Date: Tue, 26 Nov 2024 09:58:08 +0300 Subject: [PATCH 09/12] updated modules to align with updates to read_csv_files method in master --- src/tlo/methods/care_of_women_during_pregnancy.py | 2 +- src/tlo/methods/contraception.py | 5 +++-- src/tlo/methods/labour.py | 2 +- src/tlo/methods/newborn_outcomes.py | 2 +- src/tlo/methods/postnatal_supervisor.py | 2 +- src/tlo/methods/pregnancy_supervisor.py | 2 +- src/tlo/methods/simplified_births.py | 2 +- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/tlo/methods/care_of_women_during_pregnancy.py b/src/tlo/methods/care_of_women_during_pregnancy.py index 1e77ce9b44..dabe61e884 100644 --- a/src/tlo/methods/care_of_women_during_pregnancy.py +++ b/src/tlo/methods/care_of_women_during_pregnancy.py @@ -178,7 +178,7 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_AntenatalCare', - files=['parameter_values']) + files='parameter_values') self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/contraception.py b/src/tlo/methods/contraception.py index e627f6eb37..7e2f2edcf5 100644 --- a/src/tlo/methods/contraception.py +++ b/src/tlo/methods/contraception.py @@ -164,7 +164,8 @@ def read_parameters(self, data_folder): """Import the relevant sheets from the ResourceFile (excel workbook) and declare values for other parameters (CSV ResourceFile). """ - workbook = read_csv_files(Path(self.resourcefilepath) / 'contraception' / 'ResourceFile_Contraception') + workbook = read_csv_files(Path(self.resourcefilepath) / 'contraception' / 'ResourceFile_Contraception', + files=None) # Import selected sheets from the workbook as the parameters sheet_names = [ @@ -1349,7 +1350,7 @@ def read_parameters(self, *args): parameter_dataframe = read_csv_files(self.sim.modules['Contraception'].resourcefilepath / 'contraception' / 'ResourceFile_Contraception', - files=['simplified_labour_parameters']) + files='simplified_labour_parameters') self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/labour.py b/src/tlo/methods/labour.py index 0a0141b293..876259e020 100644 --- a/src/tlo/methods/labour.py +++ b/src/tlo/methods/labour.py @@ -622,7 +622,7 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_LabourSkilledBirth' 'Attendance', - files=['parameter_values']) + files='parameter_values') self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/newborn_outcomes.py b/src/tlo/methods/newborn_outcomes.py index 46536e3033..0caf207499 100644 --- a/src/tlo/methods/newborn_outcomes.py +++ b/src/tlo/methods/newborn_outcomes.py @@ -312,7 +312,7 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes', - files=['parameter_values']) + files='parameter_values') self.load_parameters_from_dataframe(parameter_dataframe) # Here we map 'disability' parameters to associated DALY weights to be passed to the health burden module diff --git a/src/tlo/methods/postnatal_supervisor.py b/src/tlo/methods/postnatal_supervisor.py index caba4cb826..739b747e88 100644 --- a/src/tlo/methods/postnatal_supervisor.py +++ b/src/tlo/methods/postnatal_supervisor.py @@ -232,7 +232,7 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_PostnatalSupervisor', - files=['parameter_values']) + files='parameter_values') self.load_parameters_from_dataframe(parameter_dataframe) def initialise_population(self, population): diff --git a/src/tlo/methods/pregnancy_supervisor.py b/src/tlo/methods/pregnancy_supervisor.py index 26121a3071..b25a935d9e 100644 --- a/src/tlo/methods/pregnancy_supervisor.py +++ b/src/tlo/methods/pregnancy_supervisor.py @@ -435,7 +435,7 @@ def __init__(self, name=None, resourcefilepath=None): def read_parameters(self, data_folder): # load parameters from the resource file parameter_dataframe = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_PregnancySupervisor', - files=['parameter_values']) + files='parameter_values') self.load_parameters_from_dataframe(parameter_dataframe) # Here we map 'disability' parameters to associated DALY weights to be passed to the health burden module. diff --git a/src/tlo/methods/simplified_births.py b/src/tlo/methods/simplified_births.py index b170e4a75d..ef2c4e0bf4 100644 --- a/src/tlo/methods/simplified_births.py +++ b/src/tlo/methods/simplified_births.py @@ -113,7 +113,7 @@ def read_parameters(self, data_folder): # Breastfeeding status for newborns (importing from the Newborn resourcefile) # pylint: disable=E1101 - rf = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes') + rf = pd.read_csv(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes/parameter_values.csv') param_as_string = rf.loc[rf.parameter_name == 'prob_breastfeeding_type']['value'].iloc[0] parameter = json.loads(param_as_string)[0] self.parameters['prob_breastfeeding_type'] = parameter From 013242d05cf0e5a96c906c44a385921e135ff62d Mon Sep 17 00:00:00 2001 From: mnjowe Date: Tue, 26 Nov 2024 10:02:26 +0300 Subject: [PATCH 10/12] remove disable pylint as we are now directly reading via pd.read_csv --- src/tlo/methods/simplified_births.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tlo/methods/simplified_births.py b/src/tlo/methods/simplified_births.py index ef2c4e0bf4..a742afec4c 100644 --- a/src/tlo/methods/simplified_births.py +++ b/src/tlo/methods/simplified_births.py @@ -112,7 +112,6 @@ def read_parameters(self, data_folder): self.parameters['months_between_pregnancy_and_delivery'] = 9 # Breastfeeding status for newborns (importing from the Newborn resourcefile) - # pylint: disable=E1101 rf = pd.read_csv(Path(self.resourcefilepath) / 'ResourceFile_NewbornOutcomes/parameter_values.csv') param_as_string = rf.loc[rf.parameter_name == 'prob_breastfeeding_type']['value'].iloc[0] parameter = json.loads(param_as_string)[0] From da78d9ee7d9583619ddb0c91940e181311c35f91 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Tue, 26 Nov 2024 10:05:42 +0300 Subject: [PATCH 11/12] remove unused import --- src/tlo/methods/simplified_births.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tlo/methods/simplified_births.py b/src/tlo/methods/simplified_births.py index a742afec4c..4daa8c3805 100644 --- a/src/tlo/methods/simplified_births.py +++ b/src/tlo/methods/simplified_births.py @@ -11,7 +11,6 @@ from tlo import DateOffset, Module, Parameter, Property, Types, logging from tlo.events import PopulationScopeEventMixin, RegularEvent from tlo.methods.contraception import get_medium_variant_asfr_from_wpp_resourcefile -from tlo.util import read_csv_files logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) From d09d6dae5a817ce55cf21887be6a30868d0628d5 Mon Sep 17 00:00:00 2001 From: mnjowe Date: Mon, 16 Dec 2024 11:06:26 +0300 Subject: [PATCH 12/12] delete unused csv files --- .../DELETE_Discontinuation_by_age.csv | 3 --- .../ResourceFile_Contraception/DELETE_Guttmacher.csv | 3 --- .../ResourceFile_Contraception/DELETE_Initiation1_by_age.csv | 3 --- .../ResourceFile_Contraception/DELETE_Initiation2_by_age.csv | 3 --- .../ResourceFile_Contraception/DELETE_Mortality_Rate.csv | 3 --- .../ResourceFile_Contraception/DELETE_Prob_NND_days.csv | 3 --- .../ResourceFile_Contraception/DELETE_Total_Pop.csv | 3 --- .../contraception/ResourceFile_Contraception/DELETE_USAID.csv | 3 --- .../contraception/ResourceFile_Contraception/DELETE_WHO.csv | 3 --- .../ResourceFile_Contraception/DELETE_cprev2010.csv | 3 --- .../ResourceFile_Contraception/DELETE_drates_12m.csv | 3 --- .../ResourceFile_Contraception/DELETE_interventions.csv | 3 --- .../ResourceFile_Contraception/DELETE_irate1_1116_all.csv | 3 --- .../ResourceFile_Contraception/DELETE_irate1_5years.csv | 3 --- .../DELETE_irate1_all__1116_by age.csv | 3 --- .../DELETE_irate1_individual_years.csv | 3 --- .../contraception/ResourceFile_Contraception/DELETE_irate2.csv | 3 --- .../ResourceFile_Contraception/DELETE_irate2_5years.csv | 3 --- .../DELETE_irate2_individual_years.csv | 3 --- .../ResourceFile_Contraception/DELETE_lit_summary.csv | 3 --- .../ResourceFile_Contraception/DELETE_r_init2_age.csv | 3 --- .../ResourceFile_Contraception/DELETE_switching_matrix (n).csv | 3 --- .../DELETE_switching_matrix_cell_%_.csv | 3 --- .../DELETInterpolated_Pop_Structure.csv | 3 --- .../DEL_Contracep_proj_Table_5_1.csv | 3 --- .../DEL_Fert_contracep_proj_interpol.csv | 3 --- .../ResourceFile_Contraception/DEL_consumables.csv | 3 --- .../contraception_failure_discontin.csv | 3 --- 28 files changed, 84 deletions(-) delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation_by_age.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Initiation1_by_age.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Initiation2_by_age.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Mortality_Rate.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_Total_Pop.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual_years.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual_years.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_lit_summary.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix_cell_%_.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DELETInterpolated_Pop_Structure.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DEL_Contracep_proj_Table_5_1.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DEL_Fert_contracep_proj_interpol.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/DEL_consumables.csv delete mode 100644 resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation_by_age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation_by_age.csv deleted file mode 100644 index 951dd92dc2..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Discontinuation_by_age.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dd5d278e1162a4bcb4b6acec3542d78ce1add0f568742d1ae182543919b9d079 -size 2535 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv deleted file mode 100644 index b29431b85b..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Guttmacher.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d7ea9e27898a07cd65ca1112a561b7b26f8de7d856c0b0341665e5862e10bdb1 -size 9584 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1_by_age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1_by_age.csv deleted file mode 100644 index 5add15b3b1..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation1_by_age.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5c5943e5f77e220ea48b0d5b27343f0cd65fbf0d7957d5153d6325cb407003fb -size 2639 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2_by_age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2_by_age.csv deleted file mode 100644 index 651191337a..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Initiation2_by_age.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a773ff756318437f888439d732a3a57d8f166c9ace2e5dca6d7df7bf7afed6c9 -size 3555 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Mortality_Rate.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Mortality_Rate.csv deleted file mode 100644 index 08da0655a8..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Mortality_Rate.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9db2913992fa4a2a7c7640819cc06db730916343ea1a76320da02e979d0093a2 -size 33666 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv deleted file mode 100644 index 2bc79877e1..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Prob_NND_days.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fd6b27b6294c9726ae05d869eb164177e4f193a2548ff80c812f5dc78be3a1e4 -size 511 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_Total_Pop.csv b/resources/contraception/ResourceFile_Contraception/DELETE_Total_Pop.csv deleted file mode 100644 index 2444cf50ac..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_Total_Pop.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:59e7625913fdb1de8fa339e88fcf6244c266255cc67232576232c31cad33ecc6 -size 7746 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv b/resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv deleted file mode 100644 index 5209a0f3a0..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_USAID.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ddc0e99bd905c8cdf62fe99fa1f93823e1b193ddf31763eb3725f53cd724499c -size 369 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv b/resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv deleted file mode 100644 index 85c0a5ee07..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_WHO.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:955e02a159d925e7f84a0a417dc6bd462af40b129e1772f631955cc1d959dc65 -size 6020 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv b/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv deleted file mode 100644 index 9cffb7fe87..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_cprev2010.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ee6b1c4a9eb3777c6b155cca226bcaf7189310621c0ea54215c3c216181fe4b3 -size 602 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv b/resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv deleted file mode 100644 index 694370c7a3..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_drates_12m.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41e40811b91305b7cc090db46cd9710e8a5712811fde9e2c6b3dfdea2ee86c45 -size 1920 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv b/resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv deleted file mode 100644 index 740a112623..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_interventions.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:700d158ecce96e11fdd6026df6d7130cc49aeb1ac3d4de612307a4431b4a83a0 -size 293 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv deleted file mode 100644 index 287e20a25b..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_1116_all.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f310f88b3578c279aa6f919616217103a60300d7954281a8c6cc1287d9dd115 -size 956 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv deleted file mode 100644 index 5316449db1..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_5years.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dfc577436f68df1cdeaccabbeab8f445b88a8578b7f4f3f997cf1d48b4a20946 -size 2406 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv deleted file mode 100644 index aae1cdc25c..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_all__1116_by age.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f6488c769d448b6d8b71cc4ae55338d1b2c7b29e9da444277ba494352ebd8086 -size 4484 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual_years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual_years.csv deleted file mode 100644 index 89a78134a2..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate1_individual_years.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7db23e87e153a851e7df96fb0d048c67e8cc423cef0424e264ffdada3ae40337 -size 2455 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv deleted file mode 100644 index 1a7dee68fc..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate2.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8a660cafc3ba1f1ad9a464cf51f1919f52a1d1dd0e47dff4fffb563acde2830 -size 1010 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv deleted file mode 100644 index b8d830cfdf..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_5years.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:32a6d851a3c9506575fad3a624a93f13a0be451fa32fff06a4ad77a1a32ab72f -size 2376 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual_years.csv b/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual_years.csv deleted file mode 100644 index 56f19e4143..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_irate2_individual_years.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72ad135c7666a42454e639e119c06a803da08743be90ab6e4c16cf852696a5e0 -size 2269 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_lit_summary.csv b/resources/contraception/ResourceFile_Contraception/DELETE_lit_summary.csv deleted file mode 100644 index 404d2d48b4..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_lit_summary.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cfa46eaa9a63f0183bc2062f179e9a0041ec0da53fc10cc4b6cb4fc5d0f1b442 -size 4413 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv b/resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv deleted file mode 100644 index 9144d4fa2e..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_r_init2_age.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2a7492819e738133315edab3f895703e3098e9e81a6076f90e809047a2267bae -size 797 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv b/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv deleted file mode 100644 index 68d2be2037..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix (n).csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:008538b821a5e3af54bd22a413f4b1e28e1bc8ba99dd2e91219100c81a5be219 -size 626 diff --git a/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix_cell_%_.csv b/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix_cell_%_.csv deleted file mode 100644 index 42df33e380..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETE_switching_matrix_cell_%_.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70a66f109ee030aca18361680bf9e90cd7db45be0061db03695d9417c8bdbde6 -size 1537 diff --git a/resources/contraception/ResourceFile_Contraception/DELETInterpolated_Pop_Structure.csv b/resources/contraception/ResourceFile_Contraception/DELETInterpolated_Pop_Structure.csv deleted file mode 100644 index ea3ba4a663..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DELETInterpolated_Pop_Structure.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a765cc4ca88edb4ee1ad81ba6e873f4ae95a6519ed4165cc7f245a70139cf7a5 -size 791719 diff --git a/resources/contraception/ResourceFile_Contraception/DEL_Contracep_proj_Table_5_1.csv b/resources/contraception/ResourceFile_Contraception/DEL_Contracep_proj_Table_5_1.csv deleted file mode 100644 index 94d68ac2b7..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DEL_Contracep_proj_Table_5_1.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9f4337974ba84a171f3b28ce90ac8fd53fce15a8645501b40e7f6aabf3574af5 -size 4323 diff --git a/resources/contraception/ResourceFile_Contraception/DEL_Fert_contracep_proj_interpol.csv b/resources/contraception/ResourceFile_Contraception/DEL_Fert_contracep_proj_interpol.csv deleted file mode 100644 index e6726e0195..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DEL_Fert_contracep_proj_interpol.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eb6b7ff12189b9fc07c3bf31e70a4a083a06ee927372179c078a305d4a4a54e6 -size 9537 diff --git a/resources/contraception/ResourceFile_Contraception/DEL_consumables.csv b/resources/contraception/ResourceFile_Contraception/DEL_consumables.csv deleted file mode 100644 index 6ec42cfabf..0000000000 --- a/resources/contraception/ResourceFile_Contraception/DEL_consumables.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:58c294f46576dfc63f7d554d1d424057e59e26086f8c633ff289a9796c0a8f20 -size 3326 diff --git a/resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv b/resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv deleted file mode 100644 index 0212c0683f..0000000000 --- a/resources/contraception/ResourceFile_Contraception/contraception_failure_discontin.csv +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2817c661bbd4087068911d69dce0970362babda973df761a6c32982351c4015a -size 13592