Skip to content

Commit

Permalink
Merge pull request #384 from rte-france/dev_1.7.3
Browse files Browse the repository at this point in the history
Update to version 1.8.0
  • Loading branch information
BDonnot committed Dec 12, 2022
2 parents 5185426 + 131fd8e commit 5a4c89d
Show file tree
Hide file tree
Showing 64 changed files with 4,231 additions and 246 deletions.
62 changes: 25 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ executors:
docker:
- image: bdonnot/grid2op:test
working_directory: /Grid2Op
python36:
docker:
- image: python:3.6-buster

python37:
docker:
- image: python:3.7-buster
Expand All @@ -20,6 +18,9 @@ executors:
python310:
docker:
- image: python:3.10-buster
python311:
docker:
- image: python:3.11-buster

jobs:
test:
Expand All @@ -43,6 +44,7 @@ jobs:
cd grid2op/tests/
python3 helper_list_test.py | circleci tests split > /tmp/tests_run
python3 -m unittest $(cat /tmp/tests_run)
install36:
executor: python36
resource_class: small
Expand Down Expand Up @@ -73,6 +75,7 @@ jobs:
pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
install37:
executor: python37
resource_class: small
Expand All @@ -88,21 +91,6 @@ jobs:
command: |
source venv_test/bin/activate
pip install -U pip setuptools wheel
- run:
command: |
source venv_test/bin/activate
pip install -U numba
pip install -U "numpy>=1.18,<1.19"
pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.19,<1.20"
pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
Expand All @@ -117,7 +105,8 @@ jobs:
pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
install38:
install38:
executor: python38
resource_class: small
steps:
Expand All @@ -132,42 +121,35 @@ jobs:
command: |
source venv_test/bin/activate
python -m pip install -U pip setuptools wheel
- run:
command: |
source venv_test/bin/activate
python -m pip install -U numba
python -m pip install -U "numpy>=1.18,<1.19"
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.19,<1.20"
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.20,<1.21"
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.21,<1.22"
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.22,<1.23"
python -m pip install -U "numpy>=1.23,<1.24"
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
install39:
executor: python39
resource_class: small
Expand All @@ -190,12 +172,6 @@ jobs:
command: |
source venv_test/bin/activate
python -m pip install -U .[test]
- run:
command: |
export _GRID2OP_FORCE_TEST=1
source venv_test/bin/activate
python -m pip install -U "numpy>=1.19,<1.20"
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
Expand All @@ -213,6 +189,12 @@ jobs:
export _GRID2OP_FORCE_TEST=1
python -m pip install -U "numpy>=1.22,<1.23"
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
export _GRID2OP_FORCE_TEST=1
python -m pip install -U "numpy>=1.23,<1.24"
grid2op.testinstall
install310:
executor: python310
resource_class: small
Expand Down Expand Up @@ -242,6 +224,12 @@ jobs:
python -m pip install -U .[test]
export _GRID2OP_FORCE_TEST=1
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
export _GRID2OP_FORCE_TEST=1
python -m pip install -U "numpy>=1.23,<1.24"
grid2op.testinstall
workflows:
version: 2.1
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ grid2op/data/**/_grid2op_classes/
test_issue_glop.py
**.swp
grid2op/tests/test_report.txt
results
grid2op/tests/finally_not_a_bug_test_issue_368.py
grid2op/data_test/test_issue_367/chronics/2050-01-03_7/generation_quality.json
grid2op/data_test/test_issue_367/chronics/2050-01-03_7/maintenance_meta.json
test_doc.py

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

