Skip to content

Get resource file path from simulation #1375

@mnjowe

Description

It could have been good if disease modules could be getting resource file path from simulation instead of each defining its own resource file path. This implementation is good as it makes us avoid repetition. In line with this view, the below line of code in simulation could be supplied self.resourcefilepath instead of passing an empty string. Thereafter modules could get the resource file path via the def read_parameters(self, data_folder) method.

module.read_parameters('')

Tasks

  • Pass resource file path to simulation object
  • Extend the resource file path to disease modules via self.read_parameters()
  • Make disease modules get the path from simulation in def read_parameters() method(rename data_folder argument to resourcefilepath). Delete redundant paths in each disease module
  • Resolve all issues arising from resource file paths used outside def read_parameters() method. @matt-graham arleady sent some links of those other places. see the links below
  • add a test to ensure everything is working as expected

params_to_update = get_parameters_for_improved_healthsystem_and_healthcare_seeking(
resourcefilepath=self.resourcefilepath,
**self.parameters
)

xls = pd.ExcelFile(self.resourcefilepath / "ResourceFile_HIV.xlsx")

xls_tb = pd.ExcelFile(self.resourcefilepath / "ResourceFile_TB.xlsx")

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions