Skip to content

InvalidTimeZoneChangeError(mode_name, needs_zone) Source

Bases: NumdaplotError

Raised when TimeZoneMode.ATTRIBUTE or SHIFT has no zone, or TimeZoneMode.REMOVE has one.

Added in version 0.1.0

Parameters:

  • mode_name (str)

    Name of the TimeZoneMode member of the change.

  • needs_zone (bool)

    True when the mode needs a zone that is missing, False when it has a zone it does not use.

Attributes:

  • mode_name

    Name of the TimeZoneMode member of the change.

  • needs_zone

    True when the mode needs a zone that is missing, False when it has a zone it does not use.

Examples:

import numdaplot as ndp

try:
    ndp.TimeZoneChange(mode=ndp.TimeZoneMode.SHIFT)
except ndp.InvalidTimeZoneChangeError as error:
    print(error)
# TimeZoneMode.SHIFT needs a zone.