nibcq.errors.FrequencyError

exception nibcq.errors.FrequencyError(message: str = 'There is an issue with the specified test frequency.')

Bases: BCQError

Exception raised when there are issues related to test frequency.

This error can occur in the following cases:
  • The frequency is negative or exceeds the supported maximum.

  • Too many periods have been selected for the given frequency.

  • The frequency is not supported by the API.

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: Frequency issue

    >>> raise FrequencyError("There is an issue with the specified test frequency.")
    
  • Specific: Too many periods for a frequency

    >>> raise FrequencyError(
    >>>     f"Too many periods have been selected for frequency {test_frequency} Hz.
    >>>     Lower the number of periods."
    >>> )
    
  • Specific: Frequency exceeds supported maximum

    >>> raise FrequencyError(
    >>>     f"API only supports non-negative frequencies
    >>>     up to {max_supported_frequency} Hz!"
    >>> )