Skip to content

Conversation

@HenrZu
Copy link
Contributor

@HenrZu HenrZu commented Sep 29, 2025

Changes and Information

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

  • Implement influenza model from doi.org/10.1186/s12879-017-2344-6 into our framework
  • Add flowchart and rtd documentation

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 Sep 29, 2025 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.29%. Comparing base (a1d8af8) to head (c3f4136).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1387    +/-   ##
========================================
  Coverage   97.28%   97.29%            
========================================
  Files         175      177     +2     
  Lines       15306    15422   +116     
========================================
+ Hits        14891    15005   +114     
- Misses        415      417     +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.

@HenrZu HenrZu requested a review from annawendler October 6, 2025 21:10
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 really good! :) Most of my comments are regarding naming of variables/parameters where I made some suggestions.

#include "memilio/utils/logging.h"

/**
* @brief set_initial_population sets the initial population of the model
Copy link
Member

Choose a reason for hiding this comment

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

The description of the parameters is missing

auto& parameters = model.parameters;

FP cont_freq = 10.0;
FP fact = FP(1) / FP(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.

What is this factor for?

Please cite the original study if you use this model:

> Weidemann, F., Remschmidt, C., Buda, S. et al. *Is the impact of childhood influenza vaccination less than expected: a transmission modelling study.* **BMC Infect Dis** 17, 258 (2017).
> https://doi.org/10.1186/s12879-017-2344-6
Copy link
Member

Choose a reason for hiding this comment

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

Can you link the read the docs documentation and the example here?

#include "ode_seirv/parameters.h"

GCC_CLANG_DIAGNOSTIC(push)
GCC_CLANG_DIAGNOSTIC(ignored "-Wshadow")
Copy link
Member

Choose a reason for hiding this comment

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

Where does this warning appear?

// Contact matrices
const auto cm_h_expr =
params.template get<ContactPatternsHealthy<FP>>().get_cont_freq_mat().get_matrix_at(SimulationTime<FP>(t));
const auto cm_s_expr =
Copy link
Member

Choose a reason for hiding this comment

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

Do you use cm_h_expr and cm_s_expr anywhere else or just below? If not, I would define H and S directly.

const double lambda = (I + IV) / N; // expected force of infection
const double f_SE = S * lambda;
const double f_SV_EV = SV * lambda;
const double f_E_I = E; // gamma * E
Copy link
Member

Choose a reason for hiding this comment

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

Since gamma=1 this is correct but I would find it easier to understand if you wrote f_E_I = gamma*E here and below

auto idx_EI =
model.template get_flat_flow_index<mio::oseirv::InfectionState::Exposed, mio::oseirv::InfectionState::Infected>(
mio::AgeGroup(0));
auto idx_EVI =
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
auto idx_EVI =
auto idx_EIV =

More intuitive? Or EVIV? Same below.

{
mio::oseirv::Model<double> model(2);
mio::ContactMatrixGroup<ScalarType>& cm_h = model.parameters.get<mio::oseirv::ContactPatternsHealthy<double>>();
// Each group only contacts itself so that λ_i = I_i / N_i
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
// Each group only contacts itself so that λ_i = I_i / N_i
// Let each group have only contacts with itself and set other parameters so that λ_i = I_i / N_i

model.parameters.set<mio::oseirv::SeasonalityAmplitude<double>>(0.0);
model.parameters.set<mio::oseirv::OutsideFoI<double>>(0.0);

// Group 0
Copy link
Member

Choose a reason for hiding this comment

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

I would find a comment helpful that you in particular have no vaccinated individuals and thus only one layer

}
}

TEST(TestOdeSeirv, flowSimulation)
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
TEST(TestOdeSeirv, flowSimulation)
TEST(TestOdeSeirv, flowSimulationEuler)

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 influenza model

2 participants