Skip to content

Conversation

@hatrit
Copy link
Member

@hatrit hatrit commented Aug 1, 2024

Changes and Information

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

  • Added the possibility to use age groups in the IDE-SECIR model
  • m_transitions is still a TimeSeries but at each time step we now store a vector of size number num_transitions * num_agegroups.
  • In order to find the right index in this TimeSeries the function get_transition_flat_index was added.
  • m_populationss is still a TimeSeries but at each time step we now store a vector of size number num_infectionstates * num_agegroups.
  • In order to find the right index in this TimeSeries the function get_state_flat_index was added.
  • m_N, m_forceofinfection, m_total_confirmed_cases are now vectors of size num_agegroups.
  • TransitionDistributions, TransitionProbabilities, TransmissionProbabilityOnContact, RelativeTransmissionNoSymptoms, RiskOfInfectionFromSymptomatic are now CustomIndexArrays.
  • In model.cpp we compute the transtions and compartments for each age group separately. The computation of the force_of_infection was adapted to account for the age resolution.
  • Added an example using two age groups.
  • The test ide_secir.cpp still tests the same things as before and uses only one age group.
  • Added the test file test_ide_secir_ageres.cpp where a test to compare with previous run is implemented.
  • Changed the test file test_ide_secir_parameters_io.cpp. We now use the data from cases_all_age_ma7.json, therefore we are using 6 age groups.

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

Closes #379

@hatrit hatrit requested a review from annawendler August 1, 2024 12:25
@hatrit hatrit linked an issue Aug 1, 2024 that may be closed by this pull request
3 tasks
Copy link
Member

@annawendler annawendler left a comment

Choose a reason for hiding this comment

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

Very nice work, this already looks really good! :)

Some things I noticed:

  • When building I got an error for the ide_initialization_example. I think you haven't updated this yet?
  • Also, the test when comparing with the previous runs are failing. I think you need to push the updated csv files.
  • In the documentation I noticed that you often write Age Group and Infection Transition. We usually use the name of the class directly, i.e. AgeGroup and InfectionTransition. I remarked this in some cases but can you check this?

In the mean time there were some changes in the main in parameters_io. Can you merge the main branch into this branch and adapt the changes with respect to age groups? I think this shouldn't be too much.

I noticed that for SAFWrapper you added a constructor without any input. I will think about if there is another option without this. I also will look into the set function for the parameters.

If you have any questions, let me know and we can discuss it :)

@annawendler
Copy link
Member

I think there is no problem with using the getter instead of the setter when setting the parameters.

@annawendler
Copy link
Member

We should prevent that we are dividing by 0 when computing the force of infection if the population in some age groups is 0. For this we can make use of the solution that was implemented in #1104 for the ODE model.

@hatrit hatrit requested a review from annawendler November 5, 2024 09:26
@codecov
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.02%. Comparing base (0962eb0) to head (c888784).
Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1083      +/-   ##
==========================================
+ Coverage   96.59%   97.02%   +0.43%     
==========================================
  Files         137      142       +5     
  Lines       11057    12016     +959     
==========================================
+ Hits        10680    11658     +978     
+ Misses        377      358      -19     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@annawendler annawendler 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 for your revision. I made some comments, mainly regarding types and naming.

What still needs some work in my opinion is whether the group variable is used as AgeGroup or as size_t in the methods in model.cpp. This is not consistent, e.g. get_transition_flat_index() takes size_t as input parameter and compute_compartment_from_flows() takes an AgeGroup. I would suggest to always use the same type for all functions so that type conversions when calling the functions can be avoided.

Regarding the question whether AgeGroup or size_t should be the default type: One problem is that, currently, we need AgeGroup when calling parameters and size_t when calling vectors such as m_transitiondistributions_support_max. By defining these vectors as CustomIndexArray (instead of the outer std::vector) we could use an AgeGroup when referring to this vector thus leading to less type conversions.

@hatrit hatrit requested a review from annawendler November 28, 2024 13:45
@annawendler annawendler changed the title 379 implement ide model with age resolution 379 implement IDE model with age resolution Nov 29, 2024
Copy link
Member

@annawendler annawendler 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 for your adaptations! I found some leftover inconsistencies regarding the types of input parameters for the member functions. Can you adapt this?

Another thing I noticed (sorry for not noticing earlier) is that the added files are quite big which makes the whole repo bigger which is undesirable e.g. as it takes longer to download. One way to avoid these additional files is to define a vector in the test directly that e.g. contains the results at the last time point and then only compare the results for the last time point. I made some suggestions in the code in test_ide_secir_ageres.cpp on how to do this. Can you adapt the tests for this? I also noticed that the file "ide-parameters-io-compare.csv" is not used anymore. Can you delete this file as well as the newly added files?

Otherwise I think this PR looks good and can be merged after these changes :)

@hatrit hatrit requested a review from annawendler December 5, 2024 10:44
Copy link
Member

@annawendler annawendler left a comment

Choose a reason for hiding this comment

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

I have some final remarks regarding the tests.

@hatrit hatrit requested a review from annawendler December 12, 2024 07:56
Copy link
Member

@annawendler annawendler 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!

@annawendler annawendler merged commit c78bafd into main Dec 12, 2024
58 checks passed
@annawendler annawendler deleted the 379-implement-ide-model-with-age-resolution branch December 12, 2024 11:53
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.

Implement IDE model with age resolution

3 participants