Skip to content

Update warnings to be more helpful to users after 2026 Naomi estimates#485

Open
rtesra wants to merge 2 commits into
masterfrom
improve-warning-2026-debugs
Open

Update warnings to be more helpful to users after 2026 Naomi estimates#485
rtesra wants to merge 2 commits into
masterfrom
improve-warning-2026-debugs

Conversation

@rtesra

@rtesra rtesra commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator
  • Improve error message when population data area level does not match the
    model area_level option. Previously this caused a non-informative
    stopifnot(!is.na(mf_model[["population_t1"]])) failure; now the error
    names both the model level and the population data level. (ETH, Debug 43)
  • Improve ART duplicate-record error in artnum_mf(). Previously the error
    named model-level aggregated areas (which could mislead users to check the
    wrong rows); now it reports the exact input area_id, area name, age group,
    sex, quarter, and duplicate count for each offending row. (ETH, Debug 44)
  • Add validation in select_naomi_data() to detect when ANC already-on-ART
    counts exceed total ANC positives. Previously this produced implausible ART
    coverage values or a non-informative downstream error; now it stops early
    with the affected area, area name, and year. (RWA, Debug 28)

@rtesra
rtesra requested review from jeffeaton and r-ash and removed request for r-ash June 29, 2026 16:38

@r-ash r-ash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good, I'm happy to merge this after we fix the build errors. I'll look into those errors, something failing when building the qs package which is a bit frustrating.

We should definitely check these messages display ok in the app once it is deployed. I think it should be fine, but we should check as they use lots of special characters for formatting the display.

)
expect_error(
artnum_mf("CY2017Q4", art_with_dups, a_naomi_mf),
"MWI_4_1_demo (Chitipa) | Y000_014 | sex=both | CY2017Q4 | n=2 records"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, I like the |, I think they are a bit clearer than what we've tried before when raising errors about rows of data.

@r-ash
r-ash force-pushed the improve-warning-2026-debugs branch from 28eac41 to 98a1316 Compare July 1, 2026 13:13
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