Use per-capita contacts in contact_basis - #283
Open
RasmusSkytte wants to merge 6 commits into
Open
Conversation
RasmusSkytte
force-pushed
the
feature/DiseasyActivity-store-per-capita-contacts
branch
4 times, most recently
from
August 12, 2026 11:51
4ab41d6 to
a6c99bf
Compare
5 tasks
RasmusSkytte
force-pushed
the
feature/DiseasyActivity-store-per-capita-contacts
branch
from
August 13, 2026 09:03
0ebc528 to
9c74f45
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
==========================================
- Coverage 66.09% 64.22% -1.88%
==========================================
Files 28 28
Lines 4643 9586 +4943
==========================================
+ Hits 3069 6157 +3088
- Misses 1574 3429 +1855 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RasmusSkytte
marked this pull request as ready for review
August 13, 2026 12:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Currently we perform the age group remapping from the contact matrix age groups to the model age groups in
DiseasyActivity.However, since the population is now primarily being handled in
DiseasyPopulationwhich has access to both the model demography and model age groups, this is a more fitting place for this age handling to occur.To migrate the age handling from
DiseasyActivitytoDiseasyPopulation, the first step is to make the contact matrices inDiseasyActivityagnostic to the original demography used to compute the matrices.Approach
Contact matrices now saved as the per-capita contact rates ("C" domain) instead of the current mean contact rate ("M" domain).
This removes the need to store the original demography used to compute the contact matrices.
This data is still kept, but it paves the way to fully remove this demography when we migrate age handling to
DiseasyPopulation.Contacts returned from
DiseasyActivity$get_scenario_contacts()are now also per-capita, andDiseasyActivity$rescale_rates_to_counts()is modified so the output is still C*N.Known issues
N/A
Checklist
NEWS.md