Skip to content

Commit

Permalink
Fix - Added more unittest for passing data as list
Browse files Browse the repository at this point in the history
  • Loading branch information
davidusb-geek committed Aug 27, 2022
1 parent 99c54a9 commit df3bff0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions tests/test_command_line_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit df3bff0

Please sign in to comment.