From 2910ff3b779d8fd080d7e8ae41fcab75180d7fbb Mon Sep 17 00:00:00 2001 From: davidusb-geek Date: Thu, 16 Mar 2023 23:47:34 +0100 Subject: [PATCH] Fix - Fixed wrong column name for var_load when using predict with ML forecaster --- CHANGELOG.md | 4 ++++ docs/conf.py | 2 +- setup.py | 2 +- src/emhass/forecast.py | 1 + tests/test_forecast.py | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ee9b361..8477294e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [0.4.7] - 2023-03-16 +### Fix +- Fixed wrong column name for var_load when using predict with ML forecaster. + ## [0.4.6] - 2023-03-16 ### Fix - Fixed wrong path for saved ML forecaster model. diff --git a/docs/conf.py b/docs/conf.py index 8e59c103..3987943c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = 'David HERNANDEZ' # The full version, including alpha/beta/rc tags -release = '0.4.6' +release = '0.4.7' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index f33ead04..3a021e6c 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( name='emhass', # Required - version='0.4.6', # Required + version='0.4.7', # Required description='An Energy Management System for Home Assistant', # Optional long_description=long_description, # Optional long_description_content_type='text/markdown', # Optional (see note above) diff --git a/src/emhass/forecast.py b/src/emhass/forecast.py index 9d0fe53e..eadabe42 100644 --- a/src/emhass/forecast.py +++ b/src/emhass/forecast.py @@ -609,6 +609,7 @@ def get_load_forecast(self, days_min_load_forecast: Optional[int] = 3, method: O # Make predictions if use_last_window: data_last_window = copy.deepcopy(df) + data_last_window = data_last_window.rename(columns={self.var_load_new: self.var_load}) else: data_last_window = None forecast_out = mlf.predict(data_last_window) diff --git a/tests/test_forecast.py b/tests/test_forecast.py index b2ae6ee8..4f03171c 100644 --- a/tests/test_forecast.py +++ b/tests/test_forecast.py @@ -389,7 +389,7 @@ def test_get_load_forecast_mlforecaster(self): } runtimeparams_json = json.dumps(runtimeparams) params['passed_data'] = runtimeparams - params['optim_conf'][8]['load_forecast_method'] = 'skforecast' + params['optim_conf'][8]['load_forecast_method'] = 'mlforecaster' params_json = json.dumps(params) input_data_dict = set_input_data_dict(config_path, base_path, costfun, params_json, runtimeparams_json, action, logger, get_data_from_file=True)