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

Convert excel files to csv files epi_hiv_malaria_measles_schisto_tb #1484

Merged
merged 13 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions resources/ResourceFile_EPI_WHO_estimates.xlsx

This file was deleted.

3 changes: 3 additions & 0 deletions resources/ResourceFile_EPI_WHO_estimates/WHO_estimates.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_EPI_WHO_estimates/parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_EPI_WHO_estimates/vaccine_schedule.csv
Git LFS file not shown
3 changes: 0 additions & 3 deletions resources/ResourceFile_HIV.xlsx

This file was deleted.

3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/DHS_prevalence.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/LHC_samples.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/MPHIA_incidence2020.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/MPHIA_prevalence_art2020.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/MoH_CPT_IPT2020.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/MoH_number_art.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/MoH_numbers_tests.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/art_coverage.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/calibration_from_aids_info.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/children0_14_prev_AIDSinfo.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/hiv_prevalence.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/scaleup_parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/spectrum_treatment_cascade.csv
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/unaids_infections_art2021.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/unaids_mortality_dalys2021.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/unaids_pmtct2021.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_HIV/unaids_program_perf.csv
Git LFS file not shown
3 changes: 0 additions & 3 deletions resources/ResourceFile_Measles.xlsx

This file was deleted.

3 changes: 3 additions & 0 deletions resources/ResourceFile_Measles/beta.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Measles/cfr.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Measles/parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Measles/symptoms.csv
Git LFS file not shown
3 changes: 0 additions & 3 deletions resources/ResourceFile_Schisto.xlsx

This file was deleted.

3 changes: 3 additions & 0 deletions resources/ResourceFile_Schisto/DALYs.csv
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Schisto/District_Params_mansoni.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Schisto/MDA_historical_Coverage.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Schisto/MDA_prognosed_Coverage.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Schisto/Parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_Schisto/Symptoms.csv
Git LFS file not shown
3 changes: 0 additions & 3 deletions resources/ResourceFile_TB.xlsx

This file was deleted.

3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/IPTdistricts.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/NTP2019.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/WHO_activeTB2023.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/WHO_latentTB2017.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/WHO_mdrTB2017.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/WHO_tx_success_rates2021.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/additional_params.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/all_districts.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/calibrated_transmission_rates.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/cases2010district.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/details_rates.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/followup.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/ipt_coverage.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/latent_TB2014_summary.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/pulm_tb.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/scaleup_parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/ResourceFile_TB/testing_rates.csv
Git LFS file not shown
3 changes: 0 additions & 3 deletions resources/malaria/ResourceFile_malaria.xlsx

This file was deleted.

Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/MAP_IRSrates.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/MAP_ITNrates.csv
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/NMCP.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/PfPR_MAPdata.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/WHO_CaseData2023.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/WHO_MalReport.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/WHO_TestData2023.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/WHOcommodities.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/highrisk_districts.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/inc1000py_MAPdata.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/interventions.csv
Git LFS file not shown
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/scaleup_parameters.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/severe_symptoms.csv
Git LFS file not shown
3 changes: 3 additions & 0 deletions resources/malaria/ResourceFile_malaria/txCov_MAPdata.csv
Git LFS file not shown
5 changes: 2 additions & 3 deletions src/tlo/methods/epi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from tlo.events import IndividualScopeEventMixin, PopulationScopeEventMixin, RegularEvent
from tlo.methods import Metadata
from tlo.methods.hsi_event import HSI_Event
from tlo.util import read_csv_files

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -71,9 +72,7 @@ def __init__(self, name=None, resourcefilepath=None):

def read_parameters(self, data_folder):
p = self.parameters
workbook = pd.read_excel(
Path(self.resourcefilepath) / 'ResourceFile_EPI_WHO_estimates.xlsx', sheet_name=None
)
workbook = read_csv_files(Path(self.resourcefilepath) / 'ResourceFile_EPI_WHO_estimates', files=None)

self.load_parameters_from_dataframe(workbook["parameters"])

Expand Down
8 changes: 2 additions & 6 deletions src/tlo/methods/hiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"""
from __future__ import annotations

import os
from typing import TYPE_CHECKING, List

import numpy as np
Expand All @@ -40,7 +39,7 @@
from tlo.methods.hsi_event import HSI_Event
from tlo.methods.hsi_generic_first_appts import GenericFirstAppointmentsMixin
from tlo.methods.symptommanager import Symptom
from tlo.util import create_age_range_lookup
from tlo.util import create_age_range_lookup, read_csv_files

if TYPE_CHECKING:
from tlo.methods.hsi_generic_first_appts import HSIEventScheduler
Expand Down Expand Up @@ -423,10 +422,7 @@ def read_parameters(self, data_folder):
# Shortcut to parameters dict
p = self.parameters

workbook = pd.read_excel(
os.path.join(self.resourcefilepath, "ResourceFile_HIV.xlsx"),
sheet_name=None,
)
workbook = read_csv_files(self.resourcefilepath/'ResourceFile_HIV', files=None)
self.load_parameters_from_dataframe(workbook["parameters"])

# Load data on HIV prevalence
Expand Down
5 changes: 3 additions & 2 deletions src/tlo/methods/malaria.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from tlo.methods.hsi_event import HSI_Event
from tlo.methods.hsi_generic_first_appts import GenericFirstAppointmentsMixin
from tlo.methods.symptommanager import Symptom
from tlo.util import random_date
from tlo.util import random_date, read_csv_files

if TYPE_CHECKING:
from tlo.methods.hsi_generic_first_appts import DiagnosisFunction, HSIEventScheduler
Expand Down Expand Up @@ -241,7 +241,8 @@ def __init__(self, name=None, resourcefilepath=None):
}

def read_parameters(self, data_folder):
workbook = pd.read_excel(self.resourcefilepath / 'malaria' / 'ResourceFile_malaria.xlsx', sheet_name=None)
# workbook = pd.read_excel(self.resourcefilepath / 'malaria' / 'ResourceFile_malaria.xlsx', sheet_name=None)
workbook = read_csv_files(self.resourcefilepath / 'malaria' / 'ResourceFile_malaria', files=None)
self.load_parameters_from_dataframe(workbook['parameters'])

p = self.parameters
Expand Down
9 changes: 2 additions & 7 deletions src/tlo/methods/measles.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import math
import os
from typing import TYPE_CHECKING, List

import pandas as pd
Expand All @@ -13,7 +12,7 @@
from tlo.methods.hsi_event import HSI_Event
from tlo.methods.hsi_generic_first_appts import GenericFirstAppointmentsMixin
from tlo.methods.symptommanager import Symptom
from tlo.util import random_date
from tlo.util import random_date, read_csv_files

if TYPE_CHECKING:
from tlo.methods.hsi_generic_first_appts import HSIEventScheduler
Expand Down Expand Up @@ -102,11 +101,7 @@ def __init__(self, name=None, resourcefilepath=None):
def read_parameters(self, data_folder):
"""Read parameter values from file
"""

workbook = pd.read_excel(
os.path.join(self.resourcefilepath, "ResourceFile_Measles.xlsx"),
sheet_name=None,
)
workbook = read_csv_files(self.resourcefilepath/'ResourceFile_Measles', files=None)
self.load_parameters_from_dataframe(workbook["parameters"])

self.parameters["symptom_prob"] = workbook["symptoms"]
Expand Down
Loading