Skip to content

Conversation

@MaxBetzDLR
Copy link
Member

@MaxBetzDLR MaxBetzDLR commented Nov 24, 2025

Changes and Information

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

  • Rework current structure to be more flexible and similar between models
  • Define functions for each type of epidata setter, that works on a single region
  • Use graph for setting epidata

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

@MaxBetzDLR MaxBetzDLR requested a review from HenrZu November 24, 2025 09:35
@MaxBetzDLR MaxBetzDLR self-assigned this Nov 24, 2025
@MaxBetzDLR MaxBetzDLR added the class::improvement Cleanup that doesn't affect functionality label Nov 24, 2025
@MaxBetzDLR MaxBetzDLR linked an issue Nov 24, 2025 that may be closed by this pull request
2 tasks
@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 94.48560% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.30%. Comparing base (edb7428) to head (d6f9906).

Files with missing lines Patch % Lines
cpp/models/ode_secirts/parameters_io.h 56.14% 25 Missing ⚠️
cpp/models/ode_secirvvs/parameters_io.cpp 97.11% 13 Missing ⚠️
cpp/models/ode_secirts/parameters_io.cpp 97.50% 10 Missing ⚠️
cpp/models/ode_secirvvs/parameters_io.h 82.69% 9 Missing ⚠️
cpp/models/ode_secir/parameters_io.cpp 96.36% 8 Missing ⚠️
cpp/memilio/io/parameters_io.cpp 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1430      +/-   ##
==========================================
- Coverage   97.31%   97.30%   -0.01%     
==========================================
  Files         187      187              
  Lines       16018    15820     -198     
==========================================
- Hits        15588    15394     -194     
+ Misses        430      426       -4     

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

Copy link
Contributor

@HenrZu HenrZu left a comment

Choose a reason for hiding this comment

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

Great addition :)
Most of my comments are minor. When fixing them, please keep in mind that they often affect other models as well.
What still concerns me yet is the new h5 file. Have you tried with h5dump to see exactly what has changed? And to what extend?


StateId get_state_id(int county)
{
// integer division
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// integer division


struct EpidataFilenames {
private:
EpidataFilenames(std::string& pydata)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
EpidataFilenames(std::string& pydata)
EpidataFilenames(const std::string& pydata)

same for the others below

namespace de
{

struct EpidataFilenames {
Copy link
Contributor

Choose a reason for hiding this comment

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

add a documentation above the struct


s.case_data_path = mio::path_join(pydata, "cases_all_state_age_ma7.json");
s.divi_data_path = mio::path_join(pydata, "state_divi_ma7.json");
s.vaccination_data_path = mio::path_join(pydata, "vacc_state_ageinf_ma7.json");
Copy link
Contributor

Choose a reason for hiding this comment

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

the vaccination data is the same for states and county. intended? if yes, add a comment.

{
}

public:
Copy link
Contributor

Choose a reason for hiding this comment

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

overall, this is all very static. At least the moving average should be adaptive.
use sth like:
std::string ma_suffix = "_ma" + std::to_string(moving_average) + ".json";
in combination with default moving_average=7.

{
BOOST_OUTCOME_TRY(auto&& case_data, mio::read_confirmed_cases_data(path));

// sort case_data into regions and ignore once with no region associated
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// sort case_data into regions and ignore once with no region associated
// sort case_data into regions and ignore ones with no region associated

please also correct in sceir and secirvvs

}
model.populations[{AgeGroup(i), InfectionState::SusceptibleImprovedImmunity}] = num_rec[i];
if (set_death) {
// in set_confirmed_cases_data initilization, deaths are now set to 0. In order to visualize
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// in set_confirmed_cases_data initilization, deaths are now set to 0. In order to visualize
// in set_confirmed_cases_data initialization, deaths are now set to 0. In order to visualize

also use search + replace

ASSERT_EQ(vacc_data[1].num_vaccinations_refreshed_additional, 3.0);
}

TEST(TestEpiData, set_vaccination_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not reuse this test in the secirts test file?

TEST(TestGraph, set_nodes_secir)
{

mio::osecir::Parameters<double> params(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

why delete?

* @param[in] end_date Date at the end of the simulation.
*/
template <class FP, class Model, class ContactPattern>
void set_german_holidays(const mio::VectorRange<Node<Model>>& nodes, const mio::Date& start_date,
Copy link
Contributor

Choose a reason for hiding this comment

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

in generell, we should try to keep this generic and add a overall function set_holidays which allows a country specifier e.g., for Germany.
however, since we only have data for germany at this moment, this is ok :)

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

Labels

class::improvement Cleanup that doesn't affect functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve parameters IO for graph ODE-based models

4 participants