nibcq.errors.CompensationMethodError

exception nibcq.errors.CompensationMethodError(message: str = 'The specified compensation method is not supported.')

Bases: BCQError

Exception raised when an invalid compensation method is specified.

This error occurs if:
  • No compensation or a combination of compensation methods was selected.

  • When obtaining compensation values and writing them to compensation files, only one compensation method can be used at a time.

  • A specific compensation value is missing for a required frequency.

Parameters:

message (str, optional) – Custom error message. Defaults to a standard message.

Examples

The following are examples of how this error can be raised:

  • General: Method selection issue

    >>> raise CompensationMethodError(
    >>>     "No compensation or a combination of compensation methods was selected.
    >>>     Only one compensation method can be used at a time."
    >>> )
    
  • Specific: Missing value

    >>> raise CompensationMethodError(
    >>>     f"Short Compensation value not found for {frequency} Hz!"
    >>> )