Skip to content

Commit

Permalink
merging with dev 1.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Dec 1, 2023
2 parents 680abb7 + 40ece87 commit 2e3d6d3
Show file tree
Hide file tree
Showing 116 changed files with 2,875 additions and 452 deletions.
236 changes: 118 additions & 118 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ version: 2.1
executors:
grid2op-executor:
docker:
- image: python:3.10-buster
- image: python:3.10
working_directory: /Grid2Op

python37:
docker:
- image: python:3.7-buster
- image: python:3.7
python38:
docker:
- image: python:3.8-buster
- image: python:3.8
python39:
docker:
- image: python:3.9-buster
- image: python:3.9
python310:
docker:
- image: python:3.10-buster
- image: python:3.10
python311:
docker:
- image: python:3.11-buster
- image: python:3.11
python312:
docker:
- image: cimg/python:3.12.0
- image: cimg/python:3.12

jobs:
test:
Expand Down Expand Up @@ -140,27 +140,27 @@ jobs:
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.21,<1.22"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.22,<1.23"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.23,<1.24"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.21,<1.22"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.22,<1.23"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.23,<1.24"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
Expand All @@ -187,53 +187,53 @@ jobs:
python -m pip install -U pip setuptools wheel
python -m pip install chronix2grid>="1.1.0.post1"
python -m pip uninstall -y grid2op
- run:
command: |
source venv_test/bin/activate
python -m pip install -U numba
python -m pip install -U .[test]
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.20,<1.21"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.21,<1.22"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.22,<1.23"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.23,<1.24"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.24,<1.25"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.25,<1.26"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U numba
# python -m pip install -U .[test]
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.20,<1.21"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.21,<1.22"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.22,<1.23"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.23,<1.24"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.24,<1.25"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.25,<1.26"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
Expand Down Expand Up @@ -265,34 +265,34 @@ jobs:
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.22,<1.23"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.23,<1.24"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.24,<1.25"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.25,<1.26"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.22,<1.23"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.23,<1.24"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.24,<1.25"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.25,<1.26"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
Expand Down Expand Up @@ -324,20 +324,20 @@ jobs:
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.24,<1.25"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
python -m pip install -U "numpy>=1.25,<1.26"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.24,<1.25"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
# - run:
# command: |
# source venv_test/bin/activate
# python -m pip install -U "numpy>=1.25,<1.26"
# python -m pip install -U .[test]
# export _GRID2OP_FORCE_TEST=1
# grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
Expand Down Expand Up @@ -380,4 +380,4 @@ workflows:
- install39
- install310
- install311
# - install312 # failing because of dependencies of numba, torch etc. Tired of it so ignoring it !
- install312 # failing because of dependencies of numba, torch etc. Tired of it so ignoring it !
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ grid2op/tests/test_failing_simulator.txt
old_pyproject.toml
pp_bug_gen_alone.py
test_dunder.py
grid2op/tests/test_fail_ci.txt
saved_multiepisode_agent_36bus_DN_4/

# profiling files
**.prof
34 changes: 34 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,40 @@ Change Log
- [???] "asynch" multienv
- [???] properly model interconnecting powerlines


[1.9.8] - 20xx-yy-zz
----------------------
- [IMPROVED] the CI speed: by not testing every possible numpy version but only most ancient and most recent
- [IMPROVED] Runner now test grid2op version 1.9.6 and 1.9.7
- [IMPROVED] refacto `gridobj_cls._clear_class_attribute` and `gridobj_cls._clear_grid_dependant_class_attributes`
- [IMPROVED] the bahviour of the generic class `MakeBackend` used for the test suite.
- [IMPROVED] re introducing python 12 testing

