gluonts.exceptions module#

exception gluonts.exceptions.GluonTSDataError[source]#

Bases: GluonTSException

An exception indicating an error with the input data.

exception gluonts.exceptions.GluonTSDateBoundsError[source]#

Bases: GluonTSException

An exception indicating that .

exception gluonts.exceptions.GluonTSException[source]#

Bases: Exception

Base class for all GluonTS exceptions.

classmethod guard(condition, *args, **kwargs)[source]#
exception gluonts.exceptions.GluonTSHyperparametersError[source]#

Bases: GluonTSException, ValueError

An exception wrapping a Pydantic ValidationError, usually thrown when the validation of a validated() initializer fails.

exception gluonts.exceptions.GluonTSUserError[source]#

Bases: GluonTSException

An exception indicating a user error.

gluonts.exceptions.assert_data_error(condition: Any, message: str, *args, **kwargs) None[source]#

Delegates to assert_gluonts() with a fixed exception_class value of GluonTSDataError.

Parameters:
  • condition – The condition that must be violated in order to raise the exception.

  • message – A message to pass as the only argument to the exception initializer.

  • args – An optional list of positional arguments to use when formatting the exception message.

  • kwargs – An optional list of key-value arguments to use when formatting the exception message.

gluonts.exceptions.assert_gluonts(exception_class: type, condition: Any, message: str, *args, **kwargs) None[source]#

If the given condition is False, raises an exception of type exception_class with a message formatted from the message pattern using the args and kwargs strings.

Parameters:
  • exception_class – The exception class of the raised exception.

  • condition – The condition that must be violated in order to raise the exception.

  • message – A message to pass as the only argument to the exception initializer.

  • args – An optional list of positional arguments to use when formatting the exception message.

  • kwargs – An optional list of key-value arguments to use when formatting the exception message.