phenotypic.sdk_.exceptions_ module#

PhenoTypic Exceptions

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

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

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

Exception raised when data integrity is compromised.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: AttributeError

Exception raised when no image data is loaded.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

exception phenotypic.sdk_.exceptions_.GrayscaleOutOfRangeError(value)[source]#

Bases: PhenoTypicError

Exception raised when grayscale is out of range.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
exception phenotypic.sdk_.exceptions_.GridImageInputError[source]#

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ImmutableComponentError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: PhenoTypicError

Base exception for image operation errors.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

Base exception for immutable component errors.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: NotImplementedError, PhenoTypicError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ValueError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ValueError

Exception raised when a shape mismatch occurs.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: TypeError

Exception raised when metadata key contains spaces.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ValueError

Exception raised when metadata key is not a string.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: TypeError

Exception raised when metadata other_image is not scalar.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

Exception raised when no array is found.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: AttributeError

Exception raised when a required object is missing.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: AttributeError

Exception raised when no image data is loaded.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: AttributeError

Exception raised when no objects are found in an image.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: PhenoTypicError

Exception raised when no output was returned in an operation.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: ImageOperationError

Exception raised when an operation fails.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
exception phenotypic.sdk_.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)

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: PhenoTypicError

Exception raised when output is not of the expected type.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: Exception

Base exception class for all PhenoTypic errors.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

Exception raised when trying to change the UUID metadata.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object

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

Bases: PhenoTypicError

Exception raised when an unknown error occurs.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: ValueError

Exception raised when trying to read an unsupported file type.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
exception phenotypic.sdk_.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.

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

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

Bases: AttributeError

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

add_note()#

Exception.add_note(note) – add a note to the exception

with_traceback()#

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

args#
name#

attribute name

obj#

object