Skip to content

Commit 77c5594

Browse files
committed
2 small fixes
1 parent 03df698 commit 77c5594

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ Next release
7171
- [FIXED] an issue in the backend: if the backend failed to be
7272
created the `_grid` attribute was set to `None` and not set back to
7373
- [FIXED] the `self.skip_if_needed()` was missing for one of the test suite.
74+
- [FIXED] an error in the descirption of the `educ_case14_storage` environment
75+
(wrong sign for the slack generator)
76+
- [IMPROVED] error message when forecasts are not correctly set-up
7477

7578
[1.10.3] - 2024-07-12
7679
-------------------------

grid2op/Chronics/gridStateFromFileWithForecasts.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def __init__(
7171
self._order_prod_p_forecasted = None
7272
self._order_prod_v_forecasted = None
7373
self._data_already_in_mem = False # says if the "main" value from the base class had to be reloaded (used for chunk)
74+
7475
self._nb_forecast = len(h_forecast)
7576
self._h_forecast = copy.deepcopy(h_forecast)
7677
self._check_hs_consistent(self._h_forecast, time_interval)
77-
7878
# init base class
7979
GridStateFromFile.__init__(
8080
self,
@@ -83,7 +83,7 @@ def __init__(
8383
time_interval=time_interval,
8484
max_iter=max_iter,
8585
chunk_size=chunk_size,
86-
)
86+
)
8787

8888
def _clear(self):
8989
super()._clear()
@@ -106,7 +106,9 @@ def _check_hs_consistent(self, h_forecast, time_interval):
106106
if prev.total_seconds() // 60 != h:
107107
raise ChronicsError("For now you cannot build non contiuguous forecast. "
108108
"Forecast should look like [5, 10, 15, 20] "
109-
"but not [10, 15, 20] (missing h=5mins) or [5, 10, 20] (missing h=15)")
109+
"but not [10, 15, 20] (missing h=5mins) or [5, 10, 20] "
110+
f"(missing h=15 in this example). Missing h={prev} "
111+
f"at position {i}, found {h}")
110112

111113
def _get_next_chunk_forecasted(self):
112114
load_p = None

grid2op/data/educ_case14_storage/grid.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
"gen": {
138138
"_module": "pandas.core.frame",
139139
"_class": "DataFrame",
140-
"_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"vm_pu\",\"sn_mva\",\"min_q_mvar\",\"max_q_mvar\",\"scaling\",\"slack\",\"in_service\",\"type\",\"controllable\",\"min_p_mw\",\"max_p_mw\",\"slack_weight\",\"power_station_trafo\"],\"index\":[0,1,2,3,4,5],\"data\":[[null,1,40.0,1.045,null,-40.0,50.0,1.0,false,true,null,true,0.0,140.0,0.0,null],[null,2,0.0,1.01,null,0.0,40.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[null,5,0.0,1.07,null,-6.0,24.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[null,5,0.0,1.07,null,-6.0,24.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[null,7,0.0,1.09,null,-6.0,24.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[\"gen_0_5\",0,-219.0,1.06,null,-9999.0,9999.0,1.0,true,true,null,true,null,null,1.0,null]]}",
140+
"_object": "{\"columns\":[\"name\",\"bus\",\"p_mw\",\"vm_pu\",\"sn_mva\",\"min_q_mvar\",\"max_q_mvar\",\"scaling\",\"slack\",\"in_service\",\"type\",\"controllable\",\"min_p_mw\",\"max_p_mw\",\"slack_weight\",\"power_station_trafo\"],\"index\":[0,1,2,3,4,5],\"data\":[[null,1,40.0,1.045,null,-40.0,50.0,1.0,false,true,null,true,0.0,140.0,0.0,null],[null,2,0.0,1.01,null,0.0,40.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[null,5,0.0,1.07,null,-6.0,24.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[null,5,0.0,1.07,null,-6.0,24.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[null,7,0.0,1.09,null,-6.0,24.0,1.0,false,true,null,true,0.0,100.0,0.0,null],[\"gen_0_5\",0,219.0,1.06,null,-9999.0,9999.0,1.0,true,true,null,true,null,null,1.0,null]]}",
141141
"orient": "split",
142142
"dtype": {
143143
"name": "object",
@@ -1763,4 +1763,4 @@
17631763
},
17641764
"user_pf_options": {}
17651765
}
1766-
}
1766+
}

0 commit comments

Comments
 (0)