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 warnings #453

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

Improve warnings #453

wants to merge 3 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

@@ -329,6 +329,12 @@ 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(any( mf_areas[["area_id"]] %in% unique(population_agesex$area_id) == FALSE)){
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(any( mf_areas[["area_id"]] %in% unique(population_agesex$area_id) == FALSE)){
if (!all(mf_areas[["area_id"]] %in% unique(population_agesex$area_id))) {

@@ -329,6 +329,12 @@ 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(any( mf_areas[["area_id"]] %in% unique(population_agesex$area_id) == FALSE)){
stop(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a translation for this error?

@@ -1,3 +1,7 @@
# naomi 2.10.2

* Improve warning generated when user fits model at admin level where no population data exists.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Improve warning generated when user fits model at admin level where no population data exists.
* Improve error generated when user fits model at admin level where no population data exists.

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