Skip to content

Conversation

@an-jung
Copy link
Collaborator

@an-jung an-jung commented Aug 7, 2025

Changes and Information

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

  • added LCT SECIR Model for 2 DISEASES on the basis of the LCT SECIR model

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

Closes #1294

@an-jung an-jung linked an issue Aug 7, 2025 that may be closed by this pull request
2 tasks
@an-jung an-jung added loc::backend This issue concerns the C++ backend implementation. model::lct Models using the linear chain trick labels Aug 7, 2025
@an-jung an-jung marked this pull request as ready for review August 7, 2025 12:00
@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.33%. Comparing base (0fce556) to head (fa35096).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1340      +/-   ##
==========================================
+ Coverage   97.26%   97.33%   +0.07%     
==========================================
  Files         184      186       +2     
  Lines       15807    16320     +513     
==========================================
+ Hits        15374    15885     +511     
- Misses        433      435       +2     

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

ScalarType tmax = 10;

// Set Parameters.
model.parameters.get<mio::lsecir2d::TimeExposed_a>()[0] = 3.;
Copy link
Member

@jubicker jubicker Aug 28, 2025

Choose a reason for hiding this comment

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

I'm not sure whether the naming of the parameters and also of infection states is the best choice. Maybe we should use longer but more self-speaking names, like TimeExposedDisease1,... and for infection states something like: InfectedNoSymptomsDisease1Naive and InfectedNoSymptomsDisease1RecoveredDisease2? Or is that too long? @annawendler what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I agree that the infection states are not that self-speaking but I also find the more explaining names really long and quite hard to read. I couldn't come up with a good compromise so I would go with the shorter names.

Copy link
Member

Choose a reason for hiding this comment

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

Regarding names of infection states, I thought of renaming Recovered_a to Recovered_1a and Recovered_ab to recovered_2ab to make it more explicit how many infections the individuals have gone through.

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.

First part of review

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.

In a recent commit the use of floating point types was reworked to allow for automatic differentiation. This also affected the LCT-SECIR model, e.g. we now have an additional template parameter FP for the model class. Can you adapt your model accordingly so that the models are consistent? If you have any questions just let us know :)

@mknaranja mknaranja changed the title 1294 add lct secir model with two disease strains 1294 add LCT SECIR model with two disease strains Sep 29, 2025
@mknaranja
Copy link
Member

@an-jung please use capitalization in github for shorthand notation such as LCT, SECIR, ...

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.

Remaining part of review. Looks good in general! The interact() function was a bit unclear to me, see questions below. Otherwise my comments are mainly regarding documentation

@an-jung an-jung requested a review from annawendler November 20, 2025 09:15
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 to me! :) I only have minor comments regarding naming of some variables.

"The template parameters Group1 & Group2 should be valid.");
using LctStateGroup1 = type_at_index_t<Group1, LctStates...>;
using LctStateGroup2 = type_at_index_t<Group2, LctStates...>;
FP InfectedNoSymptoms_Group2_a = 0;
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
FP InfectedNoSymptoms_Group2_a = 0;
FP infectedNoSymptoms_group2_a = 0;

Can you adjust the naming like this in the interact() function? According to our coding guidelines (https://memilio.readthedocs.io/en/latest/development.html#coding-guidelines) variables should use small letters. I know this isn't done 100% consistently throughout the code (such as N oder Ri_a) but here it also helps with consistency within the code of your model.

LctStateGroup2::template get_num_subcompartments<InfectionState::InfectedSymptoms_2b>())
.sum();
// Size of the subpopulation Group2 without dead people.
FP N_Group2 = pop.segment(first_index_group2, LctStateGroup2::Count).sum(); // Sum over all compartments.
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
FP N_Group2 = pop.segment(first_index_group2, LctStateGroup2::Count).sum(); // Sum over all compartments.
FP N_group2 = pop.segment(first_index_group2, LctStateGroup2::Count).sum(); // Sum over all compartments.

See above

N_Group2 = N_Group2 - pop.segment(LctStateGroup2::template get_first_index<InfectionState::Dead_a>(), 1).sum() -
pop.segment(LctStateGroup2::template get_first_index<InfectionState::Dead_b>(), 1)
.sum(); // All people minus dead people.
const FP div_N_Group2 = (N_Group2 < Limits<FP>::zero_tolerance()) ? 0.0 : 1.0 / N_Group2;
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
const FP div_N_Group2 = (N_Group2 < Limits<FP>::zero_tolerance()) ? 0.0 : 1.0 / N_Group2;
const FP div_N_group2 = (N_Group2 < Limits<FP>::zero_tolerance()) ? 0.0 : 1.0 / N_Group2;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

loc::backend This issue concerns the C++ backend implementation. model::lct Models using the linear chain trick

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add LCT SECIR model with two disease strains

5 participants