Skip to content

Commit 07a843a

Browse files
committed
🐛 Fix storage-size if no storage bug
1 parent 20fd369 commit 07a843a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/clover/simulation/energy_system.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,12 @@ def run_simulation( # pylint: disable=too-many-locals, too-many-statements
22762276
time_index=t,
22772277
)
22782278

2279+
# Determine the initial and final storage sizes
2280+
initial_storage_size = float(electric_storage_size * minigrid.battery.storage_unit)
2281+
final_storage_size = float(
2282+
initial_storage_size * np.min(battery_health_frame[0]) # type: ignore [call-overload]
2283+
)
2284+
22792285
# Process the various outputs into dataframes.
22802286
if energy_deficit is not None and len(energy_deficit) > 0:
22812287
energy_deficit_frame = dict_to_dataframe(energy_deficit, logger)
@@ -2296,12 +2302,6 @@ def run_simulation( # pylint: disable=too-many-locals, too-many-statements
22962302
hourly_battery_storage_frame = pd.DataFrame([0] * (end_hour - start_hour))
22972303
storage_power_supplied_frame = pd.DataFrame([0] * (end_hour - start_hour))
22982304

2299-
# Determine the initial and final storage sizes
2300-
initial_storage_size = float(electric_storage_size * minigrid.battery.storage_unit)
2301-
final_storage_size = float(
2302-
initial_storage_size * np.min(battery_health_frame[0]) # type: ignore [call-overload]
2303-
)
2304-
23052305
if scenario.desalination_scenario is not None:
23062306
cw_demand_met_by_electric_prioritisation: pd.DataFrame = dict_to_dataframe(
23072307
prioritise_desalinator_water, logger

0 commit comments

Comments
 (0)