Skip to content

Commit

Permalink
Merge pull request #176 from BDonnot/master
Browse files Browse the repository at this point in the history
Moving to version 1.5.0
  • Loading branch information
BDonnot committed Mar 31, 2021
2 parents bf0c1db + 0788032 commit 74e93e3
Show file tree
Hide file tree
Showing 304 changed files with 36,911 additions and 4,162 deletions.
141 changes: 123 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,130 @@
version: 2.1

executors:
grid2op-executor:
docker:
- image: bdonnot/grid2op:test
working_directory: /Grid2Op
grid2op-executor:
docker:
- image: bdonnot/grid2op:test
working_directory: /Grid2Op
python36:
docker:
- image: python:3.6-slim-buster
python37:
docker:
- image: python:3.7-slim-buster
python38:
docker:
- image: python:3.8-slim-buster
python39:
docker:
- image: python:3.9-slim-buster

jobs:
test:
executor: grid2op-executor
parallelism: 4
steps:
- checkout
- run:
command: |
cd grid2op/tests/
python3 helper_list_test.py | circleci tests split > /tmp/tests_run
python3 -m unittest $(cat /tmp/tests_run)
test:
executor: grid2op-executor
parallelism: 4
steps:
- checkout
- run:
command: |
cd grid2op/tests/
python3 helper_list_test.py | circleci tests split > /tmp/tests_run
python3 -m unittest $(cat /tmp/tests_run)
install36:
executor: python36
steps:
- checkout
- run: python -m pip install virtualenv
- run: python -m virtualenv venv_test
- run:
command: |
source venv_test/bin/activate
pip install -U numba
pip install -U "numpy>=1.18,<1.19"
pip install -U .[test]
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.19,<1.20"
pip install -U .[test]
grid2op.testinstall
install37:
executor: python37
steps:
- checkout
- run: python -m pip install virtualenv
- run: python -m virtualenv venv_test
- run:
command: |
source venv_test/bin/activate
pip install -U numba
pip install -U "numpy>=1.18,<1.19"
pip install -U .[test]
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.19,<1.20"
pip install -U .[test]
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.20,<1.21"
pip install -U .[test]
grid2op.testinstall
install38:
executor: python38
steps:
- checkout
- run: python -m pip install virtualenv
- run: python -m virtualenv venv_test
- run:
command: |
source venv_test/bin/activate
pip install -U numba
pip install -U "numpy>=1.18,<1.19"
pip install -U .[test]
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.19,<1.20"
pip install -U .[test]
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.20,<1.21"
pip install -U .[test]
grid2op.testinstall
install39:
executor: python39
steps:
- checkout
- run: python -m pip install virtualenv
- run: python -m virtualenv venv_test
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.19,<1.20"
pip install -U .[test]
grid2op.testinstall
- run:
command: |
source venv_test/bin/activate
pip install -U "numpy>=1.20,<1.21"
pip install -U .[test]
grid2op.testinstall
workflows:
version: 2.1
test:
jobs:
- test
version: 2.1
test:
jobs:
- test
install:
jobs:
- install36
- install37
- install38
- install39
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ getting_started/saved_experiment_donothing/
Doxyfile
documentation
**(copie).zip
**(copy).json
grid2op/data/*/*.csv
!grid2op/data/test_PandaPower/prods_charac.csv
!grid2op/data/case14_redisp/prods_charac.csv
!grid2op/data/*/prods_charac.csv
!grid2op/data/*/storage_units_charac.csv
**token.json
getting_started/study_agent_getting_started/
**Untitled.ipynb
Expand Down Expand Up @@ -261,6 +263,41 @@ test_weights_focus.jpg
test_weights_full.jpg
times_api.txt
new 1.txt
test_*_weigths.h5
test_saving_spektral.h5
tf_logs_gnn/
test_weigths.h5
test_threading_lightsim.py
test_multiprocessing.py
test_plot_storage.ipynb
issue_pp_storage.py
test_speed_obs_plus_act.py
test_filter_act.py
speed_up_multiproc.ods
test_issue_169.py
cut_data.py
getting_started/Dev_Curtailment.ipynb
grid2op/tests/dict_action_space.json
grid2op/tests/dict_attack_space.json
grid2op/tests/dict_env_modification_space.json
grid2op/tests/dict_observation_space.json
grid2op/tests/test_before_push
getting_started/saved_agent2_DDDQN_75/
getting_started/saved_agent2_DDDQN_75_results/
getting_started/saved_agent_DDDQN_50/
getting_started/saved_agent_DDDQN_50_results/
getting_started/saved_agent_DDDQN_BDA_60/
getting_started/saved_agent_DDDQN_BDA_60_results/
getting_started/path_agents/awesome_agent_logs/000/episode.gif
grid2op/data/update_envs_ls.py
grid2op/data_save
test_rllib2.py
grid2op/tests/res_test
test_bug_macos.py
pp_error_non_connected_grid.py
test_issue174.py
actions2.npy
bug_discord_0.py

# profiling files
**.prof
97 changes: 87 additions & 10 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,103 @@ Change Log
[TODO]
--------------------
- [???] add multi agent
- [???] model curtailment
- [???] better logging
- [???] model batteries / pumped storage in grid2op (generator but that can be charged / discharged)
- [???] shunts in observation too, for real (but what to do when backend is not shunt compliant to prevent the
stuff to break)
- [???] model agent acting at different time frame
- [???] model delay in observations
- [???] model delay in action
- [???] Code and test the "load from disk" method
- [???] Make the redispatching data independant from the time step (eg instead of "in MW / step" have it in "MW / h"
and have grid2op convert it to MW / step
- [???] Extensive tests for BridgeReward
- [???] Extensive tests for DistanceReward
- [???] in the observation, make the possibility to retrieve the "active flow graph" (ie graph with edges having active
flows, and nodes the active production / consumption) and "reactive flow graph"
- [???] add a "plot action" method
- [???] simulate in MultiEnv
- [???] in MultiEnv, when some converter of the observations are used, have each child process to compute
it in parallel and transfer the resulting data.
- [???] "asynch" multienv
- [???] properly model interconnecting powerlines
- [???] model agent acting at different time frame
- [???] model delay in observations
- [???] model delay in action
- [???] model dams in grid2op (stuff that have a given energy max, and cannot produce more than
the available energy)

[1.5.0] - 2021-xx-yy
-------------------------
- [BREAKING] `backend.check_kirchoff()` method now returns also the discrepancy in the voltage magnitude
and not only the error in the P and Q injected at each bus.
- [BREAKING] the class method "to_dict" used to serialize the action_space and observation_space has been
renamed `cls_to_dict` to avoid confusion with the `to_dict` method of action and observation (that stores,
as dictionary the instance of the action / observation). It is now then possible to serialize the action class
used and the observation class used as dictionary to (using `action.cls_to_dict`)
- [BREAKING] for backend class implementation: need to upgrade your code to take into account the storage units
if some are present in the grid even if you don't want to use storage units.
- [BREAKING] the backend `runpf` method now returns a flag indicating if the simulation was successful AND (new)
the exception in case there are some (it now returns a tuple). This change only affect new Backends.
- [BREAKING] rename the attribute "parameters" of the "observation_space" to `_simulate_parameters` to avoid
confusion with the `parameters` attributes of the environment.
- [BREAKING] change of behaviour of the `env.parameters` attribute behaviour. It is no more possible to
modified it with `env.parameters = ...` and the `env.parameters.PARAM_ATTRIBUTE = xxx` will have not effect
at all. Use `env.change_parameters(new_parameters)` for changing the environment parameters and
`env.change_forecast_parameters(new_param_for_simulate)` for changing the parameters used for simulate.
(**NB** in both case you need to perform a "env.reset()" for the new parameters to be used. Any attempt to use
an environment without a call to 'env.reset()' will lead to undefined behaviour).
- [BREAKING] `env.obs_space.rewardClass` is not private and is called `env.obs_space._reward_func`. To change
this function, you need to call `env.change_reward(...)`
- [BREAKING] more consistency in the observation attribute names, they are now `gen_p`, `gen_q` and `gen_v`
instead of `prod_p`, `prod_q` and `prod_v` (old names are still accessible for backward compatibility
in the observation space) but
conversion to json / dict will be affected as well as the converters (*eg* for gym compatibility)
- [FIXED] `Issue #164 <https://github.com/rte-france/Grid2Op/issues/164>`_: reward is now properly computed
at the end of an episode.
- [FIXED] A bug where after running a Runner, the corresponding EpisodeData's CollectionWrapper where not properly updated,
and did not contain any objects.
- [FIXED] A bug when the opponent should chose an attack with all lines having flow 0, but one being still connected.
- [FIXED] An error in the `obs.flow_bus_matrix` when `active_flow=False` and there were shunts on the
powergrid.
- [FIXED] `obs.connectivity_matrix` now properly takes into account when two objects are disconnected (before
it was as if there were connected together)
- [FIXED] some surprising behaviour when using `obs.simulate` just before or just after a planned
maintenance operation.
- [FIXED] a minimal bug in the `env.copy` method (the wrong simulated backend was used in the observation at
right after the copy).
- [FIXED] a bug in the serialization (as vector) of some action classes, namely: `PowerlineSetAction` and
`PowerlineSetAndDispatchAction` and `PowerlineChangeDispatchAndStorageAction`
- [FIXED] a bug preventing to use the `obs.XXX_matrix()` function twice
- [FIXED] issue `Issue #172 <https://github.com/rte-france/Grid2Op/issues/172>`_: wrong assertion was made preventing
the use of `env.train_val_split_random()`
- [FIXED] issue `Issue #173 <https://github.com/rte-france/Grid2Op/issues/173>`_: a full nan vector could be
converted to action or observation without any issue if it had the proper dimension. This was due to a conversion
to integer from float.
- [FIXED] an issue preventing to load the grid2op.utils submodule when installed not in "develop" mode
- [FIXED] some issue with the multiprocessing of the runner on windows
- [ADDED] more complete documentation for the runner.
- [ADDED] a convenient function to evaluate the impact (especially on topology) of an action on a state
(`obs + act`)
- [ADDED] a property to retrieve the thermal limits from the observation.
- [ADDED] documentation of the main elements of the grid and their "modeling" in grid2op.
- [ADDED] parameters are now checked and refused if not valid (a RuntimeError is raised)
- [ADDED] support for storage unit in grid2op (analog as a "load" convention positive: power absorbed from the grid,
negative: power given to the grid having some energy limit and power limit). A new object if added in the substation.
- [ADDED] Support for sparse matrices in `obs.bus_connectivity_matrix`
- [ADDED] In the observation, it is now possible to retrieve the "active flow graph" (ie graph with edges having active
flows, and nodes the active production / consumption) and "reactive flow graph" (see `flow_bus_matrix`)
- [ADDED] more consistent behaviour when using the action space across the different type of actions.
Now it should understand much more way to interact with it.
- [ADDED] lots of action properties to manipulate action in a more pythonic way, for example using
`act.load_set_bus = ...` instead of the previously way more verbose `act.update({"set_bus": {"loads_id": ...}}`
(this applies for `load`, `gen`, `storage`, `line_or` and `line_ex` and to `set_bus` and `change_bus` and
also to `storage_p` and `redispatch` so making 12 "properties" in total)
- [ADDED] an option to retrieve in memory the `EpisodeData` of each episode computed when using the runner.
see `runner.run(..., add_detailed_output=True)`
- [ADDED] the option `as_csr_matrix` in `obs.connectivity_matrix` function
- [ADDED] convenient option to get the topology of a substation from an observation (`obs.sub_topology(sub_id=...)`)
- [ADDED] some basic tests for the environments shipped with grid2op.
- [ADDED] grid2op now ships with the `l2rpn_case14_sandbox` environment
- [ADDED] a function to list environments available for testing / illustration purpose.
- [ADDED] a function of the observation to convert it to a networkx graph (`obs.as_networkx()`)
- [ADDED] support for curtailment feature in grid2op (curtailment on the renewable generator units).
- [ADDED] better backward compatibility when reading data generated with previous grid2op version.
- [IMPROVED] simplify the interface for the gym converter.
- [IMPROVED] simplify the interface for the `env.train_val_split` and `env.train_val_split_random`
- [IMPROVED] print of an action now limits the number of decimal for redispatching and storage units

[1.4.0] - 2020-12-10
----------------------
Expand Down Expand Up @@ -527,7 +604,7 @@ Change Log
- [UPDATED] Notebook 6 to train agent more efficiently (example: prediction of actions in batch)
- [UPDATED] PlotGraph to derive from `GridObjects` allowing to be inialized at creation and not when first
observation is loaded (usable without observation)
- [UPDATED] new default environment (`case14_relistic`)
- [UPDATED] new default environment (`case14_realistic`)
- [UPDATED] data for the new created environment.
- [UPDATED] implement redispatching action in `obs.simulate`
- [UPDATED] refactoring `Environment` and `ObsEnv` to inherit from the same base class.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
recursive-include grid2op/data/ *.bz2 *.json *.zip prods_charac.csv *.py .multimix
recursive-include grid2op/data *.bz2 *.json *.zip prods_charac.csv *.py .multimix storage_units_charac.csv start_datetime.info time_interval.info
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

#cmd windows: > sphinx-build -M html docs documentation
# cmd for pdf > make latexpdf

0 comments on commit 74e93e3

Please sign in to comment.