Skip to content

Commit db7d684

Browse files
committed
Update tests with big fixes
1 parent 0d2adcf commit db7d684

18 files changed

+572
-5464
lines changed

cpp/memilio/mobility/graph.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ class Graph
153153
using NodeProperty = NodePropertyT;
154154
using EdgeProperty = EdgePropertyT;
155155

156-
/** add note for same size of parameters
157-
*/
158-
Graph(const std::vector<int>& node_ids, std::vector<NodePropertyT>& node_properties)
156+
Graph(const std::vector<int>& node_ids, const std::vector<NodePropertyT>& node_properties)
159157
{
160158
assert(node_ids.size() == node_properties.size());
161159

cpp/models/ode_secirvvs/parameters_io.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ IOResult<void> set_divi_data(const mio::VectorRange<Node<Model<ScalarType>>>& mo
703703

704704
IOResult<void> read_input_data(const mio::VectorRange<Node<Model<ScalarType>>>& model, Date date,
705705
const std::vector<ScalarType>& scaling_factor_inf, ScalarType scaling_factor_icu,
706-
int num_days, const mio::regions::de::EpidataFilenames& epidata_filenames)
706+
int num_days, const mio::regions::de::EpidataFilenames& epidata_filenames,
707+
bool set_death)
707708
{
708709

709710
BOOST_OUTCOME_TRY(
@@ -714,7 +715,7 @@ IOResult<void> read_input_data(const mio::VectorRange<Node<Model<ScalarType>>>&
714715
BOOST_OUTCOME_TRY(details::set_divi_data(model, epidata_filenames.divi_data_path, date, scaling_factor_icu));
715716

716717
BOOST_OUTCOME_TRY(
717-
details::set_confirmed_cases_data(model, epidata_filenames.case_data_path, date, scaling_factor_inf));
718+
details::set_confirmed_cases_data(model, epidata_filenames.case_data_path, date, scaling_factor_inf, set_death));
718719
BOOST_OUTCOME_TRY(details::set_population_data(model, epidata_filenames.population_data_path,
719720
epidata_filenames.case_data_path, date));
720721
return success();
@@ -739,7 +740,7 @@ IOResult<void> export_input_data_timeseries(const mio::VectorRange<Node<Model<Sc
739740

740741
// TODO: empty vaccination data path guard
741742
BOOST_OUTCOME_TRY(
742-
read_input_data(model, offset_day, scaling_factor_inf, scaling_factor_icu, num_days, epidata_filenames));
743+
read_input_data(model, offset_day, scaling_factor_inf, scaling_factor_icu, num_days, epidata_filenames, true));
743744

744745
for (size_t r = 0; r < model.size(); r++) {
745746
extrapolated_data[r][t] = model[r].property.get_initial_values();

cpp/models/ode_secirvvs/parameters_io.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ IOResult<void> set_confirmed_cases_data(Model<ScalarType>& model, const std::vec
9696
* @param[in] path Path to the confirmed cases data file.
9797
* @param[in] date Date at which the data is read.
9898
* @param[in] scaling_factor_inf Factors by which to scale the confirmed cases of rki data.
99-
* @param set_death[in] If true, set the number of deaths.
99+
* @param[in] set_death If true, set the number of deaths.
100100
*/
101101
IOResult<void> set_confirmed_cases_data(const mio::VectorRange<Node<Model<ScalarType>>>& model, const std::string& path,
102102
Date date, const std::vector<ScalarType>& scaling_factor_inf,
@@ -334,12 +334,14 @@ IOResult<void> set_vaccination_data(const mio::VectorRange<Node<Model<FP>>>& mod
334334
* @param[in] scaling_factor_icu Scaling factor for ICU cases.
335335
* @param[in] num_days Number of days to simulate.
336336
* @param[in] epidata_filenames Object containing the input data file paths.
337+
* @param[in] set_death If true, set the number of deaths.
337338
*
338339
* @return An IOResult indicating success or failure.
339340
*/
340341
IOResult<void> read_input_data(const mio::VectorRange<Node<Model<ScalarType>>>& model, Date date,
341342
const std::vector<ScalarType>& scaling_factor_inf, ScalarType scaling_factor_icu,
342-
int num_days, const mio::regions::de::EpidataFilenames& epidata_filenames);
343+
int num_days, const mio::regions::de::EpidataFilenames& epidata_filenames,
344+
bool set_death = false);
343345

344346
/**
345347
* @brief Converts input data from one range of models to another with different type.

cpp/tests/data/District/pydata/confirmed_cases.json renamed to cpp/tests/data/District/pydata/cases_all_county_age_ma7.json

File renamed without changes.

cpp/tests/data/District/pydata/population_data.json renamed to cpp/tests/data/District/pydata/county_current_population.json

File renamed without changes.
File renamed without changes.

cpp/tests/data/District/pydata/vaccination_data.json renamed to cpp/tests/data/District/pydata/vacc_county_ageinf_ma7.json

File renamed without changes.

cpp/tests/data/Germany/pydata/confirmed_cases.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

cpp/tests/data/Germany/pydata/critical_cases.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

cpp/tests/data/Germany/pydata/population_data.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)