Skip to content

Releases: Grid2op/grid2op

Release: 1.12.0

24 Jul 17:52
d87c5d1
Compare
Choose a tag to compare
  • [BREAKING] the info returned argument of env.step(...) function
    does not have the unclear is_redispatching_illegal key. This key has been
    replaced (without any change to its signification) with failed_redispatching
  • [FIXED] issue 713
  • [FIXED] pandapower 3 compatibility
  • [ADDED] compatibility with numpy 2, scipy >= 1.14 and python 3.13
  • [ADDED] some examples showing how grid2op can be use to solve some specific
    kind of problem (related to N-1 safety and phase shift transformer).
  • [IMPROVED] clarity of the failed_redispatching key of the info returned value
    of the env.step function (previously called is_redispatching_illegal which
    was not clear)
  • [IMPROVED] way to load back class stored in json format
  • [IMPROVED] the way the Observation class can be overriden

Release: 1.11.0

15 Apr 11:57
6aa8500
Compare
Choose a tag to compare

This is rather large release, including (but not limited too):

A whole new feature: it is now possible to continue an episode if a load or a generator is disconnected by an Agent (this is called detachement) This feature is disabled by default, unless the kwargs allow_detachment=True is passed when an environment is created). This comes with added action and observation attributes.

Different bugfixes, including some for the "protections" module and the SOFT_OVERFLOW_THRESHOLD parameters.

The ability to tell an environment not to perform redispatching and let either the Agent take care of it (if the agent actions is correct) or the Environment (in case the action does not lead to an equilibrium)

And some quality of life feature, for example being able to retrieve information about objects based on their names or ids, some methods are now correctly spelled (eg check_kirchoff) or improved type hinting.

