Skip to content

Commit 80c5158

Browse files
Fix storage-related bugs
1 parent 1aca265 commit 80c5158

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Diff for: prescient/data/simulation_state/mutable_simulation_state.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def apply_ruc(self, options, ruc:RucModel) -> None:
194194
max_ruc_length = ruc_delay + options.ruc_horizon
195195
self._commits[g] = deque(maxlen=max_ruc_length)
196196
for s,s_dict in ruc.elements('storage'):
197-
self._init_state_of_charge[s] = s_dict['initial_state_of_charge']
197+
self._init_soc[s] = s_dict['initial_state_of_charge']
198198

199199
# If this is first RUC, also save data to indicate when to pop RUC-related state
200200
self._minutes_per_forecast_step = ruc.data['system']['time_period_length_minutes']

Diff for: prescient/engine/data_extractors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def get_all_storage_soc_dispatch_levels(self, sced: OperationsModel) -> Dict[S,
487487
for s in self.get_all_storage(sced)}
488488

489489
def get_all_storage_types(self, sced: OperationsModel) -> Dict[S, float]:
490-
return {s: self.get_storage_soc_dispatch_level(sced, s)
490+
return {s: self.get_storage_type(sced, s)
491491
for s in self.get_all_storage(sced)}
492492

493493

Diff for: prescient/engine/egret/data_extractors.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -340,20 +340,20 @@ def get_bus_mismatch(sced: OperationsModel, bus: B) -> float:
340340

341341
@staticmethod
342342
def get_storage_input_dispatch_level(sced: OperationsModel, storage: S) -> float:
343-
return sced.data['elements']['storage'][s]['p_charge']['values'][0]
343+
return sced.data['elements']['storage'][storage]['p_charge']['values'][0]
344344

345345
@staticmethod
346346
def get_storage_output_dispatch_level(sced: OperationsModel, storage: S) -> float:
347-
return sced.data['elements']['storage'][s]['p_discharge']['values'][0]
347+
return sced.data['elements']['storage'][storage]['p_discharge']['values'][0]
348348

349349
@staticmethod
350350
def get_storage_soc_dispatch_level(sced: OperationsModel, storage: S) -> float:
351-
return sced.data['elements']['storage'][s]['state_of_charge']['values'][0]
351+
return sced.data['elements']['storage'][storage]['state_of_charge']['values'][0]
352352

353353
@staticmethod
354354
def get_storage_type(sced: OperationsModel, storage: S) -> str:
355-
if 'fuel' in sced.data['elements']['storage'][s]:
356-
return sced.data['elements']['storage'][s]['fuel']
355+
if 'fuel' in sced.data['elements']['storage'][storage]:
356+
return sced.data['elements']['storage'][storage]['fuel']
357357
return 'Other'
358358

359359
@staticmethod

0 commit comments

Comments
 (0)