Skip to content

Commit

Permalink
Merge pull request #23 from BDonnot/redispatching_integration
Browse files Browse the repository at this point in the history
Redispatching integration
  • Loading branch information
BDonnot authored Jan 23, 2020
2 parents 4542aec + f5153a8 commit 66d2466
Show file tree
Hide file tree
Showing 263 changed files with 9,677 additions and 1,684 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,4 @@ grid2op/data/*/*.csv
getting_started/study_agent_getting_started/
**Untitled.ipynb
grid2op/tests/test_agent/
grid2op/tests/start_datetime.info
62 changes: 45 additions & 17 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
Change Log
=============

[0.5.0] - 2020-01-23
--------------------
- [BREAKING] Action/Backend has been modified with the implementation of redispatching. If
you used a custom backend, you'll have to implement the "redispatching" part.
- [BREAKING] with the introduction of redispatching, old action space and observation space,
stored as json for example, will not be usable: action size and observation size
have been modified.
- [ADDED] A converter class that allows to pre-process observation, and post-process action
when given to an `Agent`. This allows for more flexibility in the `action_space` and
`observation_space`.
- [ADDED] Adding another example notebook `getting_started/Example_5bus.ipynb`
- [ADDED] Adding another renderer for the live environment.
- [ADDED] Redispatching possibility for the environment
- [ADDED] More complete documentation of the representation of the powergrid
(see documentation of `Space`)
- [FIXED] A bug in the conversion from pair unit to kv in pandapower backend. Adding some tests for that too.
- [UPDATED] More complete documentation of the Action class (with some examples)
- [UPDATED] More unit test for observations
- [UPDATED] Remove the TODO's already coded
- [UPDATED] GridStateFromFile can now read the starting date and the time interval of the chronics.
- [UPDATED] Documentation of Observation: adding the units
(`issue 22 <https://github.com/rte-france/Grid2Op/issues/22>`_)
- [UPDATED] Notebook `getting_started/4_StudyYourAgent.ipynb` to use the converter now (much shorter and clearer)

[0.4.3] - 2020-01-20
--------------------
- [FIXED] Bug in L2RPN2019 settings, that had not been modified after the changes of version 0.4.2.

[0.4.2] - 2020-01-08
--------------------
- [FIXED] Runner cannot save properly action and observation (sizes are not computed properly)
**now fixed and unit test added**
- [FIXED] Plot utility has a bug in extracting grid information.
**now fixed**
- [FIXED] gym compatibility issue for environment
- [FIXED] checking key-word arguments in "make" function: if an invalid argument is provided,
it now raises an error.
- [UPDATED] multiple random generator streams for observations
- [UPDATED] Refactoring of the Action and Observation Space. They now both ineherit from "Space"
- [BREAKING] previous saved Action Spaces and Observation Spaces (as dictionnary) are no more compatible
- [BREAKING] renaming of attributes describing the powergrid accross classes for better consistency:
- [BREAKING] renaming of attributes describing the powergrid across classes for better consistency:

==================== ======================= =======================
Class Name Old Attribute Name New Attribute Name
Expand Down Expand Up @@ -42,7 +61,16 @@ Action / Observation _lines_ex_pos_topo_vect lines_ex_pos_topo_vect
GridValue n_lines n_line
==================== ======================= =======================

- [UPDATE] the getting_started notebooks to reflect these changes
- [FIXED] Runner cannot save properly action and observation (sizes are not computed properly)
**now fixed and unit test added**
- [FIXED] Plot utility has a bug in extracting grid information.
**now fixed**
- [FIXED] gym compatibility issue for environment
- [FIXED] checking key-word arguments in "make" function: if an invalid argument is provided,
it now raises an error.
- [UPDATED] multiple random generator streams for observations
- [UPDATED] Refactoring of the Action and Observation Space. They now both inherit from "Space"
- [UPDATED] the getting_started notebooks to reflect these changes

[0.4.1] - 2019-12-17
--------------------
Expand All @@ -52,25 +80,25 @@ GridValue n_lines n_line
[0.4.0] - 2019-12-04
--------------------
- [ADDED] Basic tools for plotting with the `PlotPlotly` module
- [UPDATED] handling of the `AmbiguousAction` and `IllegalAction` exceptions (and appropriated tests)
- [ADDED] support of maintenance operation as well as hazards in the Observation (and appropriated tests)
- [ADDED] support for maintenance operation in the Environment (read from the chronics)
- [ADDED] example of chronics with hazards and maintenance
- [UPDATED] handling of the `AmbiguousAction` and `IllegalAction` exceptions (and appropriated tests)
- [UPDATED] various documentation, in particular the class Observation
- [UPDATED] information retrievable `Observation.state_of`
- [ADDED] example of chronics with hazards and maintenance

[0.3.6] - 2019-12-01
--------------------
- [UPDATED] Readme with docker
- [ADDED] functionality to restrict action based on previous actions
(impacts `Environment`, `GameRules` and `Parameters`)
- [ADDED] tests for the notebooks in `getting_started`
- [UPDATED] readme to properly show the docker capability
- [UPDATED] Readme with docker

[0.3.5] - 2019-11-28
--------------------
- [ADDED] serialization of the environment modifications
- [FIXED] error messages in `grid2op.GridValue.check_validity`
- [ADDED] the changelog file
- [UPDATED] notebook getting_started/4_StudyYourAgent.ipynb to reflect these changes
- [ADDED] serialization of hazards and maintenance in actions (if any)
- [ADDED] serialization of hazards and maintenance in actions (if any)
- [FIXED] error messages in `grid2op.GridValue.check_validity`
- [UPDATED] notebook `getting_started/4_StudyYourAgent.ipynb` to reflect these changes
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
author = 'Benjamin Donnot'

# The full version, including alpha/beta/rc tags
release = '0.4.3'
version = '0.4'
release = '0.5.0'
version = '0.5'


# -- General configuration ---------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions docs/converters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Converters
===================================
.. automodule:: grid2op.Converters
:members:
:private-members:

.. include:: final.rst
11 changes: 11 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ Main module content
quickstart
grid2op
makeenv


Plotting capabilities
----------------------

.. toctree::
:maxdepth: 1

pltgraph
pltplotly
pltpygame

Technical Documentation
----------------------------
Expand All @@ -43,6 +53,7 @@ Technical Documentation
:maxdepth: 1

action
converters
agent
backend
backendpp
Expand Down
8 changes: 8 additions & 0 deletions docs/pltgraph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Basic plotting utilities
===================================

.. automodule:: grid2op.PlotGraph
:members:
:special-members:

.. include:: final.rst
2 changes: 1 addition & 1 deletion docs/pltplotly.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Basic plotting utilities
Interactive plot with plotly
===================================

.. automodule:: grid2op.PlotPlotly
Expand Down
8 changes: 8 additions & 0 deletions docs/pltpygame.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Renderer with pygame
===================================

.. automodule:: grid2op.PlotPyGame
:members:
:special-members:

.. include:: final.rst
19 changes: 14 additions & 5 deletions getting_started/0_basic_functionalities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pygame 1.9.6\n",
"Hello from the pygame community. https://www.pygame.org/contribute.html\n"
]
}
],
"source": [
"import os\n",
"import sys\n",
Expand Down Expand Up @@ -520,7 +529,7 @@
"output_type": "stream",
"text": [
"This agent managed to survive 11 timesteps\n",
"It's final cumulated reward is 11.0\n"
"It's final cumulated reward is 219.99783718276583\n"
]
}
],
Expand Down Expand Up @@ -613,7 +622,7 @@
"output_type": "stream",
"text": [
"The results are:\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/1\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/2\n",
"\t\t - cumulative reward: 10.00\n",
"\t\t - number of time steps completed: 10 / 10\n"
]
Expand Down Expand Up @@ -645,7 +654,7 @@
"output_type": "stream",
"text": [
"The results are:\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/1\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/2\n",
"\t\t - cumulative reward: 10.00\n",
"\t\t - number of time steps completed: 10 / 10\n"
]
Expand Down Expand Up @@ -687,7 +696,7 @@
"output_type": "stream",
"text": [
"The results are:\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/1\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/2\n",
"\t\t - cumulative reward: 10.00\n",
"\t\t - number of time steps completed: 10 / 10\n"
]
Expand Down
36 changes: 24 additions & 12 deletions getting_started/1_Observation_Agents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"pygame 1.9.6\n",
"Hello from the pygame community. https://www.pygame.org/contribute.html\n"
]
}
],
"source": [
"import os\n",
"import sys\n",
Expand Down Expand Up @@ -389,9 +398,9 @@
"text": [
"Loads active consumption: [18.8 85.1 13.8 44.3 7.1 10.2 27.1 8.2 3.2 5.7 11.8]\n",
"Loads reactive consumption: [47.13340788 58.60853089 14.68417071 23.59794742 -0.49975794]\n",
"Loads voltage (voltage magnitude of the bus to which it is connected) : [141.075 0.21788455 0.21533202 0.21830444 0.21692824\n",
" 0.2111932 137.68220138 0.22256 14.72610185 13.08\n",
" 0.21591106]\n"
"Loads voltage (voltage magnitude of the bus to which it is connected) : [141.075 136.35 0.2111932 136.42874991 137.68220138\n",
" 0.22256 0.21591106 0.21533202 0.21788455 0.21830444\n",
" 0.21692824]\n"
]
}
],
Expand Down Expand Up @@ -577,9 +586,9 @@
" 1.31000000e+01, 6.01000000e+01, 9.50000000e+00, 3.15000000e+01,\n",
" 4.90000000e+00, 7.10000000e+00, 1.91000000e+01, 5.80000000e+00,\n",
" 2.20000000e+00, 4.00000000e+00, 8.40000000e+00, 1.41075000e+02,\n",
" 2.17884546e-01, 2.15332022e-01, 2.18304445e-01, 2.16928244e-01,\n",
" 2.11193196e-01, 1.37682201e+02, 2.22560000e-01, 1.47261019e+01,\n",
" 1.30800000e+01, 2.15911056e-01, 1.08718903e+02, 4.07658248e+01,\n",
" 1.36350000e+02, 2.11193196e-01, 1.36428750e+02, 1.37682201e+02,\n",
" 2.22560000e-01, 2.15911056e-01, 2.15332022e-01, 2.17884546e-01,\n",
" 2.18304445e-01, 2.16928244e-01, 1.08718903e+02, 4.07658248e+01,\n",
" -8.32701461e+00, 4.06838088e-01, -1.65603459e+01, 3.00462070e+00,\n",
" 1.37826937e+01, 4.38146976e+01, 2.86127910e+01, 1.54475549e+01,\n",
" -1.88518005e+01, -5.44944509e+01, 2.03193013e+01, 8.80848061e+00,\n",
Expand Down Expand Up @@ -676,7 +685,10 @@
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00])"
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
" 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,\n",
" 0.00000000e+00, 0.00000000e+00])"
]
},
"execution_count": 12,
Expand Down Expand Up @@ -1076,7 +1088,7 @@
"output_type": "stream",
"text": [
"The results for DoNothing agent are:\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/1\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/2\n",
"\t\t - cumulative reward: 199.998003\n",
"\t\t - number of time steps completed: 10 / 10\n"
]
Expand Down Expand Up @@ -1116,7 +1128,7 @@
"output_type": "stream",
"text": [
"The results for the custom agent are:\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/1\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/2\n",
"\t\t - cumulative reward: 199.998003\n",
"\t\t - number of time steps completed: 10 / 10\n"
]
Expand Down Expand Up @@ -1160,8 +1172,8 @@
"output_type": "stream",
"text": [
"The results for the PowerLineSwitch agent are:\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/1\n",
"\t\t - cumulative reward: 199.998134\n",
"\tFor chronics located at /home/donnotben/.local/lib/python3.6/site-packages/grid2op/data/test_multi_chronics/2\n",
"\t\t - cumulative reward: 199.998150\n",
"\t\t - number of time steps completed: 10 / 10\n"
]
}
Expand Down
Loading

0 comments on commit 66d2466

Please sign in to comment.