Full changes are:

  • [BREAKING] Change for FromMultiEpisodeData that disables the caching by default
    when creating the data.
  • [BREAKING] deprecation of backend.check_kirchoff in favor of backend.check_kirchhoff
    (fix the typo in the name)
  • [BREAKING] change the name of the generated classes: now by default the backend class
    name is added. This behaviour can be turned off by passing _add_cls_nm_bk=False
    when calling grid2op.make(...). If you develop a new Backend, you can also
    customize the added name by overloading the get_class_added_name class method.
  • [BREAKING] it is now forbidden to create environment with arguments.
    Only key-word arguments are allowed.
  • [BREAKING] the way actions is serialized has been changed with respect to the from_vect /
    to_vect method. This might introduce some issues when loading previously saved actions
    with this methods.
  • [BREAKING] first kwargs of backend.apply_action method is now spelled backend_action
    (instead of backendAction)
  • [BREAKING] (not yet) rationalization of the backend public / private API part. The
    environment (and simulator, forecast env etc.) will always call the method _public
    for example load_grid_public, reset_public, copy_public and apply_action_public.
    These function of the base Backend should NOT be overriden, and will internally call
    the functions load_grid, reset, copy and apply_action which were part of the public
    API. These last member functions will be renamed (in a later version) _load_grid,
    _reset, _copy and _apply_action to reflect this change. NOT for this version however !
  • [BREAKING] removal of the rest_server grid2op module (it will be release as a separate package instead)
    It has been removed from grid2op core package for securtiy reasons.
  • [FIXED] issue #657
  • [FIXED] missing an import on the MaskedEnvironment class
  • [FIXED] a bug when trying to set the load_p, load_q, gen_p, gen_v by names.
  • [FIXED] the obs.get_forecast_env : in some cases the resulting first
    observation (obtained from for_env.reset()) did not have the correct
    topology.
  • [FIXED] issue #665 (obs.reset()
    was not correctly implemented: some attributes were forgotten)
  • [FIXED] issue #667 (act.as_serializable_dict()
    was not correctly implemented AND the _aux_affect_object_int and _aux_affect_object_float
    have been also fixed - weird behaviour when you give them a list with the exact length of the
    object you tried to modified (for example a list with a size of n_load that affected the loads))
  • [FIXED] a bug when using the DoNothingHandler for the maintenance and the
    environment data
  • [FIXED] an issue preventing to set the thermal limit in the options
    if the last simulated action lead to a game over
  • [FIXED] some bugs in act.from_json(...) due to the handling of the injection modifications.
  • [FIXED] logos now have the correct URL
  • [FIXED] deprecated call to tostring_rgb (replaced tostring_argb) in the env.render function.
  • [FIXED] warnings not properly issued in the AAA test when backend failed to call
    can_handle_XXX functions (eg can_handle_more_than_2_busbar() or can_handle_detachment())
  • [FIXED] an issue with obs.get_forecast_env with changeNothing and DoNothingHandler time series
  • [FIXED] a bug in updating the shunt in PandaPowerBackend (depdending on pandas version)
  • [FIXED] a bug when action that reconnect loads, storage units or shunts are done
    in the "obs.simulate" (results could depend from previous "obs.simulate" calls)
  • [FIXED] a bug in "obs.simulate" and "obs.get_forecast_env" : when a line was disconnected
    and the user tried to reconnect it (without specifying on which bus) it could do something
    different than "env.step" (with the same action)
  • [FIXED] a powerflow is run when the environment is first created even before the initial "env.step"
    function is called. This is to ensure proper behaviour if env is used without being reset.
  • [FIXED] no error was catched if the backend could not properly apply the action sent by the environment.
  • [FIXED] an issue in the AAA tests: when backend does not support storages, some tests were skipped not correctly
  • [FIXED] an issue when computing the cascading failure routine, in case multiple iterations were performed,
    the cooldowns were not updated correctly.
  • [FIXED] cascading failure could be started at the first observation (t=0, just after a reset).
  • [FIXED] a bug when "SOFT_OVERFLOW_THRESHOLD" was not 1.: it also impacted "instantaneous overcurrent protections"
    (it was triggered when flow > SOFT_OVERFLOW_THRESHOLD * HARD_OVERFLOW_THRESHOLD * th_lim)
  • [FIXED] a bug when "SOFT_OVERFLOW_THRESHOLD" was not 1.: the backend routine to compute the protections
    disconnected the lines with a counter based on flow > th_lim and not flow > th_lim * SOFT_OVERFLOW_THRESHOLD
  • [ADDED] Possibility to disconnect loads, generators and storage units (if proper flag set in the environment).
    See documentation.
  • [ADDED] possibility to set the "thermal limits" when calling env.reset(..., options={"thermal limit": xxx})
  • [ADDED] possibility to retrieve some structural information about elements with
    with gridobj.get_line_info(...), gridobj.get_load_info(...), gridobj.get_gen_info(...)
    or , gridobj.get_storage_info(...)
  • [ADDED] codacy badge on the readme
  • [ADDED] a method to check the KCL (obs.check_kirchhoff) directly from the observation
    (previously it was only possible to do it from the backend). This should
    be used for testing purpose only
  • [ADDED] parameters to disable the "redispatching routine" of the environment
    (see params.ENV_DOES_REDISPATCHING)
  • [ADDED] parameters to stop the episode when one of the constraints of one of the
    generators is not met (see params.STOP_EP_IF_SLACK_BREAK_CONSTRAINTS)
  • [ADDED] possibility to set the initial time stamp of the observation in the env.reset
    kwargs by using env.reset(..., options={"init datetime": XXX})
  • [ADDED] the ChangeNothing time series class now supports forecast
  • [ADDED] test coverage on the CI
  • [ADDED] the obs.timestep_protection_triggered counter which counts whether or not the
    "time overcurrent protection" (soft overflow) will be triggered: lines will be disconnected
    if time overcurrent protection > parameters.NB_TIMESTEP_POWERFLOW_ALLOWED
  • [IMPROVED] possibility to set the injections values with names
    to be consistent with other way to set the actions (eg set_bus)
  • [IMPROVED] error messages when creating an action which changes the injections
  • [IMPROVED] (linked to #657) the way the
    "chronics_hander" in the ObsEnv behaves (it now fully implements the public interface of
    a "real" chronic_handler)
  • [IMPROVED] error message in the FromNPY class when the backend is checked
  • [IMRPOVED] the FromMultiEpisodeData class with the addition of the caching
    kwargs to allow / disable caching (which was default behavior in previous version)
  • [IMPROVED] the FromMultiEpisodeData class that now returns also the path of the data
  • [IMPROVED] the classes inherited from GreedyAgent with the added possibility to
    do the obs.simulate on a different time horizon (kwarg simulated_time_step)
  • [IMPROVED] some type hints for some agent class
  • [IMPROVED] the backend.update_from_obs function to work even when observation
    does not have shunt information but there are not shunts on the grid.
  • [IMPROVED] consistency of MultiMixEnv in case of automatic_classes (only one
    class is generated for all mixes)
  • [IMRPOVED] handling of disconnected elements in the backend no more
    raise error. The base Backend class does that.
  • [IMPROVED] the act.as_serializable_dict() to be more 'backend agnostic'as
    it nows tries to use the name of the elements in the json output
  • [IMPROVED] the way shunt data are digested in the BaseAction class (it is now
    possible to use the same things as for the other types of element)
  • [IMPROVED] grid2op does not require the chronics folder when using the FromHandlers
    class
  • [IMPROVED] the function action.get_topological_impact(...) has now a "caching" mechanism
    that allows not to recompute it over and over again (this is internal API please do not change
    it... unless you know what you are doing)
  • [IMPROVED] ForecastEnv is now part of the public API.
  • [IMPROVED] no need to call self._compute_pos_big_top() at the end of the implementation of backend.load_grid()
  • [IMPROVED] type hints in various files.
  • [IMPROVED] documentation of the backend
  • [IMRPOVED] SOFT_OVERFLOW_THRESHOLD can now be lower than 1

Pre release: 1.11.0.dev4

07 Mar 15:16
066f782
Compare
Choose a tag to compare
Pre-release

Pre release that robustifies the "detachment" feature.

Release v1.10.5

15 Oct 12:37
e7422c6
Compare
Choose a tag to compare
  • [FIXED] new pypi link (no change in code)
  • [FIXED] mybinder environment
  • [FIXED] update all the links in the README.md (for the new grid2op location)
  • [FIXED] update all the links in the docs and the grid2op source files
    (to match new location: Grid2op/grid2op.git)
  • [FIXED] the link in the make_env and update_env to point to
    https://api.github.com/repos/Grid2Op/grid2op-datasets/
  • [IMPROVED] clarity of the "work in progress" in this CHANGELOG

Release v1.10.4

14 Oct 13:35
v1.10.4
9bb03c8
Compare
Choose a tag to compare
  • [FIXED] an issue in the backend: if the backend failed to be
    created the _grid attribute was set to None and not set back to
  • [FIXED] the self.skip_if_needed() was missing for one of the test suite.
  • [FIXED] an error in the descirption of the educ_case14_storage environment
    (wrong sign for the slack generator)
  • [FIXED] the environment would not load in case of an incorrect "layout.json"
    instead of raising a warning.
  • [FIXED] some issue with gym_compat module for "newest" version of
    gymnasium (1.0.0)
  • [FIXED] github ci (v1 and v2 artifact are now deprecated)
  • [ADDED] a code of conduct from github
  • [ADDED] a "CONTRIBUTING.md" files (instead of having contribution instructions
    in the readme)
  • [ADDED] numpy 2 support (now that pandapower allows it)
  • [IMPROVED] error message when forecasts are not correctly set-up

Release v1.10.3

12 Jul 07:29
Compare
Choose a tag to compare
  • [BREAKING] env.chronics_hander.set_max_iter(xxx) is now a private function. Use
    env.set_max_iter(xxx) or even better env.reset(options={"max step": xxx}).
    Indeed, env.chronics_hander.set_max_iter() will likely have
    no effect at all on your environment.
  • [BREAKING] for all the Handler (eg CSVForecastHandler) the method set_max_iter is
    now private (for the same reason as the env.chronics_handler). We do not recommend to
    use it (will likely have no effect). Prefer using env.set_max_iter instead.
  • [BREAKING] now the runner.run() method only accept kwargs argument
    (because it should always have been like this)
  • [BREAKING] to improve pickle support and multi processing capabilities, the attribute
    gym_env.observation_space._init_env and gym_env.observation_space.initial_obs_space
    have been deleted (for the Dict space only, for the other spaces like the Box they
    were not present in the first place)
  • [BREAKING] in the GymEnv class now by default the underlying grid2op environment has no
    forecast anymore in an attempt to make this wrapper faster AND more easily pickle-able. You can
    retrieve the old behaviour by passing gym_env = GymEnv(grid2op_env, with_forecast=True)
  • [FIXED] a bug in the MultiFolder and MultifolderWithCache leading to the wrong
    computation of max_iter on some corner cases
  • [FIXED] the function cleanup_action_space() did not work correctly when the "chronics_hander"
    was not initialized for some classes
  • [FIXED] the _observationClass attribute of the "observation env" (used for simulate and forecasted env)
    is now an Observation and not an Action.
  • [FIXED] a bug when deep copying an "observation environment" (it changes its class)
  • [FIXED] issue on seed and MultifolderWithCache which caused
    #616
  • [FIXED] another issue with the seeding of MultifolderWithCache: the seed was not used
    correctly on the cache data when calling chronics_handler.reset multiple times without
    any changes
  • [FIXED] Backend now properly raise EnvError (grid2op exception) instead of previously
    EnvironmentError (python default exception)
  • [FIXED] a bug in PandaPowerBackend (missing attribute) causing directly
    #617
  • [FIXED] a bug in Environment: the thermal limit were used when loading the environment
    even before the "time series" are applied (and before the user defined thermal limits were set)
    which could lead to disconnected powerlines even before the initial step (t=0, when time
    series are loaded)
  • [FIXED] an issue with the "max_iter" for FromNPY time series generator
  • [FIXED] a bug in MultiMixEnvironment : a multi-mix could be created even if the underlying
    powergrids (for each mix) where not the same.
  • [FIXED] a bug in generate_classes (experimental_read_from_local_dir) with alert data.
  • [FIXED] a bug in the Runner when using multi processing on macos and windows OS: some non default
    parameters where not propagated in the "child" process (bug in runner._ger_params)
  • [ADDED] possibility to skip some step when calling env.reset(..., options={"init ts": ...})
  • [ADDED] possibility to limit the duration of an episode with env.reset(..., options={"max step": ...})
  • [ADDED] possibility to specify the "reset_options" used in env.reset when
    using the runner with runner.run(..., reset_options=xxx)
  • [ADDED] the argument mp_context when building the runner to help pass a multiprocessing context in the
    grid2op Runner
  • [ADDED] the time series are now able to regenerate their "random" part
    even when "cached" thanks to the addition of the regenerate_with_new_seed of the
    GridValue class (in public API)
  • [ADDED] MultifolderWithCache now supports FromHandlers time series generator
  • [IMPROVED] more consistency in the way the classes are initialized at the creation of an environment
  • [IMPROVED] more consistency when an environment is copied (some attributes of the copied env were
    deep copied incorrectly)
  • [IMPROVED] Doc about the runner
  • [IMPROVED] the documentation on the time series folder.
  • [IMPROVED] now the "maintenance from json" (eg the JSONMaintenanceHandler or the
    GridStateFromFileWithForecastsWithMaintenance) can be customized with the day
    of the week where the maintenance happens (key maintenance_day_of_week)
  • [IMPROVED] in case of "MultiMixEnvironment" there is now only class generated for
    all the underlying mixes (instead of having one class per mixes)
  • [IMPROVED] the EpisodeData have now explicitely a mode where they can be shared accross
    processes (using fork at least), see ep_data.make_serializable
  • [IMPROVED] chronix2grid tests are now done independantly on the CI

Release v1.10.2

27 May 11:11
Compare
Choose a tag to compare

Lots of things have been done in this release that focuses on user experience.

The most notable addition is to be able to set the initial state of the grid when calling env.reset()

Unfortunately, this comes with a few breaking changes.

Breaking changes

  • [BREAKING] the runner.run_one_episode now returns an extra first argument:
    chron_id, chron_name, cum_reward, timestep, max_ts = runner.run_one_episode() which
    is consistant with runner.run(...) (previously it returned only
    chron_name, cum_reward, timestep, max_ts = runner.run_one_episode())
  • [BREAKING] the runner now has no chronics_handler attribute (runner.chronics_handler
    is not defined)
  • [BREAKING] now grid2op forces everything to be connected at busbar 1 if
    param.IGNORE_INITIAL_STATE_TIME_SERIE == True (NOT the default) and
    no initial state is provided in env.reset(..., options={"init state": ...})

Additions

  • [ADDED] it is now possible to call change_reward directly from
    an observation (no need to do it from the Observation Space)
  • [ADDED] method to change the reward from the observation (observation_space
    is not needed anymore): you can use obs.change_reward
  • [ADDED] a way to automatically set the experimental_read_from_local_dir flags
    (with automatic class creation). For now it is disable by default, but you can
    activate it transparently (see doc)
  • [ADDED] possibility to set the grid to an initial state (using an action) when using the
    "time series" classes. The supported classes are GridStateFromFile - and all its derivative,
    FromOneEpisodeData, FromMultiEpisodeData, FromNPY and FromHandlers. The classes ChangeNothing
    and FromChronix2grid are not supported at the moment.
  • [ADDED] an "Handler" (JSONInitStateHandler) that can set the grid to an initial state (so as to make
    compatible the FromHandlers time series class with this new feature)
  • [ADDED] some more type hints in the GridObject class
  • [ADDED] Possibility to deactive the support of shunts if subclassing PandaPowerBackend
    (and add some basic tests)
  • [ADDED] a parameters (param.IGNORE_INITIAL_STATE_TIME_SERIE) which defaults to
    False that tells the environment whether it should ignore the
    initial state of the grid provided in the time series.
    By default it is NOT ignored, it is taken into account
    (for the environment that supports this feature)

Bug fixes

  • [FIXED] a small issue that could lead to having
    "redispatching_unit_commitment_availble" flag set even if the redispatching
    data was not loaded correctly
  • [FIXED] EducPandaPowerBackend now properly sends numpy array in the class attributes
    (instead of pandas series)
  • [FIXED] an issue when loading back data (with EpisodeData): when there were no storage units
    on the grid it did not set properly the "storage relevant" class attributes
  • [FIXED] a bug in the "gridobj.generate_classes()" function which crashes when no
    grid layout was set
  • [FIXED] notebook 5 on loading back data with EpisodeData.
  • [FIXED] converter between backends (could not handle more than 2 busbars)
  • [FIXED] a bug in BaseMultiProcessEnvironment: set_filter had no impact
  • [FIXED] an issue in the Runner (self.chronics_handler was sometimes used, sometimes not
    and most of the time incorrectly)
  • [FIXED] on RemoteEnv class (impact all multi process environment): the kwargs used to build then backend
    where not used which could lead to"wrong" backends being used in the sub processes.
  • [FIXED] a bug when the name of the times series and the names of the elements in the backend were
    different: it was not possible to set names_chronics_to_grid correctly when calling env.make

Improvments

  • [IMPROVED] documentation about obs.simulate to make it clearer the
    difference between env.step and obs.simulate on some cases
  • [IMPROVED] type hints on some methods of GridObjects
  • [IMPROVED] replace np.nonzero(arr) calls with arr.nonzero() which could
    save up a bit of computation time.
  • [IMPROVED] force class attributes to be numpy arrays of proper types when the
    classes are initialized from the backend.
  • [IMPROVED] some (slight) speed improvments when comparing actions or deep copying objects
  • [IMPROVED] the way the "grid2op compat" mode is handled
  • [IMPROVED] the coverage of the tests in the "test_basic_env_ls.py" to test more in depth lightsim2grid
    (creation of multiple environments, grid2op compatibility mode)
  • [IMPROVED] the function to test the backend interface in case when shunts are not supported
    (improved test AAATestBackendAPI.test_01load_grid)