Skip to content

Split hcAG_coarse into total and disaggregated data structures#354

Merged
r-ash merged 7 commits into
mainfrom
issue-351
Jul 3, 2026
Merged

Split hcAG_coarse into total and disaggregated data structures#354
r-ash merged 7 commits into
mainfrom
issue-351

Conversation

@r-ash

@r-ash r-ash commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Closes #351

This will make it more consistent with inputs in the adult model.

Ignore the goals tests for now, fixing those will require an update to Spectrum reading code to supply new split data, I'll get that updated once this is in.

r-ash added 2 commits June 25, 2026 10:58
This will make it more consistent with inputs in the adult model.
@r-ash r-ash requested review from jeffeaton and mwalte10 June 25, 2026 10:13
"hc2AG": 5,
"hcAG_coarse": 3,
"hc_age_coarse": [1, 1, 1, 1, 1, 2, 2, 2, 2, 2],
"hcAG_c": 2,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@jeffeaton making this change to drop hcAG_coarse and use hcAG_c instead suggests me that this should be 2 here? But that was not in your original changes.

This is only used for hc_nosocomial_infections which is indexed using hc_age_coarse so it was fine. Updating this should just mean that drops an unused row from hc_nosocomial_infections when age10_adult is true.

@mwalte10 mwalte10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have a few suggestions of edge cases to check as i remember when coding this I would get the code to work in one pattern of ART entries and then it would instantly break.

Would be good to test that this survives if you:
go from 0-14 number entry to age disaggregate number entry
age disaggregate numer entry to 0-14% entry.
Those two patterns are what the vast majority of spectrum files will have.

Comment thread leapfrog-core/include/models/child_model_simulation.hpp
Comment thread leapfrog-core/include/models/child_model_simulation.hpp
Comment thread leapfrog-core/include/models/child_model_simulation.hpp Outdated
Comment thread leapfrog-core/include/models/child_model_simulation.hpp Outdated
Comment thread leapfrog-core/include/models/child_model_simulation.hpp Outdated
Comment thread leapfrog-core/include/models/child_model_simulation.hpp
Comment thread leapfrog-core/include/models/child_model_simulation.hpp
Comment thread leapfrog-core/include/models/child_model_simulation.hpp
Comment thread leapfrog-core/include/models/child_model_simulation.hpp
Comment thread leapfrogr/R/process_pjnz_hc.R
Comment thread leapfrog-core/model_schemas/configs/HcConfig.json Outdated
Comment thread leapfrog-core/model_schemas/configs/HcConfig.json Outdated
@r-ash

r-ash commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

I have a few suggestions of edge cases to check as i remember when coding this I would get the code to work in one pattern of ART entries and then it would instantly break.

Would be good to test that this survives if you: go from 0-14 number entry to age disaggregate number entry age disaggregate numer entry to 0-14% entry. Those two patterns are what the vast majority of spectrum files will have.

Thanks Maggie, I tested this by creating a file with the following child ART input:

  1. number -> percent (year 2022)
  2. percent -> number (year 2017 and 2021)
  3. number -> number age disaggregated (2018)
  4. % -> number age disaggregated (2030)
  5. number age disaggregated -> number (2031)
  6. number age disaggregated -> % (2019)

And I could see this was breaking when t-1 was a non-age specific year as we we're only accumulating from the age disaggregated and not the total.

I've now fixed this and in comparing between this branch and current main the numbers agree up to floating point precision. So I think safe that this PR does not alter the calculations.

@r-ash r-ash requested a review from mwalte10 July 1, 2026 08:48

@mwalte10 mwalte10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

@r-ash r-ash merged commit 8130473 into main Jul 3, 2026
14 of 20 checks passed
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.

Review joined total and disaggregated inputs in child model

2 participants