Skip to content

Commit

Permalink
Merge pull request #602 from BDonnot/bd_dev
Browse files Browse the repository at this point in the history
Bd dev
  • Loading branch information
BDonnot authored Apr 26, 2024
2 parents 31d1eb2 + 303f0fb commit 37fcc16
Show file tree
Hide file tree
Showing 45 changed files with 842 additions and 281 deletions.
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ jobs:
command: |
export _GRID2OP_FORCE_TEST=1
source venv_test/bin/activate
python -m pip install -U pip setuptools wheel
python -m pip install chronix2grid>="1.1.0.post1"
python -m pip install -U pip setuptools wheel "numpy>=1.20,<1.21" "pandas<2.2" "scipy==1.10.1" numba
python -m pip install "chronix2grid>=1.1.0.post1" "gymnasium==0.26.3" "matplotlib==3.7.5" "xarray==2023.10.0" "scs==3.0.0" "ecos==2.0.0"
python -m pip uninstall -y grid2op
- run:
command: |
command: | # issue with previous more simple install, so I fix some versions
source venv_test/bin/activate
python -m pip install -U "numpy>=1.20,<1.21" "pandas<2.2" "scipy<1.12" numba .[test]
python -m pip install "numpy>=1.20,<1.21" "pandas<2.2" "scipy==1.10.1" numba .
pip freeze
- run:
command: |
Expand All @@ -222,7 +222,7 @@ jobs:
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" numba .[test]
python -m pip install "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" numba
pip freeze
- run:
command: |
Expand Down Expand Up @@ -250,7 +250,7 @@ jobs:
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.21,<1.22" "pandas<2.2" "scipy<1.12" numba .[test]
python -m pip install -U "numpy>=1.21,<1.22" "pandas<2.2" "scipy<1.12" numba .
pip freeze
- run:
command: |
Expand All @@ -261,7 +261,7 @@ jobs:
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" numba .[test]
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" numba
pip freeze
- run:
command: |
Expand All @@ -288,7 +288,7 @@ jobs:
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.23,<1.24" "pandas<2.2" "scipy<1.12" numba .[test]
python -m pip install -U "numpy>=1.23,<1.24" "pandas<2.2" "scipy<1.12" numba .
pip freeze
- run:
command: |
Expand All @@ -299,7 +299,7 @@ jobs:
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" numba .[test]
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" numba
pip freeze
- run:
command: |
Expand All @@ -326,7 +326,7 @@ jobs:
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" .[test]
python -m pip install -U "numpy>=1.26,<1.27" "pandas<2.2" "scipy<1.12" .
pip freeze
- run:
command: |
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
# auditwheel repair dist/*.whl # only for compiled code !
- name: Install wheel
run: pip3 install dist/*.whl --user
run: |
pip3 install dist/*.whl --user
pip freeze
- name: Check package can be imported
run: |
Expand Down Expand Up @@ -136,13 +138,15 @@ jobs:

- name: Install wheel
shell: bash
run: python -m pip install dist/*.whl --user
run: |
python -m pip install dist/*.whl --user
pip freeze
- name: Check package can be imported
run: |
python3 -c "import grid2op"
python3 -c "from grid2op import *"
python3 -c "from grid2op.Action._backendAction import _BackendAction"
python -c "import grid2op"
python -c "from grid2op import *"
python -c "from grid2op.Action._backendAction import _BackendAction"
- name: Build source archive
if: matrix.config.name == 'darwin' && matrix.python.name == 'cp310'
Expand Down
24 changes: 23 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,29 @@ Change Log
- [???] "asynch" multienv
- [???] properly model interconnecting powerlines

[1.10.1] - 2024-03-18
[1.10.2] - 2024-xx-yy
-------------------------
- [ADDED] it is now possible to call `change_reward` directly from
an observation (no need to do it from the Observation Space)
- [ADDED] method to change the reward from the observation (observation_space
is not needed anymore): you can use `obs.change_reward`
- [FIXED] a small issue that could lead to having
"redispatching_unit_commitment_availble" flag set even if the redispatching
data was not loded correctly
- [FIXED] EducPandaPowerBackend now properly sends numpy array in the class attributes
(instead of pandas series)
- [FIXED] an issue when loading back data (with EpisodeData): when there were no storage units
on the grid it did not set properly the "storage relevant" class attributes
- [FIXED] notebook 5 on loading back data.
- [IMPROVED] documentation about `obs.simulate` to make it clearer the
difference between env.step and obs.simulate on some cases
- [IMPROVED] type hints on some methods of `GridObjects`
- [IMPROVED] replace `np.nonzero(arr)` calls with `arr.nonzero()` which could
save up a bit of computation time.
- [IMPROVED] force class attributes to be numpy arrays of proper types when the
classes are initialized from the backend.

[1.10.1] - 2024-03-xx
----------------------
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/593
- [FIXED] backward compatibility issues with "oldest" lightsim2grid versions
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Benjamin Donnot'

# The full version, including alpha/beta/rc tags
release = '1.10.1'
release = '1.10.2.dev0'
version = '1.10'


Expand Down
10 changes: 7 additions & 3 deletions getting_started/05_StudyYourAgent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
"outputs": [],
"source": [
"try:\n",
" # use a (way) faster backend to reduce computation time\n",
" # to use it, you need to install `pip install lightsim2grid`\n",
" from lightsim2grid import LightSimBackend\n",
" bk_cls = LightSimBackend\n",
"except ImportError as exc:\n",
Expand Down Expand Up @@ -252,13 +254,15 @@
"outputs": [],
"source": [
"id_line_inspected = 13\n",
"actions_on_line_14 = 0\n",
"actions_on_line_13 = 0\n",
"for act in this_episode.actions:\n",
" dict_ = act.effect_on(line_id=id_line_inspected) # which effect has this action action on the substation with given id\n",
" # other objects are: load_id, gen_id, line_id or substation_id\n",
" if dict_['change_line_status'] or dict_[\"set_line_status\"] != 0:\n",
" actions_on_line_14 += 1\n",
"print(f'Total actions on powerline 14 : {actions_on_line_14}')"
" actions_on_line_13 += 1\n",
"print(f\"Total actions on powerline 13 (named \"\n",
" f\"{type(env).name_line[id_line_inspected]}): \"\n",
" f\"{actions_on_line_13}\")\n"
]
},
{
Expand Down
Loading

0 comments on commit 37fcc16

Please sign in to comment.