audformat.errors

BadIdError

class audformat.errors.BadIdError(name, invalid_id, dictionary)[source]

Raised when a field identifier is unknown.

Parameters
  • name (str) – name of the field

  • invalid_id (str) – identifier causing the error

  • dictionary (dict) – dictionary with valid identifiers

BadKeyError

class audformat.errors.BadKeyError(invalid_key, valid_keys)[source]

Raised when a key is not found.

Parameters
  • invalid_key (str) – value causing the error

  • valid_keys (Sequence[str]) – list of valid strings

BadTypeError

class audformat.errors.BadTypeError(invalid_value, expected_type)[source]

Raised when a value has an unexpected type.

Parameters
  • invalid_value (Any) – value causing the error

  • expected_type (type) – expected value type

BadValueError

class audformat.errors.BadValueError(invalid_value, valid_values)[source]

Raised when a value is not in a list of pre-defined strings.

Parameters
  • invalid_value (str) – value causing the error

  • valid_values (Sequence[str]) – list of valid strings