Skip to content

Commit

Permalink
1028 Reduce export_input_data_county_timeseries (#1029)
Browse files Browse the repository at this point in the history
- remove duplicated code in export_input_data_county_timeseries  
- rework structure of read in functions
- overwork doc in parameters_io files

Co-authored-by: lenaploetzke <70579874+lenaploetzke@users.noreply.github.com>
  • Loading branch information
HenrZu and lenaploetzke authored Sep 4, 2024
1 parent a1028b5 commit 30c59ab
Show file tree
Hide file tree
Showing 6 changed files with 800 additions and 946 deletions.
8 changes: 4 additions & 4 deletions cpp/models/ode_secir/parameters_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int get_region_id(int id)
}

IOResult<void> read_confirmed_cases_data(
std::string const& path, std::vector<ConfirmedCasesDataEntry>& rki_data, std::vector<int> const& vregion, Date date,
std::vector<ConfirmedCasesDataEntry>& rki_data, std::vector<int> const& vregion, Date date,
std::vector<std::vector<double>>& vnum_Exposed, std::vector<std::vector<double>>& vnum_InfectedNoSymptoms,
std::vector<std::vector<double>>& vnum_InfectedSymptoms, std::vector<std::vector<double>>& vnum_InfectedSevere,
std::vector<std::vector<double>>& vnum_icu, std::vector<std::vector<double>>& vnum_death,
Expand All @@ -74,12 +74,12 @@ IOResult<void> read_confirmed_cases_data(
});
if (max_date_entry == rki_data.end()) {
log_error("RKI data file is empty.");
return failure(StatusCode::InvalidFileFormat, path + ", file is empty.");
return failure(StatusCode::InvalidFileFormat, "RKI file is empty.");
}
auto max_date = max_date_entry->date;
if (max_date < date) {
log_error("Specified date does not exist in RKI data");
return failure(StatusCode::OutOfRange, path + ", specified date does not exist in RKI data.");
return failure(StatusCode::OutOfRange, "Specified date does not exist in RKI data.");
}
auto days_surplus = std::min(get_offset_in_days(max_date, date) - 6, 0);

Expand Down Expand Up @@ -277,4 +277,4 @@ read_population_data(const std::string& path, const std::vector<int>& vregion, b

#endif // MEMILIO_HAS_JSONCPP

GCC_CLANG_DIAGNOSTIC(pop)
GCC_CLANG_DIAGNOSTIC(pop)
Loading

0 comments on commit 30c59ab

Please sign in to comment.