Skip to content

Conversation

@HenrZu
Copy link
Contributor

@HenrZu HenrZu commented Dec 17, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • Load contact data based on Prem et al., 2017
  • Example ode_seir_contact_matrix_example.py runs a simulation for a specified country with real contact and population data
  • The contact matrices are available for around 90 countries.

If need be, add additional information and what the reviewer should look out for in particular:

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation within the code (Doxygen) for new functionality has been added in the code
  • Appropriate external documentation (ReadTheDocs) for new functionality has been added to the online documentation
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@HenrZu HenrZu linked an issue Dec 17, 2025 that may be closed by this pull request
2 tasks
@mknaranja mknaranja self-assigned this Dec 17, 2025
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.30%. Comparing base (7a332d8) to head (c9912e3).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1466      +/-   ##
==========================================
+ Coverage   97.29%   97.30%   +0.01%     
==========================================
  Files         186      187       +1     
  Lines       15961    16027      +66     
==========================================
+ Hits        15529    15595      +66     
  Misses        432      432              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

]


def _normalize_country_name(country: str):
Copy link
Member

Choose a reason for hiding this comment

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

why do these functions start with "_"?

Copy link
Contributor Author

@HenrZu HenrZu Dec 18, 2025

Choose a reason for hiding this comment

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

This is a convention in python that indicates that this function (or even a variabble) is only used internally in this file.

Copy link
Member

@mknaranja mknaranja left a comment

Choose a reason for hiding this comment

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

Thank you. Great addition. I went through it line by line with the debugger and checked here and there also for alternative if/else. I had some small comments + one bigger one for the aggregation of age groups.

I did not check if it works with a path provided and only briefly looked at the tests.

Comment on lines +197 to +200
for i, rows in enumerate(groups):
for j, cols in enumerate(groups):
block = matrix.values[np.ix_(rows, cols)]
aggregated.iat[i, j] = float(block.mean())
Copy link
Member

Choose a reason for hiding this comment

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

I think this is not correct. First, the rows (or columns; depending on the orientation from-to) should be multiplied with the group size (0-4: x, 5-14: y, ...). Then you can add and eventually you divide by the sum of x+y... Right?

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.

Generic country specific simulation

3 participants