Skip to content

Commit

Permalink
Merge pull request #640 from BDonnot/bd_dev
Browse files Browse the repository at this point in the history
Bd dev
  • Loading branch information
BDonnot authored Sep 30, 2024
2 parents f508dc6 + df61eaf commit 82c81ff
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
container: quay.io/pypa/manylinux2014_x86_64
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
GHA_USE_NODE_20: false
strategy:
matrix:
python:
Expand Down Expand Up @@ -46,7 +47,7 @@ jobs:
steps:

- name: Checkout sources
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
submodules: true

Expand Down Expand Up @@ -159,13 +160,13 @@ jobs:
run: python setup.py sdist

- name: Upload wheel
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: grid2op-wheel-${{ matrix.config.name }}-${{ matrix.python.name }}
path: dist/*.whl

- name: Upload source archive
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: matrix.config.name == 'darwin' && matrix.python.name == 'cp310'
with:
name: grid2op-sources
Expand Down Expand Up @@ -238,12 +239,12 @@ jobs:

steps:
- name: Download wheels
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: download

- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: grid2op-wheels
path: |
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ Next release
- [FIXED] an issue in the backend: if the backend failed to be
created the `_grid` attribute was set to `None` and not set back to
- [FIXED] the `self.skip_if_needed()` was missing for one of the test suite.
- [FIXED] an error in the descirption of the `educ_case14_storage` environment
(wrong sign for the slack generator)
- [IMPROVED] error message when forecasts are not correctly set-up

[1.10.3] - 2024-07-12
-------------------------
Expand Down
8 changes: 5 additions & 3 deletions grid2op/Chronics/gridStateFromFileWithForecasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def __init__(
self._order_prod_p_forecasted = None
self._order_prod_v_forecasted = None
self._data_already_in_mem = False # says if the "main" value from the base class had to be reloaded (used for chunk)

self._nb_forecast = len(h_forecast)
self._h_forecast = copy.deepcopy(h_forecast)
self._check_hs_consistent(self._h_forecast, time_interval)

# init base class
GridStateFromFile.__init__(
self,
Expand All @@ -83,7 +83,7 @@ def __init__(
time_interval=time_interval,
max_iter=max_iter,
chunk_size=chunk_size,
)
)

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

def _get_next_chunk_forecasted(self):
load_p = None
Expand Down
4 changes: 2 additions & 2 deletions grid2op/data/educ_case14_storage/grid.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"gen": {
"_module": "pandas.core.frame",
"_class": "DataFrame",
"_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]]}",
"_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]]}",
"orient": "split",
"dtype": {
"name": "object",
Expand Down Expand Up @@ -1763,4 +1763,4 @@
},
"user_pf_options": {}
}
}
}
2 changes: 1 addition & 1 deletion grid2op/tests/test_MakeEnv.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ def test_hash_l2rpn_case14_sandbox(self):
def test_hash_educ_case14_storage(self):
# the file "storage_units_charac" was not used when hashing the environment, which was a bug
self.aux_test_hash_l2rpn_case14_sandbox("educ_case14_storage",
"c5192c21b778129ae4201ff5c992c1d7605fda26280c7267858d3e87cf03adbc15a15913355908b39a7c0839811eec399bed82714d4cd78e5fcae7d984bd641b")
"fb8cfe8d2cd7ab24558c90ca0309303600343091d41c43eae50abb09ad56c0fc8bec321bfefb0239c28ebdb4f2e75fc11948b4dd8dc967e4a10303eac41c7176")

if __name__ == "__main__":
unittest.main()

0 comments on commit 82c81ff

Please sign in to comment.