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

Improve population error #453

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Improve population error #453

wants to merge 9 commits into from

Conversation

rtesra
Copy link
Collaborator

@rtesra rtesra commented Nov 19, 2024

Generate more informative warning when user select area level to generate model estimates for which population data is not available

@rtesra rtesra requested review from jeffeaton and r-ash November 19, 2024 13:46
R/model.R Outdated Show resolved Hide resolved
R/model.R Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
"for model projections. Please review model options",
"selection to ensure that area level selection is correct.")
)
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the error message here quote the area level and area level label selected?

"Population data not available for selected area level 3 (District). Pleas review model options"

Also I'm think I would remove the "for model projections". We usually use "projections" to refer to the T3/T4/T5 projection, but here this area level selection pertains to everything.

@@ -329,6 +329,10 @@ naomi_model_frame <- function(area_merged,
## of a Spectrum file and then calibrated. Currently no way to know if areas
## comparise only part of a Spectrum file, so can't address.

if (!all(mf_areas[["area_id"]] %in% unique(population_agesex$area_id))) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the error message is about the area level selected, why is the conditional here referring to the area IDs (not the area level)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't area level available in the population data to easier to check that these intersect and then pull that in if they don't for the error message if needed

@rtesra rtesra changed the title Improve warnings Improve population error Nov 29, 2024
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.

3 participants