From df3bff0af84f3a1e97a252b4d83b1b150726d3d1 Mon Sep 17 00:00:00 2001 From: David HERNANDEZ Date: Sat, 27 Aug 2022 22:58:04 +0200 Subject: [PATCH] Fix - Added more unittest for passing data as list --- CHANGELOG.md | 7 ++++++- tests/test_command_line_utils.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8eff0d..d247b669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ ### Improvement - Improving documentation, added more information on forecast page. - Added support for SolCast PV production forecasts. -- Added possibility to pass some optimization parameters at runtime +- Added possibility to pass some optimization parameters at runtime. +- Added some unittest for passing data as list testing. ### Fix - Fixed small bug on webserver using pandas sum function for non numeric data. This was throwing the following message: Dropping of nuisance columns in DataFrame reductions (with 'numeric_only=None') is deprecated. @@ -259,6 +260,10 @@ [0.3.9]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.9 [0.3.11]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.11 [0.3.13]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.13 +[0.3.14]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.14 +[0.3.15]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.15 +[0.3.16]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.16 +[0.3.17]: https://github.com/davidusb-geek/emhass/releases/tag/v0.3.17 # Notes All notable changes to this project will be documented in this file. diff --git a/tests/test_command_line_utils.py b/tests/test_command_line_utils.py index 54a2b7d4..5f20ed1a 100644 --- a/tests/test_command_line_utils.py +++ b/tests/test_command_line_utils.py @@ -139,6 +139,10 @@ def test_set_input_data_dict(self): self.assertIsInstance(input_data_dict['df_input_data_dayahead'], pd.DataFrame) self.assertTrue(input_data_dict['df_input_data_dayahead'].index.freq is not None) self.assertTrue(input_data_dict['df_input_data_dayahead'].isnull().sum().sum()==0) + self.assertTrue(input_data_dict['fcst'].optim_conf['weather_forecast_method']=='list') + self.assertTrue(input_data_dict['fcst'].optim_conf['load_forecast_method']=='list') + self.assertTrue(input_data_dict['fcst'].optim_conf['load_cost_forecast_method']=='list') + self.assertTrue(input_data_dict['fcst'].optim_conf['prod_price_forecast_method']=='list') action = 'publish-data' input_data_dict = set_input_data_dict(config_path, base_path, costfun, self.params_json, self.runtimeparams_json, action, logger, get_data_from_file=True) @@ -175,6 +179,14 @@ def test_set_input_data_dict(self): self.assertTrue(input_data_dict['df_input_data_dayahead'].index.freq is not None) self.assertTrue(input_data_dict['df_input_data_dayahead'].isnull().sum().sum()==0) self.assertTrue(len(input_data_dict['df_input_data_dayahead'])==10) # The default value for prediction_horizon + # action = 'dayahead-optim' + # input_data_dict = set_input_data_dict(config_path, base_path, costfun, params_json, runtimeparams_json, + # action, logger, get_data_from_file=True) + # self.assertIsInstance(input_data_dict, dict) + # self.assertIsInstance(input_data_dict['df_input_data_dayahead'], pd.DataFrame) + # self.assertTrue(input_data_dict['df_input_data_dayahead'].index.freq is not None) + # self.assertTrue(input_data_dict['df_input_data_dayahead'].isnull().sum().sum()==0) + # self.assertTrue(len(input_data_dict['df_input_data_dayahead'])==10) # The default value for prediction_horizon def test_dayahead_forecast_optim(self): config_path = pathlib.Path(root+'/config_emhass.yaml')