Skip to content

Commit c03c899

Browse files
Merge pull request #453 from davidusb-geek/davidusb-geek/fix/fixing_typical_forecast
Check changing time steps on typical load forecast method
2 parents cf653d2 + a093869 commit c03c899

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_forecast.py

+17
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,23 @@ def test_get_load_forecast_typical(self):
974974
)
975975
self.assertEqual(P_load_forecast.index.tz, self.fcst.time_zone)
976976
self.assertEqual(len(self.P_PV_forecast), len(P_load_forecast))
977+
# Relaunch this test but changing the timestep to 1h
978+
params = self.fcst.params
979+
params['retrieve_hass_conf']['optimization_time_step'] = 60
980+
self.retrieve_hass_conf["optimization_time_step"] = pd.Timedelta('1h')
981+
fcst = Forecast(
982+
self.retrieve_hass_conf,
983+
self.optim_conf,
984+
self.plant_conf,
985+
params,
986+
emhass_conf,
987+
logger,
988+
get_data_from_file=self.get_data_from_file,
989+
)
990+
self.assertTrue(len(fcst.forecast_dates) == 24)
991+
P_load_forecast = fcst.get_load_forecast(method="typical")
992+
self.assertIsInstance(P_load_forecast, pd.core.series.Series)
993+
self.assertTrue(len(P_load_forecast) == len(fcst.forecast_dates))
977994

978995
# Test load cost forecast dataframe output using saved csv referece file
979996
def test_get_load_cost_forecast(self):

0 commit comments

Comments
 (0)