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

Confirm that SetGlobalStartEndYears() works as expected #120

Merged
merged 6 commits into from
Sep 7, 2022

Conversation

celiot-IDM
Copy link
Collaborator

Some code tidying, and some unit test confirmation that SetGlobalStartEndYears() works correctly.

@celiot-IDM
Copy link
Collaborator Author

Will fix #24

@celiot-IDM
Copy link
Collaborator Author

celiot-IDM commented Sep 6, 2022

With this code we should probably update our standard examples to include a call to SetGlobalStartEndYears():

library(ehep)

ehep::InitializePopulation()
ehep::InitializeHealthcareTasks()
ehep::InitializeScenarios()
ehep::InitializeStochasticParameters()
ehep::InitializeSeasonality()

scenario <- "MergedModel"

ehep::SetGlobalStartEndYears(2025, 2055)

results <-
  ehep::RunExperiments(scenarioName = scenario,
                       trials = 100)

I've confirmed that the start/end years are carried through to nice plots like this (100 population growth trajectories, with 95% CI around the mean):

image

@MeWu-IDM
Copy link
Collaborator

MeWu-IDM commented Sep 7, 2022

We should update regression tests to use https://github.com/InstituteforDiseaseModeling/Ethiopia-HEP-Capacity-Analysis/blob/charles/issue24/tests/testthat/test_lean_scenario.R to use ehep::SetGlobalStartEndYears with default years, @celiot-IDM do you want me to update this or you can add it?

@celiot-IDM
Copy link
Collaborator Author

@MeWu-IDM : I'm happy for you to make that change! Thanks for calling it out.

@MeWu-IDM
Copy link
Collaborator

MeWu-IDM commented Sep 7, 2022

Updated the regression tests and it is passing with default values. This looks good to me

@MeWu-IDM MeWu-IDM merged commit 49f2936 into main Sep 7, 2022
@MeWu-IDM MeWu-IDM deleted the charles/issue24 branch September 7, 2022 20:46
celiot-IDM added a commit that referenced this pull request Sep 8, 2022
Addendum to #120: add start/end years to globalconfig.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work item Work item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants