@@ -335,11 +335,10 @@ IOResult<void> export_input_data_county_timeseries(
335335}
336336#else
337337template <class Model >
338- IOResult<void >
339- export_input_data_county_timeseries (std::vector<Model> models, const std::string& dir, std::vector<int > const & region,
340- Date date, const std::vector<double >& scaling_factor_inf, double scaling_factor_icu,
341- int num_days, const std::string& divi_data_path,
342- const std::string& confirmed_cases_path, const std::string& population_data_path)
338+ IOResult<void > export_input_data_county_timeseries (
339+ std::vector<Model> models, const std::string& results_dir, std::vector<int > const & region, Date date,
340+ const std::vector<double >& scaling_factor_inf, double scaling_factor_icu, int num_days,
341+ const std::string& divi_data_path, const std::string& confirmed_cases_path, const std::string& population_data_path)
343342{
344343 mio::log_warning (" HDF5 not available. Cannot export time series of extrapolated real data." );
345344 return success ();
@@ -352,18 +351,19 @@ export_input_data_county_timeseries(std::vector<Model> models, const std::string
352351 * @param[in] date Date for which the data should be read.
353352 * @param[in] scaling_factor_inf Factors by which to scale the confirmed cases of rki data.
354353 * @param[in] scaling_factor_icu Factor by which to scale the icu cases of divi data.
355- * @param[in] dir Directory of files.
354+ * @param[in] pydata_dir Directory of files.
356355 */
357356template <class Model >
358357IOResult<void > read_input_data_germany (std::vector<Model>& model, Date date,
359358 const std::vector<double >& scaling_factor_inf, double scaling_factor_icu,
360- const std::string& dir )
359+ const std::string& pydata_dir )
361360{
362361 BOOST_OUTCOME_TRY (
363- details::set_divi_data (model, path_join (dir, " germany_divi.json" ), {0 }, date, scaling_factor_icu));
364- BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (dir, " cases_all_age_ma7.json" ), {0 }, date,
365- scaling_factor_inf));
366- BOOST_OUTCOME_TRY (details::set_population_data (model, path_join (dir, " county_current_population.json" ), {0 }));
362+ details::set_divi_data (model, path_join (pydata_dir, " germany_divi.json" ), {0 }, date, scaling_factor_icu));
363+ BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (pydata_dir, " cases_all_age_ma7.json" ), {0 },
364+ date, scaling_factor_inf));
365+ BOOST_OUTCOME_TRY (
366+ details::set_population_data (model, path_join (pydata_dir, " county_current_population.json" ), {0 }));
367367 return success ();
368368}
369369
@@ -374,19 +374,20 @@ IOResult<void> read_input_data_germany(std::vector<Model>& model, Date date,
374374 * @param[in] state Vector of region keys of states of interest.
375375 * @param[in] scaling_factor_inf Factors by which to scale the confirmed cases of rki data.
376376 * @param[in] scaling_factor_icu Factor by which to scale the icu cases of divi data.
377- * @param[in] dir Directory of files.
377+ * @param[in] pydata_dir Directory of files.
378378 */
379379template <class Model >
380380IOResult<void > read_input_data_state (std::vector<Model>& model, Date date, std::vector<int >& state,
381381 const std::vector<double >& scaling_factor_inf, double scaling_factor_icu,
382- const std::string& dir )
382+ const std::string& pydata_dir )
383383{
384384
385385 BOOST_OUTCOME_TRY (
386- details::set_divi_data (model, path_join (dir, " state_divi.json" ), state, date, scaling_factor_icu));
387- BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (dir, " cases_all_state_age_ma7.json" ), state,
388- date, scaling_factor_inf));
389- BOOST_OUTCOME_TRY (details::set_population_data (model, path_join (dir, " county_current_population.json" ), state));
386+ details::set_divi_data (model, path_join (pydata_dir, " state_divi.json" ), state, date, scaling_factor_icu));
387+ BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (pydata_dir, " cases_all_state_age_ma7.json" ),
388+ state, date, scaling_factor_inf));
389+ BOOST_OUTCOME_TRY (
390+ details::set_population_data (model, path_join (pydata_dir, " county_current_population.json" ), state));
390391 return success ();
391392}
392393
@@ -397,33 +398,32 @@ IOResult<void> read_input_data_state(std::vector<Model>& model, Date date, std::
397398 * @param[in] county Vector of region keys of counties of interest.
398399 * @param[in] scaling_factor_inf Factors by which to scale the confirmed cases of rki data.
399400 * @param[in] scaling_factor_icu Factor by which to scale the icu cases of divi data.
400- * @param[in] dir Directory of files.
401+ * @param[in] pydata_dir Directory of files.
401402 * @param[in] num_days [Default: 0] Number of days to be simulated; required to extrapolate real data.
402403 * @param[in] export_time_series [Default: false] If true, reads data for each day of simulation and writes it in the same directory as the input files.
403404 */
404405template <class Model >
405406IOResult<void > read_input_data_county (std::vector<Model>& model, Date date, const std::vector<int >& county,
406407 const std::vector<double >& scaling_factor_inf, double scaling_factor_icu,
407- const std::string& dir , int num_days = 0 , bool export_time_series = false )
408+ const std::string& pydata_dir , int num_days = 0 , bool export_time_series = false )
408409{
409- BOOST_OUTCOME_TRY (details::set_divi_data (model, path_join (dir, " pydata/Germany " , " county_divi_ma7.json " ), county,
410- date, scaling_factor_icu));
411- BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (
412- model, path_join (dir, " pydata/Germany " , " cases_all_county_age_ma7.json " ), county, date, scaling_factor_inf));
413- BOOST_OUTCOME_TRY (details::set_population_data (
414- model, path_join (dir, " pydata/Germany " , " county_current_population.json" ), county));
410+ BOOST_OUTCOME_TRY (
411+ details::set_divi_data (model, path_join (pydata_dir, " county_divi_ma7.json " ), county, date, scaling_factor_icu));
412+ BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (pydata_dir, " cases_all_county_age_ma7.json " ),
413+ county, date, scaling_factor_inf));
414+ BOOST_OUTCOME_TRY (
415+ details::set_population_data ( model, path_join (pydata_dir , " county_current_population.json" ), county));
415416
416417 if (export_time_series) {
417418 // Use only if extrapolated real data is needed for comparison. EXPENSIVE !
418419 // Run time equals run time of the previous functions times the num_days !
419420 // (This only represents the vectorization of the previous function over all simulation days...)
420421 log_warning (" Exporting time series of extrapolated real data. This may take some minutes. "
421422 " For simulation runs over the same time period, deactivate it." );
422- BOOST_OUTCOME_TRY (
423- export_input_data_county_timeseries (model, dir, county, date, scaling_factor_inf, scaling_factor_icu,
424- num_days, path_join (dir, " pydata/Germany" , " county_divi_ma7.json" ),
425- path_join (dir, " pydata/Germany" , " cases_all_county_age_ma7.json" ),
426- path_join (dir, " pydata/Germany" , " county_current_population.json" )));
423+ BOOST_OUTCOME_TRY (export_input_data_county_timeseries (
424+ model, pydata_dir, county, date, scaling_factor_inf, scaling_factor_icu, num_days,
425+ path_join (pydata_dir, " county_divi_ma7.json" ), path_join (pydata_dir, " cases_all_county_age_ma7.json" ),
426+ path_join (pydata_dir, " county_current_population.json" )));
427427 }
428428 return success ();
429429}
@@ -435,19 +435,19 @@ IOResult<void> read_input_data_county(std::vector<Model>& model, Date date, cons
435435 * @param[in] county vector of region keys of interest
436436 * @param[in] scaling_factor_inf factors by which to scale the confirmed cases of rki data
437437 * @param[in] scaling_factor_icu factor by which to scale the icu cases of divi data
438- * @param[in] dir directory of files
438+ * @param[in] pydata_dir directory of files
439439 * @param[in] age_group_names strings specifying age group names
440440 */
441441template <class Model >
442442IOResult<void > read_input_data (std::vector<Model>& model, Date date, const std::vector<int >& node_ids,
443443 const std::vector<double >& scaling_factor_inf, double scaling_factor_icu,
444- const std::string& data_dir , int num_days = 0 , bool export_time_series = false )
444+ const std::string& pydata_dir , int num_days = 0 , bool export_time_series = false )
445445{
446- BOOST_OUTCOME_TRY (
447- details::set_divi_data (model, path_join (data_dir, " critical_cases.json " ), node_ids, date, scaling_factor_icu));
448- BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (data_dir , " confirmed_cases.json" ), node_ids,
446+ BOOST_OUTCOME_TRY (details::set_divi_data (model, path_join (pydata_dir, " critical_cases.json " ), node_ids, date,
447+ scaling_factor_icu));
448+ BOOST_OUTCOME_TRY (details::set_confirmed_cases_data (model, path_join (pydata_dir , " confirmed_cases.json" ), node_ids,
449449 date, scaling_factor_inf));
450- BOOST_OUTCOME_TRY (details::set_population_data (model, path_join (data_dir , " population_data.json" ), node_ids));
450+ BOOST_OUTCOME_TRY (details::set_population_data (model, path_join (pydata_dir , " population_data.json" ), node_ids));
451451
452452 if (export_time_series) {
453453 // Use only if extrapolated real data is needed for comparison. EXPENSIVE !
@@ -456,9 +456,9 @@ IOResult<void> read_input_data(std::vector<Model>& model, Date date, const std::
456456 log_warning (" Exporting time series of extrapolated real data. This may take some minutes. "
457457 " For simulation runs over the same time period, deactivate it." );
458458 BOOST_OUTCOME_TRY (export_input_data_county_timeseries (
459- model, data_dir , node_ids, date, scaling_factor_inf, scaling_factor_icu, num_days,
460- path_join (data_dir , " critical_cases.json" ), path_join (data_dir , " confirmed_cases.json" ),
461- path_join (data_dir , " population_data.json" )));
459+ model, pydata_dir , node_ids, date, scaling_factor_inf, scaling_factor_icu, num_days,
460+ path_join (pydata_dir , " critical_cases.json" ), path_join (pydata_dir , " confirmed_cases.json" ),
461+ path_join (pydata_dir , " population_data.json" )));
462462 }
463463 return success ();
464464}
0 commit comments