Skip to content

Commit

Permalink
Merge pull request #188 from BDonnot/bd_dev
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
BDonnot authored Feb 29, 2024
2 parents b8d13e0 + 46adcde commit 3a36498
Show file tree
Hide file tree
Showing 20 changed files with 1,632 additions and 48 deletions.
326 changes: 326 additions & 0 deletions docs/_static/hacks.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
/*
* CSS hacks and small modification for my Sphinx website
* :copyright: Copyright 2013-2016 Lilian Besson
* :license: GPLv3, see LICENSE for details.
*/


/* Colors and text decoration.
For example, :black:`text in black` or :blink:`text blinking` in rST. */

.black {
color: black;
}

.gray {
color: gray;
}

.grey {
color: gray;
}

.silver {
color: silver;
}

.white {
color: white;
}

.maroon {
color: maroon;
}

.red {
color: red;
}

.magenta {
color: magenta;
}

.fuchsia {
color: fuchsia;
}

.pink {
color: pink;
}

.orange {
color: orange;
}

.yellow {
color: yellow;
}

.lime {
color: lime;
}

.green {
color: green;
}

.olive {
color: olive;
}

.teal {
color: teal;
}

.cyan {
color: cyan;
}

.aqua {
color: aqua;
}

.blue {
color: blue;
}

.navy {
color: navy;
}

.purple {
color: purple;
}

.under {
text-decoration: underline;
}

.over {
text-decoration: overline;
}

.blink {
text-decoration: blink;
}

.line {
text-decoration: line-through;
}

.strike {
text-decoration: line-through;
}

.it {
font-style: italic;
}

.ob {
font-style: oblique;
}

.small {
font-size: small;
}

.large {
font-size: large;
}

.smallpar {
font-size: small;
}


/* Style pour les badges en bas de la page. */

div.supportBadges {
margin: 1em;
text-align: right;
}

div.supportBadges ul {
padding: 0;
display: inline;
}

div.supportBadges li {
display: inline;
}

div.supportBadges a {
margin-right: 1px;
opacity: 0.6;
}

div.supportBadges a:hover {
opacity: 1;
}


/* Details elements in the sidebar */

a.reference {
border-bottom: none;
text-decoration: none;
}

ul.details {
font-size: 80%;
}

ul.details li p {
font-size: 85%;
}

ul.externallinks {
font-size: 85%;
}


/* Pour le drapeau de langue */

img.languageswitch {
width: 50px;
height: 32px;
margin-left: 5px;
vertical-align: bottom;
}

div.sphinxsidebar {
overflow: hidden !important;
font-size: 120%;
word-wrap: break-word;
width: 300px;
max-width: 300px;
}

div.sphinxsidebar h3 {
font-size: 125%;
}

div.sphinxsidebar h4 {
font-size: 110%;
}

div.sphinxsidebar a {
font-size: 85%;
}


/* Image style for scrollUp jQuery plugin */

#scrollUpLeft {
bottom: 50px;
left: 260px;
height: 38px;
width: 38px;
background: url('//perso.crans.org/besson/_images/.top.svg');
background: url('../_images/.top.svg');
}

@media screen and (max-width: 875px) {
#scrollUpLeft {
right: 50px;
left: auto;
}
}


/* responsive for font-size. */

@media (max-width: 875px) {
body {
font-size: 105%;
/* Increase font size for responsive theme */
}
}

@media (max-width: 1480px) and (min-width: 876px) {
body {
font-size: 110%;
/* Increase font size for not-so-big screens */
}
}

@media (min-width: 1481px) {
body {
font-size: 115%;
/* Increase even more font size for big screens */
}
}


/* Social Icons in the sidebar (available: twitter, facebook, linkedin, google+, bitbucket, github) */

.social-icons {
display: inline-block;
margin: 0;
text-align: center;
}

.social-icons a {
background: none no-repeat scroll center top #444444;
border: 1px solid #F6F6F6;
border-radius: 50% 50% 50% 50%;
display: inline-block;
height: 35px;
width: 35px;
margin: 0;
text-indent: -9000px;
transition: all 0.2s ease 0s;
text-align: center;
border-bottom: none;
}