[1.8.0] - 2022-12-yy
--------------------
- [BREAKING] now requires numpy >= 1.20 to work (otherwise there are
issues with newer versions of pandas).
- [BREAKING] issue https://github.com/rte-france/Grid2Op/issues/379 requires
different behaviour depending on installed gym package.
- [BREAKING] cooldowns are not consistent between `env.step` and `obs.simulate`.
If `obs.time_before_cooldown_line[l_id] > 0` it will be illegal, at the next call to `env.step`
(and `obs.simulate`) to modify the status of this powerline `l_id`. Same for
`obs.time_before_cooldown_sub[s_id] > 0` if trying to modify topology of
substation `s_id`. This also impacts the maintenances and hazards.
This is also linked to github issue https://github.com/rte-france/Grid2Op/issues/148
- [FIXED] a bug when using a `Runner` with an environment that has
been copied (see https://github.com/rte-france/Grid2Op/issues/361)
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/358
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/363
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/364
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/365 and
https://github.com/rte-france/Grid2Op/issues/376 . Now the function(s)
`gridobj.process_shunt_data` and `gridobj.process_grid2op_shunt_data` are called
`gridobj.process_shunt_static_data`
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/367
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/369
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/374
- [FIXED] issue https://github.com/rte-france/Grid2Op/issues/377 by adding a special
method `backend.update_thermal_limit_from_vect`
- [ADDED] the "`packaging`" python package is now required to install grid2op.
It allows to support different `gym` versions that changes behavior regarding
numpy pseudo random generator.
- [ADDED] the function `act.remove_line_status_from_topo` to ignore the line status modification
that would be induced by "set_bus" or "change_bus" when some cooldown applies on the powerline.
- [IMPROVED] clarify documentation of gym compat module (see
https://github.com/rte-france/Grid2Op/issues/372 and
https://github.com/rte-france/Grid2Op/issues/373) as well as the doc
for MultifolderWithCache (see https://github.com/rte-france/Grid2Op/issues/370)

[1.7.2] - 2022-07-05
--------------------
Expand Down Expand Up @@ -84,7 +119,8 @@ Change Log
[1.7.0] - 2022-04-29
---------------------
- [BREAKING] the `L2RPNSandBoxScore`, `RedispReward` and `EconomicReward` now properly computes the cost of the grid
(there was an error between the conversion from MWh - cost is given in $ / MWh - and MW). This impacts also `ScoreICAPS2021` and `ScoreL2RPN2020`.
(there was an error between the conversion from MWh - cost is given in $ / MWh - and MW).
This impacts also `ScoreICAPS2021` and `ScoreL2RPN2020`.
- [BREAKING] in the "gym_compat" module the curtailment action type has
for dimension the number of dispatchable generators (as opposed to all generators
before) this was mandatory to fix issue https://github.com/rte-france/Grid2Op/issues/282
Expand Down Expand Up @@ -181,14 +217,17 @@ Change Log
- [ADDED] a method of the action space to show a list of actions to get back to the original topology
(see https://github.com/rte-france/Grid2Op/issues/275)
`env.action_space.get_back_to_ref_state(obs)`
- [ADDED] a method of the action to store it in a grid2op independant fashion (using json and dictionaries), see `act.as_serializable_dict()`
- [ADDED] possibility to generate a gym `DiscreteActSpace` from a given list of actions (see https://github.com/rte-france/Grid2Op/issues/277)
- [ADDED] a method of the action to store it in a grid2op independant fashion (using json and dictionaries),
see `act.as_serializable_dict()`
- [ADDED] possibility to generate a gym `DiscreteActSpace` from a given list of actions (see
https://github.com/rte-france/Grid2Op/issues/277)
- [ADDED] a class that output a noisy observation to the agent (see `NoisyObservation`): the agent sees
the real values of the environment with some noise, this could used to model inacurate
sensors.
- [IMPROVED] observation now raises `Grid2OpException` instead of `RuntimeError`
- [IMRPOVED] docs (and notebooks) for the "split_train_val" https://github.com/rte-france/Grid2Op/issues/269
- [IMRPOVED] the "`env.split_train_val(...)`" function to also generate a test dataset see https://github.com/rte-france/Grid2Op/issues/276
- [IMRPOVED] the "`env.split_train_val(...)`" function to also generate a test dataset see
https://github.com/rte-france/Grid2Op/issues/276

[1.6.4] - 2021-11-08
---------------------
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,14 @@ The unit tests includes testing, on linux machines the correct integration of gr
- python 3.9
- python 3.10

On all of these cases, we tested grid2op on all available numpy version >= 1.18 (**nb** available numpy versions depend
On all of these cases, we tested grid2op on all available numpy version >= 1.20 (**nb** available numpy versions depend
on python version).

The complete test suit is run on linux with the latest numpy version on python 3.8.

**NB** grid2op should work on python 3.11 but as numba is not (yet) compatible with this python version,
and because numba is used for some tests, we do not test grid2op with python 3.11 yet.

## Known issue

Due to the underlying behaviour of the "multiprocessing" package on windows based python 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.7.2'
release = '1.8.0.rc1'
version = '1.7'


Expand Down
19 changes: 19 additions & 0 deletions docs/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,25 @@ Another way is to use a dedicated class that stores the data in memory. This is
to avoid long and inefficient I/O that are replaced by reading the the complete dataset once and store it
into memory.

.. warning::
When you create an environment with this chronics class (*eg* by doing
`env = make(...,chronics_class=MultifolderWithCache)`), the "cache" is not
pre loaded, only the first scenario is loaded in memory (to save loading time).

In order to load everything, you NEED to call `env.chronics_handler.reset()`, which,
by default, will load every scenario into memory. If you want to filter some
data, for example by reading only the scenario of decembre, you can use the
`set_filter` method.

A typical workflow (at the start of your program) when using this class is then:

1) create the environment: `env = make(...,chronics_class=MultifolderWithCache)`
2) (optional but recommended) select some scenarios:
`env.chronics_handler.real_data.set_filter(lambda x: re.match(".*december.*", x) is not None)`
3) load the data in memory: `env.chronics_handler.reset()`
4) do whatever you want using `env`


This can be achieved with:

.. code-block:: python
Expand Down

0 comments on commit 5a4c89d

Please sign in to comment.