Exception

exception grid2op.Exceptions.ActiveSetPointAbovePmax[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.OnProduction

This is a more precise exception than OnProduction indicating that the action is illegal because the setpoint active power of a production is set to be higher than Pmax.

exception grid2op.Exceptions.ActiveSetPointBelowPmin[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.OnProduction

This is a more precise exception than OnProduction indicating that the action is illegal because the setpoint active power of a production is set to be lower than Pmin.

exception grid2op.Exceptions.AmbiguousAction[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

This exception indicate that the grid2op.BaseAction is ambiguous. It could be understood differently according to the backend used.

Such a kind of action are forbidden in this package. These kind of exception are mainly thrown by the grid2op.BaseAction.BaseAction in the grid2op.BaseAction.update() and grid2op.BaseAction.__call__() methods.

As opposed to a IllegalAction an AmbiguousAction is forbidden for all the backend, in all the scenarios.

It doesn’t depend on the implemented rules.

exception grid2op.Exceptions.BackendError[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

Base class of all error regarding the Backend that might be badly configured.

exception grid2op.Exceptions.ChronicsError[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

Base class of all error regarding the chronics and the gridValue (see grid2op.ChronicsHandler.GridValue for more information)

exception grid2op.Exceptions.ChronicsNotFoundError[source]

Bases: grid2op.Exceptions.ChronicsExceptions.ChronicsError

This exception is raised where there are no chronics folder found at the indicated location.

exception grid2op.Exceptions.DivergingPowerFlow[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

This exception indicate that the grid2op.Backend.Backend is not able to find a valid solution to the

physical _grid it represents.

This divergence can be due to:

  • the system is not feasible: there is no solution to Kirchhoff’s law given the state

  • the powergrid is not connex

  • there is a “voltage collapse” : the voltages are ill conditioned making the _grid un realistic.

  • the method to solve the powerflow fails to find a valid solution. In this case, adopting a different grid2op.Backend.Backend might solve the problem.

exception grid2op.Exceptions.EnvError[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

This exception indicate that the grid2op.Environment.Environment is poorly configured.

It is for example thrown when assessing if a backend is properly set up with grid2op.Backend.Backend.assert_grid_correct()

exception grid2op.Exceptions.GeneratorTurnedOffTooSoon[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.InvalidRedispatching

This is a more precise exception than AmbiguousAction indicating that a generator has been turned off before gen_min_down_time time steps.

exception grid2op.Exceptions.GeneratorTurnedOnTooSoon[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.InvalidRedispatching

This is a more precise exception than AmbiguousAction indicating that a generator has been turned on before gen_min_up_time time steps.

exception grid2op.Exceptions.Grid2OpException[source]

Bases: RuntimeError

Base Exception from which all Grid2Op raise exception derived.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

__weakref__

list of weak references to the object (if defined)

exception grid2op.Exceptions.IllegalAction[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

This exception indicate that the grid2op.BaseAction is illegal.

It is for example thrown when an grid2op.BaseAgent tries to perform an action against the rule. This is handled in grid2op.Environment.Environment.step()

An grid2op.BaseAction is said to be illegal depending on some rules implemented in grid2op.BaseAction.ActionSpace.is_legal() method. An action can be legal in some context, but illegal in others.

exception grid2op.Exceptions.IncorrectNumberOfElements[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the total number of elements of the powergrid.

exception grid2op.Exceptions.IncorrectNumberOfGenerators[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the total number of generators of the powergrid.

exception grid2op.Exceptions.IncorrectNumberOfLines[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the total number of

powerlines of the powergrid.

exception grid2op.Exceptions.IncorrectNumberOfLoads[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the total number of loads of the powergrid.

exception grid2op.Exceptions.IncorrectNumberOfSubstation[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the total number of substation of the powergrid.

exception grid2op.Exceptions.IncorrectPositionOfGenerators[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the number of generators at a substation.

exception grid2op.Exceptions.IncorrectPositionOfLines[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the number of power lines at a substation.

exception grid2op.Exceptions.IncorrectPositionOfLoads[source]

Bases: grid2op.Exceptions.EnvExceptions.EnvError

This is a more precise exception than EnvError indicating that there is a mismatch in the number of loads at a substation.

exception grid2op.Exceptions.InsufficientData[source]

Bases: grid2op.Exceptions.ChronicsExceptions.ChronicsError

This exception is raised where there are not enough data compare to the size of the episode asked.

exception grid2op.Exceptions.InvalidBusStatus[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction try to both “set” and “switch” some bus to which an object is connected.

exception grid2op.Exceptions.InvalidLineStatus[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction is ambiguous due to powerlines manipulation.

exception grid2op.Exceptions.InvalidNumberOfGenerators[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction is ambiguous because an incorrect number of generator tries to be modified.

exception grid2op.Exceptions.InvalidNumberOfLines[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction is ambiguous because an incorrect number of lines tries to be modified.

exception grid2op.Exceptions.InvalidNumberOfLoads[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction is ambiguous because an incorrect number of loads tries to be modified.

exception grid2op.Exceptions.InvalidNumberOfObjectEnds[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction is ambiguous because an incorrect number of object at a substation try to be modified.

exception grid2op.Exceptions.InvalidReconnection[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.OnLines

This is a more precise exception than OnLines indicating that the grid2op.BaseAgent tried to reconnect a powerline illegally.

exception grid2op.Exceptions.InvalidRedispatching[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction try to apply an invalid redispatching strategy.

exception grid2op.Exceptions.MultiEnvException[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

General exception raised by grid2Op.MultiEnv.MultiEnvironment

exception grid2op.Exceptions.NoForecastAvailable[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

This exception is mainly raised by the grid2op.BaseObservation. It specifies the grid2op.BaseAgent.BaseAgent that the grid2op.ChronicsHandler.GridValue doesn’t produce any forecasts.

In that case it is not possible to use the grid2op.BaseObservation.BaseObservation.forecasts() method.

exception grid2op.Exceptions.NotEnoughGenerators[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.InvalidRedispatching

This is a more precise exception than AmbiguousAction indicating that there is not enough turned off generators to meet the demand.

exception grid2op.Exceptions.OnLines[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.IllegalAction

This is a more precise exception than IllegalAction indicating that the action is illegal due to setting

wrong values to lines (reconnection impossible, disconnection impossible etc).

exception grid2op.Exceptions.OnLoad[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.IllegalAction

This is a more precise exception than IllegalAction indicating that the action is illegal due to setting wrong values to loads.

exception grid2op.Exceptions.OnProduction[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.IllegalAction

This is a more precise exception than IllegalAction indicating that the action is illegal due to setting wrong values to generators.

exception grid2op.Exceptions.OpponentError[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

General error for the grid2op.Opponent

exception grid2op.Exceptions.PlotError[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

General exception raised by any class that handles plots

exception grid2op.Exceptions.UnitCommitorRedispachingNotAvailable[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.IllegalAction

attempt to use redispatching or unit commit method in an environment not set up.

exception grid2op.Exceptions.UnknownEnv[source]

Bases: grid2op.Exceptions.Grid2OpException.Grid2OpException

This exception indicate that a bad argument has been sent to the grid2op.make() function.

It does not recognize the name of the grid2op.Environment.Environment.

exception grid2op.Exceptions.UnrecognizedAction[source]

Bases: grid2op.Exceptions.AmbiguousActionExceptions.AmbiguousAction

This is a more precise exception than AmbiguousAction indicating that the grid2op.BaseAction.BaseAction is ambiguous due to the bad formatting of the action.

exception grid2op.Exceptions.VSetpointModified[source]

Bases: grid2op.Exceptions.IllegalActionExceptions.OnProduction

This is a more precise exception than OnProduction indicating that the action is illegal because the

setpoint voltage magnitude of a production has been changed.

If you still can’t find what you’re looking for, try in one of the following pages: