Skip to content

Conversation

@khoanguyen-dev
Copy link
Member

@khoanguyen-dev khoanguyen-dev commented Dec 18, 2023

Changes and Information

Please briefly list the changes made, additional Information and what the Reviewer should look out for:

  • Renaming age group variables to use lower-case letters, so they do not look like macros.
  • Changing value assignment from AgeGroup(num_age_groups - n) to simply AgeGroup(n).
  • Add check to functions that use AgeGroup as parameters

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
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results

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 and code coverage 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.)

closes #846

@khoanguyen-dev khoanguyen-dev linked an issue Dec 18, 2023 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c469590) 95.45% compared to head (c168549) 95.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #871   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files         118      118           
  Lines        9263     9269    +6     
=======================================
+ Hits         8842     8848    +6     
  Misses        421      421           

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

Copy link
Member

@xsaschako xsaschako left a comment

Choose a reason for hiding this comment

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

Looks good!

@xsaschako xsaschako merged commit 8ed8364 into main Dec 20, 2023
@xsaschako xsaschako deleted the 846-adjust-naming-and-assignment-of-abm-age-groups branch December 20, 2023 11:51
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.

The name changes are great, but the asserts need to be fixed. I added suggestions only to a few, since several are very similar.

mio::abm::InfectionState infection_state, mio::abm::TimePoint t,
mio::abm::Parameters params)
{
assert((size_t)age.size < (size_t)params.get_num_groups());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert((size_t)age.size < (size_t)params.get_num_groups());
assert(age.get() < params.get_num_groups());

mio::abm::Person& add_test_person(mio::abm::World& world, mio::abm::LocationId loc_id, mio::AgeGroup age,
mio::abm::InfectionState infection_state, mio::abm::TimePoint t)
{
assert((size_t)age.size < (size_t)world.parameters.get_num_groups());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert((size_t)age.size < (size_t)world.parameters.get_num_groups());
assert(age.get() < world.parameters.get_num_groups());

@xsaschako
Copy link
Member

I opened #873 and will merge this asap with rene

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.

adjust naming and assignment of ABM age groups

4 participants