Skip to content

1274 normalizing of exposure rate#1322

Merged
reneSchm merged 11 commits intomainfrom
1274-normalizing-of-exposure-rate
Oct 28, 2025
Merged

1274 normalizing of exposure rate#1322
reneSchm merged 11 commits intomainfrom
1274-normalizing-of-exposure-rate

Conversation

@DavidKerkmann
Copy link
Member

@DavidKerkmann DavidKerkmann commented Jul 22, 2025

Changes and Information

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

  • Adds a cache for the number of persons per cell and age group.
  • Uses this cache to normalize the exposure rate according to the number of persons inside a cell.

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 for new functionality has been added (Doxygen in the code and explanations in 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).

@DavidKerkmann DavidKerkmann changed the title First draft of normalized exposure rate 1274-normalizing-of-exposure-rate Jul 22, 2025
@DavidKerkmann DavidKerkmann marked this pull request as draft July 22, 2025 11:11
@DavidKerkmann DavidKerkmann linked an issue Jul 22, 2025 that may be closed by this pull request
2 tasks
@DavidKerkmann DavidKerkmann changed the title 1274-normalizing-of-exposure-rate 1274 normalizing of exposure rate Jul 22, 2025
@DavidKerkmann DavidKerkmann requested a review from reneSchm July 31, 2025 08:37
@DavidKerkmann DavidKerkmann marked this pull request as ready for review July 31, 2025 08:37
@codecov
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.24%. Comparing base (2defe8b) to head (c8af250).
⚠️ Report is 28 commits behind head on main.

Files with missing lines Patch % Lines
cpp/models/abm/model.cpp 89.47% 2 Missing ⚠️
cpp/models/abm/model.h 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1322      +/-   ##
==========================================
- Coverage   97.37%   97.24%   -0.13%     
==========================================
  Files         174      176       +2     
  Lines       15024    15517     +493     
==========================================
+ Hits        14630    15090     +460     
- Misses        394      427      +33     

☔ 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.

@DavidKerkmann
Copy link
Member Author

DavidKerkmann commented Jul 31, 2025

Performance benchmarks:

Main:

----------------------------------------------------------------------------------
Benchmark                                        Time             CPU   Iterations   
----------------------------------------------------------------------------------   
abm_benchmark/abm_benchmark_50k               3385 ms         3344 ms            1   
abm_benchmark/abm_benchmark_50k               3295 ms         3297 ms            1   
abm_benchmark/abm_benchmark_50k               3263 ms         3266 ms            1   
abm_benchmark/abm_benchmark_50k               2805 ms         2812 ms            1   
abm_benchmark/abm_benchmark_50k               2678 ms         2672 ms            1   
abm_benchmark/abm_benchmark_50k_mean          3085 ms         3078 ms            5   
abm_benchmark/abm_benchmark_50k_median        3263 ms         3266 ms            5   
abm_benchmark/abm_benchmark_50k_stddev         320 ms          312 ms            5   
abm_benchmark/abm_benchmark_50k_cv           10.38 %         10.13 %             5   
abm_benchmark/abm_benchmark_100k              5681 ms         5656 ms            1
abm_benchmark/abm_benchmark_100k              5543 ms         5547 ms            1   
abm_benchmark/abm_benchmark_100k              5661 ms         5641 ms            1   
abm_benchmark/abm_benchmark_100k              5646 ms         5625 ms            1   
abm_benchmark/abm_benchmark_100k              5558 ms         5562 ms            1   
abm_benchmark/abm_benchmark_100k_mean         5618 ms         5606 ms            5   
abm_benchmark/abm_benchmark_100k_median       5646 ms         5625 ms            5   
abm_benchmark/abm_benchmark_100k_stddev       62.8 ms         48.7 ms            5   
abm_benchmark/abm_benchmark_100k_cv           1.12 %          0.87 %             5   
abm_benchmark/abm_benchmark_200k             11441 ms        11422 ms            1
abm_benchmark/abm_benchmark_200k             11210 ms        11203 ms            1   
abm_benchmark/abm_benchmark_200k             11385 ms        11391 ms            1   
abm_benchmark/abm_benchmark_200k             11394 ms        11391 ms            1   
abm_benchmark/abm_benchmark_200k             11263 ms        11250 ms            1   
abm_benchmark/abm_benchmark_200k_mean        11338 ms        11331 ms            5   
abm_benchmark/abm_benchmark_200k_median      11385 ms        11391 ms            5   
abm_benchmark/abm_benchmark_200k_stddev       97.3 ms         97.8 ms            5   
abm_benchmark/abm_benchmark_200k_cv           0.86 %          0.86 %             5

