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

Don't load a population rates sheet during initialization. #61

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

celiot-IDM
Copy link
Collaborator

This is the first small step towards integrating the new population rates format.

In this step we turn off the initial read of the PopValues sheet. This could have been done a while ago, because the population rates sheet for a given Scenario is defined in the Scenario record, and is loaded when the Scenario is actually run.

@celiot-IDM celiot-IDM requested a review from MeWu-IDM July 30, 2022 19:12
@MeWu-IDM
Copy link
Collaborator

MeWu-IDM commented Aug 1, 2022

@celiot-IDM this change looks safe to merge, could you point me to the code where the population rates are loaded so I can take a close look there? thanks

@celiot-IDM
Copy link
Collaborator Author

@celiot-IDM this change looks safe to merge, could you point me to the code where the population rates are loaded so I can take a close look there? thanks

The population change rates are loaded by the SaveBaseSettings() function, in ehep_exp_control.R.

Here are the operative lines:

` # Load Population change parameter data from the appropriate Excel sheet, as specified in the Scenarios sheet.

popValsSheet <- BVE$scenario$sheet_PopValues

if (!is.blank(popValsSheet)){
GPE$populationChangeParameters <- loadPopulationChangeParameters(popValsSheet)
} else {
GPE$populationChangeParameters <- loadPopulationChangeParameters()
}

if (!is.null(GPE$populationChangeParameters)) {
BVE$populationChangeParameters <- GPE$populationChangeParameters
}
`
(BTW This little dance where the sheet is loaded into the GPE environment (GPE = "global package environment") then copied into the BVE environment (BVE = "baseline values environment") is an artifact from when the input sheets were all loaded at startup into the GPE environment. The next phase of tidying will be to load the input sheet values directly into the BVE environment.)

@MeWu-IDM MeWu-IDM merged commit ab8ad0d into main Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants