Skip to content

Commit caf5e30

Browse files
committed
start refacto of the doc
1 parent bde7b30 commit caf5e30

32 files changed

+227
-84
lines changed

docs/developer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. toctree::
2+
:maxdepth: 1
3+
4+
developer/env_content
5+
developer/create_an_environment
6+
developer/createbackend
7+
8+
.. include:: final.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/developer/final.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
.. include:: ../final.rst

docs/grid2op.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ competitions.
2626
This platform is still under development. If you notice a bug, let us know with a github issue at
2727
`Grid2Op <https://github.com/rte-france/Grid2Op>`_
2828

29-
.. note:: Grid2op do not model any object on the powergrid. It has no internal modeling of the equations of the
29+
.. note::
30+
Grid2op do not model any object on the powergrid. It has no internal modeling of the equations of the
3031
grids, or what kind of solver you need to adopt.
3132

3233
On the other hand, grid2op aims at representing the grid in a relatively "high level" point of view: it knows
@@ -43,6 +44,7 @@ This platform is still under development. If you notice a bug, let us know with
4344

4445
Objectives
4546
-----------
47+
4648
The primary goal of grid2op is to model decision making process in power systems. Indeed, we believe that developing
4749
new flexibilities on the grid would make the
4850
"energy transition" an easier, less costly process.
@@ -72,7 +74,8 @@ Though grid2op has been primarily developed for the L2RPN competitions series, i
7274
can also help developing and benchmarking new powerflow solvers for example.
7375

7476
Controlling the grid
75-
--------------------
77+
---------------------
78+
7679
Modeling all what happens in the powergrid would be an extremely difficult task. Grid2op focusing on controls
7780
that could be done today by a human (happening with **a frequency of approximately the minute**). It does not
7881
aim at simulation really high frequency control that are often automatic today. That being said, such controls
@@ -107,8 +110,10 @@ Other "flexibilities" (ways to act on the grid) are coming soon (-:
107110
solver uses some physical laws to compute these "weights" from the amount of power produced / absorbed in
108111
different part of the grid where generators and loads are connected).
109112

113+
110114
What is modeled in an grid2op environment
111-
-----------------------------------------
115+
------------------------------------------
116+
112117
The simulator is able to emulate a power grid (of any size or characteristics) subject to a set of
113118
temporal injections (productions and consumptions) or maintenance / hazards for discretized
114119
time-steps (usually there is the equivalent of *5* minutes between two consective steps).
@@ -216,7 +221,8 @@ Module Name Main usage
216221
============================= =========================================================================================
217222

218223
Properties of this environments
219-
-------------------------------
224+
--------------------------------
225+
220226
The grid2op environments have multiple shared properties:
221227

222228
- highly constrained environments: these environments obey physical laws. You cannot directly choose how much
@@ -398,7 +404,7 @@ If it fails between "now" and "12 steps from now" reward associated with alert w
398404
negative (this is the situation where the agent should have told the human operator "help me").
399405

400406

401-
Let's replay again (again ?) the same scenario again: same attack, same everything:
407+
Let's replay again (again ?) the same scenario: same attack, same everything:
402408

403409
.. code-block:: python
404410
@@ -457,7 +463,8 @@ that are available, without any installation thanks to
457463
`Binder <https://mybinder.org/v2/gh/rte-france/Grid2Op/master>`_ . Feel free to visit the "getting_started" page for
458464
more information and a detailed tour about the issue that grid2op tries to address.
459465

460-
.. note:: As of writing (december 2020) most of these notebooks focus on the "agent" part of grid2op. We would welcome
466+
.. note::
467+
As of writing (december 2020) most of these notebooks focus on the "agent" part of grid2op. We would welcome
461468
any contribution to better explain the other aspect of this platform.
462469

463470
.. include:: final.rst

docs/grid2op_dev/final.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
.. include:: ../final.rst

docs/index.rst

Lines changed: 138 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,82 +6,82 @@
66
.. |episode_example| image:: ./img/grid2op_action.jpg
77

88
===============================================
9-
Welcome to Grid2Op's technical documentation!
9+
Welcome to Grid2Op's documentation
1010
===============================================
1111

1212
Grid2Op is a pythonic, easy to use framework, to be able to develop, train or evaluate performances of "agent" or
13-
"controller" that acts on a powergrid in different ways.
13+
"controller" that acts on a powergrid.
1414

15-
It is modular and can be use to train reinforcement learning agent or to assess the performance of optimal control
16-
algorithm.
15+
It is modular and can be use to train reinforcement learning agent or to assess the performance of any kind of
16+
agent controlling powergrids (heuristic, machine learning, optimization, mix of everything etc.)
1717

18-
It is flexible and allows the power flow to be computed by the algorithm of your choice. It abstracts the modification
19-
of a powergrid and use this abstraction to compute the **cascading failures** resulting from powerlines disconnection
20-
for example.
21-
22-
**Features**
23-
24-
- abstract the computation of the "cascading failures"
25-
- ability to have the same code running with multiple powerflows
26-
- parallel execution of one agent / controller on multiple independent scenarios (multiprocessing)
27-
- fully customisable: this software has been built to be fully customizable to serve different
28-
purposes and not only reinforcement learning, or the L2RPN competition.
18+
It is highly flexible and can be modified in different ways.
2919

3020
Grid2Op philosophy
3121
--------------------
3222
Grid2Op is a python module that aims to make easier the research on sequential decision making applied to power systems.
3323

34-
This package adopt the "reinforcement learning" point of view and is compatible with the openAI gym programming
35-
interface (see section :ref:`openai-gym` for more information).
24+
This package adopt the "sequential decision making" point of view, for example suited
25+
for training and evaluation "reinforcement learning" agents.
3626

37-
Applied to power system, the "reinforcement learning" framework ask:
27+
It is made of 4 main blocks:
3828

39-
- a "controller" (named Agent) to take an "action" on the powergrid (for example for L2RPN competitions in 2019
40-
and 2020 these actions consist in modifying the connectivity of the powergrid).
41-
- the "environment" (*a.k.a* the "real world") applies that action on the powergrid, applies some other modifications
42-
and return the next state.
29+
- a module that will embed all the "external" / "exogenous" data, called the "time series" (formelly call "chronics").
30+
This module for example contain the variation of each and generators.
31+
- a module that will compute the "powerflows", called "backend". It is important to note that grid2op itself
32+
assumes nothing on the powergrid. And in theory you can use any solver that you want to compute the state of
33+
the grid (static / steady state or dynamic / transient or DC modeling or AC modeling etc. with trafo being modled in `T` or in `Pi`)
34+
- a module that "takes decision", called "action" on the grid based on the current grid state, called "observation" and
35+
possible future forecasted grid states
36+
- a module that wrap all the above together and implements a few other feature such as making sure provided actions are "legal"
37+
(meet certain rules) or even emulating (if the module that compute the grid states does not do it) the behaviour of some
38+
"protections".
4339

44-
The goal of grid2op is to model "sequential decision making" that could be made by human operators, for example
45-
changing the configuration of some "substations" as demonstrate in the figure below:
40+
The goal of grid2op is to model "sequential decision making" that could be made by
41+
human operators, for example changing the configuration of some "substations"
42+
as demonstrate in the figure below:
4643

4744
|episode_example|
4845

49-
Any kind of "controller" can be implemented using this framework even though it has been inspired by the
50-
"reinforcement learning" community. You can implement some heuristic "controllers" (some examples are available in the
51-
:ref:`agent-module` module description), "controllers" that comes from the Optimization community
52-
(for example "Optimal Power Flow") or
53-
"Model Predictive Control". One of the goal of Grid2Op is to allow everyone to contribute to closing the gap
54-
between all these research communities.
46+
.. note::
47+
Any kind of "controller" can be implemented using this framework even though it has been inspired by the
48+
"reinforcement learning" community. You can implement some heuristic "controllers" (some examples are available in the
49+
:ref:`agent-module` module description), "controllers" that comes from the Optimization community
50+
(for example "Optimal Power Flow") or
51+
"Model Predictive Control". One of the goal of Grid2Op is to allow everyone to contribute to closing the gap
52+
between all these research communities.
53+
54+
.. note::
55+
Consecutive steps are "correlated" in the sense that the action taken
56+
at time `t` is part of the process that defines the state observed at
57+
step `t+1`. More information on this is given in the
58+
:ref:`mdp-doc-module` for example.
59+
5560

5661
Main module content
5762
---------------------
5863

64+
This is where you can go if you want some quick introduction about grid2op
65+
or overall view of what is happing when you "run" a scenario using in grid2op.
66+
5967
.. toctree::
60-
:maxdepth: 2
61-
:caption: Quickstart
68+
:maxdepth: 1
69+
:caption: Overview
6270

6371
quickstart
6472
grid2op
6573

66-
Environments
67-
---------------
68-
.. toctree::
69-
:maxdepth: 2
70-
:caption: Focus on an "environment"
71-
72-
available_envs
73-
makeenv
74-
env_content
75-
create_an_environment
76-
dive_into_time_series
77-
data_pipeline
78-
troubleshoot
79-
8074
Usage examples
8175
---------------------
76+
77+
On this part of the documentation we focus on some usage of grid2op in different
78+
context, for example using optimization or when "wrapping" grid2op into
79+
a gymnsium compatible environment (with only subset of grid2op capabilities)
80+
to ease training of reinforcement learning agents.
81+
8282
.. toctree::
83-
:maxdepth: 2
84-
:caption: Learn by Example
83+
:maxdepth: 1
84+
:caption: Learn with examples
8585

8686
optimization
8787
gym
@@ -91,49 +91,112 @@ Usage examples
9191
Modeling
9292
----------
9393

94+
This part of the documentation focuses on the different
95+
"model" in grid2op. You can find the formal definition
96+
(or at least an attempt at such) for the "Markov Decision Process"
97+
(a mathematical framework used to model sequential decisions making) and
98+
the how the elements accessible in the observation or modifiable in
99+
the action of the agent are represented.
100+
101+
You can also find some discussion about the topology of the grid (one
102+
of the focus of grid2op) and the representation of the grid as a
103+
graph.
104+
94105
.. toctree::
95-
:maxdepth: 2
106+
:maxdepth: 1
96107
:caption: Models
97108

98109
mdp
99110
modeled_elements
100111
grid_graph
112+
topology
113+
114+
Environments
115+
---------------
116+
117+
Here we try to explain rapidly how to load pre existing environment and how some
118+
customization can make grid2op faster (depending on the context)
119+
120+
.. toctree::
121+
:maxdepth: 1
122+
:caption: Focus on an "environment"
123+
124+
available_envs
125+
makeenv
126+
dive_into_time_series
127+
data_pipeline
128+
troubleshoot
101129

102130
Plotting capabilities
103131
----------------------
104132

133+
Some plotting capabilities of grid2op.
134+
135+
.. warning::
136+
This has not been updated
137+
for a long time and is maybe not up to date.
138+
105139
.. toctree::
106-
:maxdepth: 2
140+
:maxdepth: 1
107141
:caption: Plot
108142

109143
plot
110144

111-
Technical Documentation
112-
----------------------------
145+
Technical documentation for grid2op users
146+
-------------------------------------------
147+
148+
This part of the documentation is dedicated to grid2op users. It
149+
covers detailed description of all the modules, classes and their main method
150+
that you, as a user, can use in grid2op.
151+
152+
The documentation there is mainly descirptive. It explains what is done but
153+
avoid (in general) getting in "too much gory details" on how these
154+
things are done.
155+
156+
As a starting point, we suggest you first look here before diving more
157+
deeply into the other section of the documentation.
113158

114159
.. toctree::
115-
:maxdepth: 2
116-
:caption: Technical Documentation
117-
118-
action
119-
agent
120-
backend
121-
chronics
122-
converter
123-
createbackend
124-
environment
125-
episode
126-
exception
127-
observation
128-
opponent
129-
parameters
130-
reward
131-
rules
132-
runner
133-
simulator
134-
space
135-
timeserie_handlers
136-
utils
137-
voltagecontroler
160+
:maxdepth: 1
161+
:caption: Technical documentation for grid2op users
162+
163+
user
164+
165+
External contribution technical Documentation
166+
------------------------------------------------
167+
168+
This part of the documentation is focued on external contribution.
169+
It is best suited if you want to use grid2op as a "core" and extend / modify
170+
it with different elements.
171+
172+
For example, you might want to :
173+
- use a different solver to compute powerflows
174+
(called :class:`grid2op.Backend.Backend` in grid2op)
175+
- create a new environment
176+
- load time series from a different format than the grid2op default csv
177+
- have an opponent that act differently than the provided ones
178+
- evaluate the performance of the agent differently (change the reward / score function)
179+
- use a different way to control the voltages
180+
- etc.
181+
182+
The main focuse of these pages of the documentation is put on the
183+
interface and still avoid getting into too much detail on how things
184+
are done internally whenever possible.
185+
186+
This is the type of documentation you should be looking at if the
187+
current grid2op modelling statisfies you in its vast majority
188+
but if you want to slightly modify one of its component
189+
190+
.. toctree::
191+
:maxdepth: 1
192+
:caption: Technical documentation for grid2op external contributors
193+
194+
developer
195+
196+
Developer technical Documentation
197+
-----------------------------------
198+
199+
200+
DOC IN PROGRESS...
138201

139202
.. include:: final.rst

docs/topology.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
3+
.. _topology-module:
4+
5+
Dive into the topology "modeling" in grid2op
6+
===================================================================
7+
8+
.. warning::
9+
Work in progress
10+
11+
What do we call topology
12+
---------------------------------
13+
14+
How it is accessible in grid2op
15+
---------------------------------
16+
17+
The "topo_vect" vector
18+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19+
20+
In the observation
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
23+
In the action
24+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
26+
Relation with real powergrids
27+
---------------------------------
28+
29+
.. include:: final.rst
30+

0 commit comments

Comments
 (0)