Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to version 1.2.3 #150

Merged
merged 25 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e603c34
adding doc and refactoring private / public part of the API
BDonnot Sep 1, 2020
0fde46d
adding doc and refactoring private / public part of the API
BDonnot Sep 1, 2020
8bb225e
addressing issue #144 and fixed lots of documentation and private / p…
BDonnot Sep 1, 2020
81e480d
starting the 'restart an episode just before it diverged'
BDonnot Sep 1, 2020
d07ee75
quite some work on documentation, adding examples and better warning …
BDonnot Sep 2, 2020
233e7a2
continue in doc cleaning
BDonnot Sep 2, 2020
43747cb
still cleaning doc
BDonnot Sep 2, 2020
a548733
adding a bunch of documentation
BDonnot Sep 8, 2020
7356d34
adding doc in the rst files
BDonnot Sep 9, 2020
574e65a
adding more doc and an image example
BDonnot Sep 9, 2020
cc5a3ec
adding an image
BDonnot Sep 9, 2020
66ea000
addding other images in the documentation
BDonnot Sep 9, 2020
ffb66e5
adding more docs in the observation
BDonnot Sep 14, 2020
6c2efdb
fix issue https://github.com/rte-france/Grid2Op/issues/147, test PR #111
BDonnot Sep 15, 2020
6cefb57
adressing and making a test for enhancement https://github.com/rte-fr…
BDonnot Sep 15, 2020
b074116
fixing issue https://github.com/rte-france/Grid2Op/issues/126 - test …
BDonnot Sep 15, 2020
580a584
fixing issue https://github.com/rte-france/Grid2Op/issues/148
BDonnot Sep 16, 2020
4141cc0
improving on the 'reboot' episode
BDonnot Sep 16, 2020
6a8f7f0
still improving the reboot
BDonnot Sep 22, 2020
192ded6
ready for version 1.2.3
BDonnot Sep 25, 2020
a94775b
adding test for binder
BDonnot Sep 25, 2020
cc6e404
improving changelog
BDonnot Sep 25, 2020
5fc3a19
removing the import of EpisodeReboot, fix doc of _ObsEnv
BDonnot Sep 25, 2020
000d42c
Merge pull request #112 from BDonnot/bd_dev
BDonnot Sep 25, 2020
521f738
fixing conflicts
BDonnot Sep 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,15 @@ test_sac
test_if_bug.py
getting_started/saved_agent_DDDQN_10000/
getting_started/saved_agent_DDDQN_10000_results/

test_reboot.py
test_multimixrunner/
test_N1reward.py
i_saved_the_runner_here/
output_pdf/
test_make_plot_injj.ipynb
plot_inj_prez_gdrive.ipynb
where_i_want_to_save_it/
test_issue147.py

# profiling files
**.prof
24 changes: 23 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Change Log
- [???] Extensive tests for DistanceReward
- [???] better logging
- [???] add a "plot action" method
- [???] rationalize the public and private part of the API. Some members now are public but should be private.
- [???] simulate in MultiEnv
- [???] in MultiEnv, when some converter of the observations are used, have each child process to compute
it in parrallel and transfer the resulting data.
Expand All @@ -16,6 +15,29 @@ Change Log
- [???] model batteries / pumped storage in grid2op (generator but that can be charged / discharged)
- [???] model dumps (as in dump storage) in grid2op (stuff that have a given energy max, and cannot produce more than the available energy)

