phenotypic.tools.exceptions_#

PhenoTypic Exceptions

This module contains all exceptions used throughout the PhenoTypic library. Exceptions are organized by module and functionality.

Exceptions

ArrayKeyValueShapeMismatchError()

Exception raised when the shape of the other_image doesn't match the key's section.

DataIntegrityError(component, operation[, ...])

Exception raised when data integrity is compromised.

EmptyImageError()

Exception raised when no image data is loaded.

GridImageInputError()

Exception raised when a non-GriddedImage object is provided as arr.

IllegalAssignmentError(attr)

Exception raised when trying to directly assign a new object to a protected attribute.

IllegalElementAssignmentError(component_name)

Exception raised when trying to change rgb/gray elements directly.

ImageOperationError

Base exception for image operation errors.

ImmutableComponentError

Base exception for immutable component errors.

InputShapeMismatchError(param_name)

Exception raised when arr shape doesn't match the image gray.

InterfaceError()

Exception raised when an abc_ method is called when it's not supposed to be.

InvalidHsvSchemaError(imformat)

Exception raised when trying to convert to HSV from a non-RGB imformat.

InvalidMapValueError(value_type)

Exception raised when trying to set object map with invalid other_image type.

InvalidMaskScalarValueError()

Exception raised when trying to set mask with invalid scalar other_image.

InvalidMaskValueError(value_type)

Exception raised when trying to set mask with invalid other_image type.

InvalidShapeError(component)

Exception raised when a shape mismatch occurs.

MetadataKeySpacesError()

Exception raised when metadata key contains spaces.

MetadataKeyValueError(type_received)

Exception raised when metadata key is not a string.

MetadataValueNonScalarError(type_value)

Exception raised when metadata other_image is not scalar.

NoArrayError()

Exception raised when no array is found.

NoComponentError(component)

Exception raised when a required object is missing.

NoImageDataError()

Exception raised when no image data is loaded.

NoObjectsError([image_name])

Exception raised when no objects are found in an image.

NoOutputError()

Exception raised when no output was returned in an operation.

ObjectNotFoundError(label)

Exception raised when an object with a specified label is not found.

OperationFailedError(operation, image_name, ...)

Exception raised when an operation fails.

OperationIntegrityError(opname, component[, ...])

Exception raised when an operation attempts to change a component it shouldn't.

OutputValueError(expected_type)

Exception raised when output is not of the expected type.

PhenoTypicError

Base exception class for all PhenoTypic errors.

UUIDReassignmentError()

Exception raised when trying to change the UUID metadata.

UnknownError([message])

Exception raised when an unknown error occurs.

UnsupportedFileTypeError(suffix)

Exception raised when trying to read an unsupported file type.

UnsupportedImageFormat(imformat)

Represents an error when an unsupported imformat format is detected.

UuidAssignmentError()

Exception raised when trying to change the UUID of an image.

exception phenotypic.tools.exceptions_.ArrayKeyValueShapeMismatchError[source]#

Bases: ValueError

Exception raised when the shape of the other_image doesn’t match the key’s section.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.DataIntegrityError(component, operation, image_name=None)[source]#

Bases: AttributeError

Exception raised when data integrity is compromised.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.EmptyImageError[source]#

Bases: AttributeError

Exception raised when no image data is loaded.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.GridImageInputError[source]#

Bases: ValueError

Exception raised when a non-GriddedImage object is provided as arr.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.IllegalAssignmentError(attr)[source]#

Bases: ValueError

Exception raised when trying to directly assign a new object to a protected attribute.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.IllegalElementAssignmentError(component_name)[source]#

Bases: ImmutableComponentError

Exception raised when trying to change rgb/gray elements directly.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.ImageOperationError[source]#

Bases: PhenoTypicError

Base exception for image operation errors.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.ImmutableComponentError[source]#

Bases: AttributeError

Base exception for immutable component errors.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.InputShapeMismatchError(param_name)[source]#

Bases: ValueError

Exception raised when arr shape doesn’t match the image gray.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.InterfaceError[source]#

Bases: NotImplementedError, PhenoTypicError

Exception raised when an abc_ method is called when it’s not supposed to be.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.InvalidHsvSchemaError(imformat)[source]#

Bases: AttributeError

Exception raised when trying to convert to HSV from a non-RGB imformat.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.InvalidMapValueError(value_type)[source]#

Bases: ValueError

Exception raised when trying to set object map with invalid other_image type.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.InvalidMaskScalarValueError[source]#

Bases: ValueError

Exception raised when trying to set mask with invalid scalar other_image.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.InvalidMaskValueError(value_type)[source]#

Bases: ValueError

Exception raised when trying to set mask with invalid other_image type.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.InvalidShapeError(component)[source]#

Bases: ValueError

Exception raised when a shape mismatch occurs.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.MetadataKeySpacesError[source]#

Bases: TypeError

Exception raised when metadata key contains spaces.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.MetadataKeyValueError(type_received)[source]#

Bases: ValueError

Exception raised when metadata key is not a string.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.MetadataValueNonScalarError(type_value)[source]#

Bases: TypeError

Exception raised when metadata other_image is not scalar.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.NoArrayError[source]#

Bases: AttributeError

Exception raised when no array is found.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.NoComponentError(component)[source]#

Bases: AttributeError

Exception raised when a required object is missing.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.NoImageDataError[source]#

Bases: AttributeError

Exception raised when no image data is loaded.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.NoObjectsError(image_name=None)[source]#

Bases: AttributeError

Exception raised when no objects are found in an image.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.NoOutputError[source]#

Bases: PhenoTypicError

Exception raised when no output was returned in an operation.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.ObjectNotFoundError(label)[source]#

Bases: AttributeError

Exception raised when an object with a specified label is not found.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.OperationFailedError(operation, image_name, err_type, message)[source]#

Bases: ImageOperationError

Exception raised when an operation fails.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.OperationIntegrityError(opname: str, component: str, image_name=None)[source]#

Bases: AttributeError

Exception raised when an operation attempts to change a component it shouldn’t.

Parameters:
  • opname (str)

  • component (str)

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.OutputValueError(expected_type)[source]#

Bases: PhenoTypicError

Exception raised when output is not of the expected type.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.PhenoTypicError[source]#

Bases: Exception

Base exception class for all PhenoTypic errors.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.UUIDReassignmentError[source]#

Bases: AttributeError

Exception raised when trying to change the UUID metadata.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object

exception phenotypic.tools.exceptions_.UnknownError(message='An unknown error occurred.')[source]#

Bases: PhenoTypicError

Exception raised when an unknown error occurs.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.UnsupportedFileTypeError(suffix)[source]#

Bases: ValueError

Exception raised when trying to read an unsupported file type.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.UnsupportedImageFormat(imformat)[source]#

Bases: ValueError

Represents an error when an unsupported imformat format is detected.

This error is raised when a specified imformat format is not supported by the application or library that utilizes this exception class.

Parameters:

schema (str) – The imformat format that triggered this exception.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
exception phenotypic.tools.exceptions_.UuidAssignmentError[source]#

Bases: AttributeError

Exception raised when trying to change the UUID of an image.

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

args#
name#

attribute name

obj#

object