WrightTools.exceptions module

Custom exception types.

exception WrightTools.exceptions.DimensionalityError(expected, recieved)[source]

Bases: WrightTools.exceptions.WrightToolsException

DimensionalityError.

__init__(expected, recieved)[source]

Dimensionality error.

Parameters:
  • expected (object) – Expected dimensionalit(ies).
  • recieved (object) – Recieved dimensionality.
exception WrightTools.exceptions.EntireDatasetInMemoryWarning[source]

Bases: WrightTools.exceptions.WrightToolsWarning

Warn when an entire dataset is taken into memory at once.

Such operations may lead to memory overflow errors for large datasets.

Warning ignored by default.

exception WrightTools.exceptions.FileExistsError[source]

Bases: FileExistsError, WrightTools.exceptions.WrightToolsException

Raised when trying to create a file or directory which already exists.

Corresponds to errno EEXIST.

exception WrightTools.exceptions.MultidimensionalAxisError(axis, operation)[source]

Bases: WrightTools.exceptions.WrightToolsException

Error for when operation does not support Multidimensional Axes.

__init__(axis, operation)[source]

Multidimesional Axis error.

Parameters:
  • axis (str) – Name of axis which causes the error.
  • operation (str) – Name of operation which cannot handle multidimensional axes.
exception WrightTools.exceptions.NameNotUniqueError(name=None)[source]

Bases: WrightTools.exceptions.WrightToolsException

NameNotUniqueError.

__init__(name=None)[source]

Format a Name Not Unique Error.

Parameters:name (string) – Name of an attribute which causes a duplication.
exception WrightTools.exceptions.ObjectExistsWarning[source]

Bases: WrightTools.exceptions.WrightToolsWarning

Warn that an HDF5 object already exists when a new one is requested.

warn()[source]
exception WrightTools.exceptions.TypeError[source]

Bases: TypeError, WrightTools.exceptions.WrightToolsException

Raised when an operation or function is applied to an object of inappropriate type.

The associated value is a string giving details about the type mismatch.

exception WrightTools.exceptions.UnitsError(expected, recieved)[source]

Bases: WrightTools.exceptions.WrightToolsException

Units Error.

__init__(expected, recieved)[source]

Units error.

Parameters:
  • expected (object) – Expected units.
  • recieved (object) – Recieved units.
exception WrightTools.exceptions.ValueError[source]

Bases: ValueError, WrightTools.exceptions.WrightToolsException

Raised when an argument has the right type but an inappropriate value.

exception WrightTools.exceptions.VisibleDeprecationWarning[source]

Bases: WrightTools.exceptions.WrightToolsWarning

VisibleDepreciationWarning.

exception WrightTools.exceptions.WrightToolsException[source]

Bases: Exception

WrightTools Base Exception.

exception WrightTools.exceptions.WrightToolsWarning[source]

Bases: Warning

WrightTools Base Warning.

exception WrightTools.exceptions.WrongFileTypeWarning[source]

Bases: WrightTools.exceptions.WrightToolsWarning

WrongFileTypeWarning.

warn(expected)[source]

Raise warning.

Parameters:
  • filepath (string) – Given filepath.
  • expected (string) – Expected file suffix.