[1.2.3] - 2020-09-25
----------------------
- [ADDED] `l2rpn-baselines` package dependency in the "binder" environment.
- [FIXED] binder integration that was broken momentarily
- [FIXED] an issue in the sampling of redispatching action (ramp up and ramp down were inverted)
- [FIXED] an issue causing errors when using `action_space.change_bus` and `action_space.set_bus`
- [FIXED] an issue in the sampling: redispatching and "change_bus" where always performed at the
same time
- [FIXED] `Issue #144 <https://github.com/rte-france/Grid2Op/issues/144>`_: typo that could lead to not
display some error messages in some cases.
- [FIXED] `Issue #146 <https://github.com/rte-france/Grid2Op/issues/146>`_: akward behaviour that lead to not calling
the reward function when the episode was over.
- [FIXED] `Issue #147 <https://github.com/rte-france/Grid2Op/issues/147>`_: un consistency between step and simulate
when cooldowns where applied (rule checking was not using the right method).
- [FIXED] An error preventing the loading of an Ambiguous Action (in case an agent took such action, the `EpisodeData`
would not load it properly.
- [IMPROVED] overall documentation of `BaseEnv` and `Environment`
- [IMPROVED] rationalize the public and private part of the API for `Environment` and `BaseEnv`.
Some members have been moved to private attribute (their modification would largely alterate the
behaviour of grid2op).
- [IMPROVED] internal functions are tagged as "Internal, do not use" in the documentation.
- [IMPROVED] Improved documentation for the `Environment` and `MultiMixEnvironment`.

[1.2.2] - 2020-08-19
---------------------
- [FIXED] `LightSim Issue #10<https://github.com/BDonnot/lightsim2grid/issues/10>`_: tests were
Expand Down
2 changes: 2 additions & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ dependencies:
- python
- numpy
- keras
- pip
- pip:
- grid2op[challenge]
- l2rpn-baselines
- jyquickhelper
- numpy
- numba
Expand Down
17 changes: 17 additions & 0 deletions docs/action.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. currentmodule:: grid2op.Action
.. _action-module:

Action
===================================
Expand Down Expand Up @@ -39,6 +40,20 @@ instances of BaseAction is assessed both when calling :func:`BaseAction.update`
:func:`BaseAction._check_for_ambiguity` performed for example by the Backend when it must implement its effect on the
powergrid through a call to :func:`BaseAction.__call__`

Constructing an action in grid2op is made in the following manner:

.. code-block:: python

import grid2op
env = grid2op.make()
dictionary_describing_the_action = {}
my_action = env.action_space(dictionary_describing_the_action)
print(my_action)

On the above code, `dictionary_describing_the_action` should be a dictionary that describe what action
you want to perform on the grid. For more information you can consult the help of the :func:`BaseAction.update`.


.. _Illegal-vs-Ambiguous:

Illegal vs Ambiguous
Expand Down Expand Up @@ -137,6 +152,8 @@ action original status final status

\* means that this bus is affected: if it was on bus 1 it moves on bus 2 and vice versa.

.. _action-module-converter:

Easier actions manipulation
----------------------------
The action class presented here can be quite complex to apprehend, especially for a machine learning algorithm.
Expand Down
31 changes: 31 additions & 0 deletions docs/agent.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. currentmodule:: grid2op.Agent
.. _agent-module:

Agent
============
Expand All @@ -20,6 +21,36 @@ To perform their actions, agent receive two main signals from the :class:`grid2o
Both these signals can be use to determine what is the best action to perform on the grid. This is actually the main
objective of an :class:`BaseAgent`, and this is done in the :func:`BaseAgent.act` method.

To get started coding your agent we encourage you to read the description of the :ref:`action-module` to know how
to implement your action. Don't hesitate to have a look at the :ref:`action-module-converter` for
an easier / higher level action manipulation.

Once you know how to manipulate a powergrid in case of the grid2op framework, you can easily implement an agent
following this example

.. code-block:: python

import grid2op
from grid2op.Agent import BaseAgent

class MyCustomAgent(BaseAgent):
def __init__(self, action_space, something_else, and_another_something):
# define here the constructor of your agent
# here we say our agent needs "something_else" and "and_another_something"
# to be built just to demonstrate it does not cause any problem to extend the
# construction of the base class BaseAgent that only takes "action_space" as a constructor
BaseAgent.__init__(self, action_space)
self.something_else = something_else
self.and_another_something = and_another_something

def act(obs, reward, done=False):
# this is the only method you need to implement
# it takes an observation obs (and a reward and a flag)
# and should return a valid action
dictionary_describing_the_action = {} # this can be anything you want that grid2op understands
my_action = env.action_space(dictionary_describing_the_action)
return my_action


Detailed Documentation by class
-------------------------------
Expand Down
11 changes: 10 additions & 1 deletion docs/backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ Backend

Objectives
-----------

.. warning:: Backends are internal to grid2op. You should not have to recode any backend if you are "simply"
using grid2op, for example to develop new controller.

Backend is an abstraction that represents the physical system (the powergrid). In theory every powerflow can be
used as a backend. For now we only provide a Backend that uses `Pandapower <http://www.pandapower.org/>`_ and
a port in c++ to a subset of pandapower called `LightSim2Grid <https://github.com/BDonnot/lightsim2grid>`_ .

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.
Expand Down Expand Up @@ -34,7 +44,6 @@ The order of the values returned are always the same and determined when the bac
'\*_names'. For example, when the ith element of the results of a call to :func:`Backend.get_line_flow` is the
flow on the powerline with name `lines_names[i]`.


Detailed Documentation by class
-------------------------------
.. automodule:: grid2op.Backend
Expand Down
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
# 'sphinx.ext.autosectionlabel',

# 'details',
#'exception_hierarchy'
#'exception_hierarchy',

# for pdf
# 'rst2pdf.pdfbuilder'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = [] #'_templates']
Expand All @@ -73,6 +76,9 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# for pdf
pdf_documents = [('index', u'rst2pdf', u'Sample rst2pdf doc', u'Your Name'),]


def setup(app):
app.add_javascript('custom.js')
Expand Down
Loading