[1.9.7] - 2023-12-01
----------------------
- [BREAKING] removal of the `grid2op/Exceptions/PowerflowExceptions.py` file and move the
`DivergingPowerflow` as part of the BackendException. If you imported (to be avoided)
with `from grid2op.Exceptions.PowerflowExceptions import PowerflowExceptions`
simply do `from grid2op.Exceptions import PowerflowExceptions` and nothing
will change.
- [BREAKING] rename with filename starting with lowercase all the files in the "`Exceptions`",
module. This is both consistent with python practice but allows also to make the
difference between the files in the
module and the class imported. This should have little to no impact on all codes but to "upgrade"
instead of `from grid2op.Exceptions.XXX import PowerflowExceptions` (which you should not have done in the first place)
just do `from grid2op.Exceptions import PowerflowExceptions`. Expect other changes like this for other grid2op modules
in the near future.
- [BREAKING] change the `gridobj_cls.shape()` and `gridobj_cls.dtype()` to `gridobj_cls.shapes()` and `gridobj_cls.dtypes()`
to be more clear when dealing with action_space and observation_space (where `shape` and `dtype` are attribute and not functions)
This change means you can still use `act.shape()` and `act.dtype()` but that `act_space.shape` and `act_space.dtype` are now
clearly properties (and NOT attribute). For the old function `gridobj_cls.dtype()` you can now use `gridobj_cls.dtypes()`
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/561 (indent issue)
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/550 : issue with `shunts_data_available` now better handled
- [IMPROVED] the function to check the backend interface now also check that
the `topo_vect` returns value between 1 and 2.
- [IMPROVED] the function to check backend now also check the `topo_vect`
for each type of elements.

[1.9.6] - 2023-10-26
----------------------
- [BREAKING] when a storage is connected alone on a bus, even if it produces / absorbs 0.0 MW it
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ WORKDIR /Grid2Op
RUN git pull
RUN git remote update
RUN git fetch --all --tags
RUN git checkout "tags/v1.9.5" -b "v1.9.5-branch"
RUN git checkout "tags/v1.9.7" -b "v1.9.7-branch"
# Install Dependencies
RUN pip3 install .[optional,challenge]
WORKDIR /
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.9.5'
release = '1.9.8.dev0'
version = '1.9'


Expand Down
12 changes: 8 additions & 4 deletions grid2op/Action/_backendAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ def __init__(self):
)

# shunts
if type(self).shunts_data_available:
cls = type(self)
if cls.shunts_data_available:
self.shunt_p = ValueStore(self.n_shunt, dtype=dt_float)
self.shunt_q = ValueStore(self.n_shunt, dtype=dt_float)
self.shunt_bus = ValueStore(self.n_shunt, dtype=dt_int)
Expand Down Expand Up @@ -270,7 +271,8 @@ def __deepcopy__(self, memodict={}):
res.storage_power.copy(self.storage_power)
res.activated_bus[:, :] = self.activated_bus
# res.big_topo_to_subid[:] = self.big_topo_to_subid # cste
if type(self).shunts_data_available:
cls = type(self)
if cls.shunts_data_available:
res.shunt_p.copy(self.shunt_p)
res.shunt_q.copy(self.shunt_q)
res.shunt_bus.copy(self.shunt_bus)
Expand Down Expand Up @@ -313,7 +315,8 @@ def reorder(self, no_load, no_gen, no_topo, no_storage, no_shunt):

self.storage_power.reorder(no_storage)

if type(self).shunts_data_available:
cls = type(self)
if cls.shunts_data_available:
self.shunt_p.reorder(no_shunt)
self.shunt_q.reorder(no_shunt)
self.shunt_bus.reorder(no_shunt)
Expand All @@ -340,7 +343,8 @@ def reset(self):
self.storage_power.values[:] = 0.0

# shunts
if type(self).shunts_data_available:
cls = type(self)
if cls.shunts_data_available:
self.shunt_p.reset()
self.shunt_q.reset()
self.shunt_bus.reset()
Expand Down
Loading

0 comments on commit 2e3d6d3

Please sign in to comment.