mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-07-21 17:28:11 +00:00
fix: use tolist() on numpy arrays in genetic parameter preparation (#1168)
GeneticOptimizationParameters.prepare() calls .to_list() on the result of
prediction.key_to_array(), which returns a numpy ndarray. Numpy arrays only
provide .tolist(), so every call raised AttributeError, was swallowed by the
bare except and logged as a misleading 'No ... data available' message. As a
consequence every automatic energy management run was canceled with 'Could
not prepare optimisation parameters'.
Regression introduced in a0febef (#1155).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -281,7 +281,7 @@ class GeneticOptimizationParameters(
|
||||
interval=interval,
|
||||
fill_method="linear",
|
||||
)
|
||||
pvforecast_ac_power = (array * power_to_energy_per_interval_factor).to_list()
|
||||
pvforecast_ac_power = (array * power_to_energy_per_interval_factor).tolist()
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
"No PV forecast data available - defaulting to demo data. Parameter preparation attempt {}: {e}",
|
||||
@@ -335,7 +335,7 @@ class GeneticOptimizationParameters(
|
||||
interval=interval,
|
||||
fill_method="ffill",
|
||||
)
|
||||
elecprice_marketprice_wh = array.to_list()
|
||||
elecprice_marketprice_wh = array.tolist()
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
"No Electricity Marketprice forecast data available - defaulting to demo data. Parameter preparation attempt {}: {e}",
|
||||
@@ -352,7 +352,7 @@ class GeneticOptimizationParameters(
|
||||
interval=interval,
|
||||
fill_method="ffill",
|
||||
)
|
||||
loadforecast_power_w = array.to_list()
|
||||
loadforecast_power_w = array.tolist()
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
"No Load forecast data available - defaulting to demo data. Parameter preparation attempt {}: {e}",
|
||||
@@ -378,7 +378,7 @@ class GeneticOptimizationParameters(
|
||||
interval=interval,
|
||||
fill_method="ffill",
|
||||
)
|
||||
feed_in_tariff_wh = array.to_list()
|
||||
feed_in_tariff_wh = array.tolist()
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
"No feed in tariff forecast data available - defaulting to demo data. Parameter preparation attempt {}: {e}",
|
||||
@@ -406,7 +406,7 @@ class GeneticOptimizationParameters(
|
||||
interval=interval,
|
||||
fill_method="ffill",
|
||||
)
|
||||
weather_temp_air = array.to_list()
|
||||
weather_temp_air = array.tolist()
|
||||
except Exception as e:
|
||||
logger.info(
|
||||
"No weather forecast data available - defaulting to demo data. Parameter preparation attempt {}: {e}",
|
||||
|
||||
Reference in New Issue
Block a user