@@ -583,11 +583,6 @@ TEST(TestOdeSECIRVVS, set_divi_data_invalid_dates)
583583 EXPECT_THAT (print_wrap (model_vector[0 ].populations .array ().cast <double >()),
584584 MatrixNear (print_wrap (model.populations .array ().cast <double >()), 1e-10 , 1e-10 ));
585585
586- // Test with data after DIVI dataset was no longer updated.
587- EXPECT_THAT (mio::osecirvvs::details::set_divi_data (model_vector, " " , {1001 }, {2025 , 12 , 01 }, 1.0 ), IsSuccess ());
588- EXPECT_THAT (print_wrap (model_vector[0 ].populations .array ().cast <double >()),
589- MatrixNear (print_wrap (model.populations .array ().cast <double >()), 1e-10 , 1e-10 ));
590-
591586 mio::set_log_level (mio::LogLevel::warn);
592587}
593588
@@ -612,7 +607,7 @@ TEST(TestOdeSECIRVVS, set_confirmed_cases_data_with_ICU)
612607
613608 // Change dates of the case data so that no ICU data is available at that time.
614609 // Also, increase the number of confirmed cases by 1 each day.
615- const auto t0 = mio::Date (2025 , 1 , 1 );
610+ const auto t0 = mio::Date (2000 , 1 , 1 );
616611 auto day_add = 0 ;
617612 for (auto & entry : case_data) {
618613 entry.date = offset_date_by_days (t0, day_add);
@@ -666,14 +661,14 @@ TEST(TestOdeSECIRVVS, read_data)
666661
667662 auto read_result1 = mio::osecirvvs::read_input_data_county (model1, {2020 , 12 , 01 }, {1002 },
668663 std::vector<double >(size_t (num_age_groups), 1.0 ), 1.0 ,
669- TEST_GERMANY_PYDATA_DIR, 10 );
664+ TEST_GERMANY_PYDATA_DIR, 30 );
670665
671666 auto read_result2 = mio::osecirvvs::read_input_data (model2, {2020 , 12 , 01 }, {1002 },
672667 std::vector<double >(size_t (num_age_groups), 1.0 ), 1.0 ,
673- TEST_GERMANY_PYDATA_DIR, 10 );
668+ TEST_GERMANY_PYDATA_DIR, 30 );
674669
675670 auto read_result_district = mio::osecirvvs::read_input_data (
676- model3, {2020 , 12 , 01 }, {1002 }, std::vector<double >(size_t (num_age_groups), 1.0 ), 1.0 , pydata_dir_District, 10 );
671+ model3, {2020 , 12 , 01 }, {1002 }, std::vector<double >(size_t (num_age_groups), 1.0 ), 1.0 , pydata_dir_District, 30 );
677672
678673 ASSERT_THAT (read_result1, IsSuccess ());
679674 ASSERT_THAT (read_result2, IsSuccess ());
@@ -903,7 +898,7 @@ TEST(TestOdeSECIRVVS, model_initialization)
903898
904899 ASSERT_THAT (mio::osecirvvs::read_input_data_county (model_vector, {2020 , 12 , 01 }, {0 },
905900 std::vector<double >(size_t (num_age_groups), 1.0 ), 1.0 ,
906- TEST_GERMANY_PYDATA_DIR, 2 , false ),
901+ TEST_GERMANY_PYDATA_DIR, 30 , false ),
907902 IsSuccess ());
908903
909904 // Values from data/export_time_series_init_osecirvvs.h5, for reading in comparison
@@ -1586,3 +1581,45 @@ TEST(TestOdeSECIRVVS, apply_variant_function)
15861581 sim.get_model ().parameters .get <mio::osecirvvs::TransmissionProbabilityOnContact<double >>()[mio::AgeGroup (0 )],
15871582 0.4 , 1e-10 );
15881583}
1584+
1585+ TEST (TestOdeSECIRVVS, set_vaccination_data_not_avail)
1586+ {
1587+ const auto num_age_groups = 2 ;
1588+ const auto num_days = 5 ;
1589+ mio::osecirvvs::Model<double > model (num_age_groups);
1590+ std::vector<mio::osecirvvs::Model<double >> model_vector = {model};
1591+
1592+ // Setup initial non-zero vaccination data
1593+ auto & params = model_vector[0 ].parameters ;
1594+ params.get <mio::osecirvvs::DailyPartialVaccinations<double >>().resize (mio::SimulationDay (num_days + 1 ));
1595+ params.get <mio::osecirvvs::DailyFullVaccinations<double >>().resize (mio::SimulationDay (num_days + 1 ));
1596+
1597+ const double initial_partial_vacc_val = 10.0 ;
1598+ const double initial_full_vacc_val = 5.0 ;
1599+
1600+ for (auto g = mio::AgeGroup (0 ); g < mio::AgeGroup (num_age_groups); ++g) {
1601+ for (auto d = mio::SimulationDay (0 ); d < mio::SimulationDay (num_days + 1 ); ++d) {
1602+ params.get <mio::osecirvvs::DailyPartialVaccinations<double >>()[{g, d}] = initial_partial_vacc_val;
1603+ params.get <mio::osecirvvs::DailyFullVaccinations<double >>()[{g, d}] = initial_full_vacc_val;
1604+ }
1605+ }
1606+
1607+ // call set_vaccination_data with an unavailable date
1608+ mio::Date unavailable_date (2019 , 1 , 1 ); // Date before vaccinations started
1609+ std::vector<int > region = {1001 };
1610+ std::string any_path = " dummy_vacc_path.json" ;
1611+ auto result =
1612+ mio::osecirvvs::details::set_vaccination_data (model_vector, any_path, unavailable_date, region, num_days);
1613+
1614+ ASSERT_THAT (result, IsSuccess ());
1615+
1616+ // Check that vaccinations are set to zero for all days and age groups
1617+ for (auto d = mio::SimulationDay (0 ); d < mio::SimulationDay (num_days + 1 ); ++d) {
1618+ for (auto a = mio::AgeGroup (0 ); a < mio::AgeGroup (num_age_groups); ++a) {
1619+ auto partial_vacc = params.get <mio::osecirvvs::DailyPartialVaccinations<double >>()[{a, d}];
1620+ auto full_vacc = params.get <mio::osecirvvs::DailyFullVaccinations<double >>()[{a, d}];
1621+ EXPECT_NEAR (partial_vacc, 0.0 , 1e-10 );
1622+ EXPECT_NEAR (full_vacc, 0.0 , 1e-10 );
1623+ }
1624+ }
1625+ }
0 commit comments