Skip to content

RefusedOperationError(operation, alternative) Source

Bases: NumdaplotError

Raised when a Python operation is not available on an Array, a Table or a Plot, such as < or len.

Calling the constructor of an Array, a Table or a Plot raises it too.

The message names the numdaplot method to use instead.

Added in version 0.1.0

Parameters:

  • operation (str)

    Description of the refused operation, naming what it applies to.

  • alternative (str)

    Description of what to use instead.

Attributes:

  • operation

    Description of the refused operation, naming what it applies to.

  • alternative

    Description of what to use instead.

Examples:

import numdaplot as ndp

array = ndp.Array.from_list([1, 2])
try:
    array < 2
except ndp.RefusedOperationError as error:
    print(error)
# Comparing an Array with < is not available, use select or check with a rule such as ndp.Less instead.