I have this error after last update
(mpc update)
My PV power forecast is more then 24, this hasn’t been a problem in the past.
Is this the problem of the error?
Edit: updating all arrays to 24, doesn’t fix it
2024-03-01 16:50:03,601 - web_server - INFO - Retrieving data from hass for load forecast using method = mlforecaster
2024-03-01 16:50:03,601 - web_server - INFO - Retrieve hass get data method initiated...
2024-03-01 16:50:05,623 - web_server - ERROR - Exception on /action/naive-mpc-optim [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1463, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 872, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 870, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/web_server.py", line 103, in action_call
input_data_dict = set_input_data_dict(config_path, str(data_path), costfun,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/command_line.py", line 127, in set_input_data_dict
P_load_forecast = fcst.get_load_forecast(method=optim_conf['load_forecast_method'], set_mix_forecast=True, df_now=df_input_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/forecast.py", line 626, in get_load_forecast
data = pd.DataFrame.from_dict(data_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/frame.py", line 1760, in from_dict
return cls(data, index=index, columns=columns, dtype=dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/frame.py", line 709, in __init__
mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/internals/construction.py", line 481, in dict_to_mgr
return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/internals/construction.py", line 115, in arrays_to_mgr
index = _extract_index(arrays)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pandas/core/internals/construction.py", line 655, in _extract_index
raise ValueError("All arrays must be of the same length")
ValueError: All arrays must be of the same length
This is my output rest
{
"pv_power_forecast": [
202,
64,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
90,
615,
1518,
1958,
2027,
1900,
1386,
857,
429,
239,
200,
64,
0,
0,
0,
0,
0
],
"prod_price_forecast": [
0.0725,
0.0894,
0.0919,
0.0872,
0.0775,
0.0716,
0.0701,
0.0664,
0.06,
0.056,
0.056,
0.0555,
0.0549,
0.056,
0.0566,
0.0607,
0.0638,
0.0658,
0.0604,
0.0611,
0.0578,
0.0549,
0.0599,
0.0661
],
"load_cost_forecast": [
0.1928,
0.2107,
0.2134,
0.2084,
0.1981,
0.1919,
0.1902,
0.1863,
0.1795,
0.1754,
0.1753,
0.1748,
0.1741,
0.1753,
0.1759,
0.1803,
0.1835,
0.1857,
0.18,
0.1807,
0.1773,
0.1742,
0.1794,
0.186
],
"soc_init": 0.96,
"prediction_horizon": 24
}