This branch:

----------------------------------------------------------------------------------
Benchmark                                        Time             CPU   Iterations
----------------------------------------------------------------------------------
abm_benchmark/abm_benchmark_50k               2811 ms         2812 ms            1
abm_benchmark/abm_benchmark_50k               2807 ms         2797 ms            1
abm_benchmark/abm_benchmark_50k               2811 ms         2812 ms            1
abm_benchmark/abm_benchmark_50k               2829 ms         2828 ms            1
abm_benchmark/abm_benchmark_50k               2869 ms         2875 ms            1
abm_benchmark/abm_benchmark_50k_mean          2826 ms         2825 ms            5
abm_benchmark/abm_benchmark_50k_median        2811 ms         2812 ms            5
abm_benchmark/abm_benchmark_50k_stddev        25.8 ms         30.1 ms            5
abm_benchmark/abm_benchmark_50k_cv            0.91 %          1.06 %             5
abm_benchmark/abm_benchmark_100k              5884 ms         5891 ms            1
abm_benchmark/abm_benchmark_100k              6169 ms         6156 ms            1
abm_benchmark/abm_benchmark_100k              5948 ms         5953 ms            1
abm_benchmark/abm_benchmark_100k              6141 ms         6141 ms            1
abm_benchmark/abm_benchmark_100k              5919 ms         5906 ms            1
abm_benchmark/abm_benchmark_100k_mean         6012 ms         6009 ms            5
abm_benchmark/abm_benchmark_100k_median       5948 ms         5953 ms            5
abm_benchmark/abm_benchmark_100k_stddev        133 ms          129 ms            5
abm_benchmark/abm_benchmark_100k_cv           2.21 %          2.15 %             5
abm_benchmark/abm_benchmark_200k             11953 ms        11938 ms            1
abm_benchmark/abm_benchmark_200k             12382 ms        12359 ms            1
abm_benchmark/abm_benchmark_200k             11937 ms        11906 ms            1
abm_benchmark/abm_benchmark_200k             11564 ms        11562 ms            1
abm_benchmark/abm_benchmark_200k             11668 ms        11656 ms            1
abm_benchmark/abm_benchmark_200k_mean        11901 ms        11884 ms            5
abm_benchmark/abm_benchmark_200k_median      11937 ms        11906 ms            5
abm_benchmark/abm_benchmark_200k_stddev        317 ms          310 ms            5
abm_benchmark/abm_benchmark_200k_cv           2.67 %          2.61 %             5

Copy link
Member

@reneSchm reneSchm left a comment

Choose a reason for hiding this comment

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

Nice addition! There is only one issue with the normalization in build_exposure_caches, that makes it possible to use uninitialized population caches through Model::interact.
The other requests are only minor adjustments.

DavidKerkmann and others added 2 commits October 27, 2025 16:46
Co-authored-by: reneSchm <49305466+reneSchm@users.noreply.github.com>
@reneSchm reneSchm merged commit cff9ccb into main Oct 28, 2025
55 of 57 checks passed
@reneSchm reneSchm deleted the 1274-normalizing-of-exposure-rate branch October 28, 2025 06:56
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.

Normalizing of exposure rate

2 participants