diff --git a/assume/strategies/learning_strategies.py b/assume/strategies/learning_strategies.py index f32a0939..d1f52187 100644 --- a/assume/strategies/learning_strategies.py +++ b/assume/strategies/learning_strategies.py @@ -271,15 +271,14 @@ def create_observation( / scaling_factor_res_load ) - if end_excl + forecast_len > unit.forecaster["price_forecast"].index[-1]: + if end_excl + forecast_len > unit.forecaster["price_EOM"].index[-1]: scaled_price_forecast = ( - unit.forecaster["price_forecast"].loc[start:].values - / scaling_factor_price + unit.forecaster["price_EOM"].loc[start:].values / scaling_factor_price ) scaled_price_forecast = np.concatenate( [ scaled_price_forecast, - unit.forecaster["price_forecast"].iloc[ + unit.forecaster["price_EOM"].iloc[ : self.foresight - len(scaled_price_forecast) ], ] @@ -287,9 +286,7 @@ def create_observation( else: scaled_price_forecast = ( - unit.forecaster["price_forecast"] - .loc[start : end_excl + forecast_len] - .values + unit.forecaster["price_EOM"].loc[start : end_excl + forecast_len].values / scaling_factor_price ) diff --git a/tests/test_storage.py b/tests/test_storage.py index c08c774c..edf05612 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -329,12 +329,14 @@ def test_execute_dispatch(storage_unit): ) storage_unit.outputs["energy"][start] = 100 storage_unit.outputs["soc"][start] = 0.05 + storage_unit.outputs["soc"][start] = 0.05 dispatched_energy = storage_unit.execute_current_dispatch(start, end) assert math.isclose( dispatched_energy.iloc[0], 50 * storage_unit.efficiency_discharge, abs_tol=0.1 ) storage_unit.outputs["energy"][start] = -100 storage_unit.outputs["soc"][start] = 0.95 + storage_unit.outputs["soc"][start] = 0.95 dispatched_energy = storage_unit.execute_current_dispatch(start, end) assert math.isclose( dispatched_energy.iloc[0], -50 / storage_unit.efficiency_charge, abs_tol=0.1