.social-icons li {
display: inline-block;
list-style-type: none;
border-bottom: none;
}
.social-icons li a {
border-bottom: none;
}

.social-icons a:hover {
background-color: #666666;
transition: all 0.2s ease 0s;
text-decoration: none;
}

.social-icons a.facebook {
background-image: url('../_images/.facebook.png');
background-image: url('//perso.crans.org/besson/_images/.facebook.png');
display: block;
margin-left: auto;
margin-right: auto;
background-size: 35px 35px;
}

.social-icons a.bitbucket {
background-image: url('../_images/.bitbucket.png');
background-image: url('//perso.crans.org/besson/_images/.bitbucket.png');
display: block;
margin-left: auto;
margin-right: auto;
background-size: 35px 35px;
}

.social-icons li a.github {
background-image: url('../_images/.github.png');
background-image: url('//perso.crans.org/besson/_images/.github.png');
display: block;
margin-left: auto;
margin-right: auto;
background-size: 35px 35px;
}

.social-icons li a.wikipedia {
background-image: url('../_images/.wikipedia.png');
background-image: url('//perso.crans.org/besson/_images/.wikipedia.png');
display: block;
margin-left: auto;
margin-right: auto;
background-size: 35px 35px;
}
5 changes: 5 additions & 0 deletions docs/action.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
Action
===================================

This page is organized as follow:

.. contents:: Table of Contents
:depth: 3

Objectives
----------
The "Action" module lets you define some actions on the underlying power _grid.
Expand Down
40 changes: 37 additions & 3 deletions docs/backend.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. currentmodule:: grid2op.Backend

.. _backend-module:

Backend
Expand All @@ -22,9 +23,39 @@ Objectives
Both can serve as example if you want to code a new backend.

This Module defines the template of a backend class.
Backend instances are responsible to translate action (performed either by an BaseAgent or by the Environment) into
comprehensive powergrid modifications.
They are responsible to perform the powerflow (AC or DC) computation.

Backend instances are responsible to translate action into
comprehensive powergrid modifications that can be process by your "Simulator".
The simulator is responsible to perform the powerflow (AC or DC or Time Domain / Dynamic / Transient simulation)
and to "translate back" the results (of the simulation) to grid2op.

More precisely, a backend should:

#. inform grid2op of the grid: which objects exist, where are they connected etc.
#. being able to process an object of type :class:`grid2op.Action._backendAction._BackendAction`
into some modification to your solver (*NB* these "BackendAction" are created by the :class:`grid2op.Environment.BaseEnv`
from the agent's actions, the time series modifications, the maintenances, the opponent, etc. The backend **is not**
responsible for their creation)
#. being able to run a simulation (DC powerflow, AC powerflow or time domain / transient / dynamic)
#. expose (through some functions like :func:`Backend.generators_info` or :func:`Backend.loads_info`)
the state of some of the elements in the grid.

.. note::
A backend can model more elements than what can be controlled or modified in grid2op.
For example, at time of writing, grid2op does not allow the modification of
HVDC powerlines. But this does not mean that grid2op will not work if your grid
counts such devices. It just means that grid2op will not be responsible
for modifying them.

.. note::
A backend can expose only part of the grid to the environment / agent. For example, if you
give it as input a pan european grid but only want to study the grid of Netherlands or
France your backend can only "inform" grid2op (in the :func:`Backend.load_grid` function)
that "only the Dutch (or French) grid" exists and leave out all other informations.

In this case grid2op will perfectly work, agents and environment will work as expected and be
able to control the Dutch (or French) part of the grid and your backend implementation
can control the rest (by directly updating the state of the solver).

It is also through the backend that some quantities about the powergrid (such as the flows) can be inspected.

Expand Down Expand Up @@ -57,6 +88,9 @@ We developed a dedicated page for the development of new "Backend" compatible wi

Detailed Documentation by class
-------------------------------

Then the `Backend` module:

.. automodule:: grid2op.Backend
:members:
:private-members:
Expand Down
Loading

0 comments on commit 3a36498

Please sign in to comment.