automation_exceptions

This module consists of a various classes of exceptions which are used throughout the project.

Base Exception

AutomationError is the base class for all exceptions in this package.

class microscope_automation.util.automation_exceptions.AutomationError(message=None, error_component=None)[source]

Base exception for all errors in package microscopeautomation

Hardware Exceptions

The following exceptions are used for hardware-related errors. The first, HardwareError, extends Base Exception and is the base class for the others.

class microscope_automation.util.automation_exceptions.HardwareError(message=None, error_component=None)[source]

Exception for failures in hardware.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.HardwareDoesNotExistError(message=None, error_component=None)[source]

Exception if hardware was not defined.

error_dialog(advice='')[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.CrashDangerError(message=None, error_component=None)[source]

Exception if danger for hardware was detected.

error_dialog(advice='')[source]

Show error message to user.

Input:

advice: str with advice to user of how to avoid crash.

Output:

none

class microscope_automation.util.automation_exceptions.HardwareNotReadyError(message=None, error_component=None)[source]

Exception if hardware is not ready for experiment.

error_dialog(advice='')[source]

Show error message to user.

Input:

advice: str with advice to user of how to avoid crash.

Output:

none

class microscope_automation.util.automation_exceptions.HardwareCommandNotDefinedError(message=None, error_component=None)[source]

Exception if experiment is not defined for this microscope.

error_dialog(advice='')[source]

Show error message to user.

Input:

advice: str with advice to user of how to avoid crash.

Output:

none

Autofocus Exceptions

The following exceptions are used for autofocus-related errors. The first, AutofocusError, extends Hardware Exceptions and is the base class for the others.

class microscope_automation.util.automation_exceptions.AutofocusError(message=None, error_component=None, focus_reference_obj_id=None)[source]

Exception if autofocus failed.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

get_focus_reference_obj_id()[source]
Retrieve object (typcially plate) that is used as reference for autofocus

offset.

Input:

none

Output:

focus_reference_obj_id: Sample object used as reference for autofocus

set_focus_reference_obj_id(focus_reference_obj_id)[source]

Set object (typcially plate) that is used as reference for autofocus offset.

Input:

focus_reference_obj_id: Sample object used as reference for autofocus

Output:

None

class microscope_automation.util.automation_exceptions.AutofocusObjectiveChangedError(message=None, error_component=None, focus_reference_obj_id=None)[source]

Exception if objective was changed since autofocus was initialized

Input:

focus_reference_obj_id: Sample object used as reference for autofocus

message: Test to display as error message

Output:

none

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.AutofocusNotSetError(message=None, error_component=None, focus_reference_obj_id=None)[source]

Exception if objective was changed since autofocus was initialized

Input:

focus_reference_obj_id: Sample object used as reference for autofocus

message: Test to display as error message

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.AutofocusNoReferenceObjectError(message=None, error_component=None, focus_reference_obj_id=None)[source]

Exception if no reference object was selected for autofocus

Input:

focus_reference_obj_id: Sample object used as reference for autofocus

message: Test to display as error message

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

Focus Drive Exceptions

The following exceptions are used for focus drive related errors. They extend Hardware Exceptions.

class microscope_automation.util.automation_exceptions.LoadNotDefinedError(message=None, error_component=None)[source]

Exception if load position for focus drive is not defined.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.WorkNotDefinedError(message=None, error_component=None)[source]

Exception if work position for focus drive is not defined.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

Objective Changer Exceptions

The following exception is used for objective changer related errors. It extends Hardware Exceptions.

class microscope_automation.util.automation_exceptions.ObjectiveNotDefinedError(message=None, error_component=None)[source]

Exception if selected objective was not defined.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

Experiment Exceptions

he following exceptions are used for experiment-related errors. The first, ExperimentError, extends Hardware Exceptions and is the base class for the others.

class microscope_automation.util.automation_exceptions.ExperimentError(message=None, error_component=None)[source]

Exception for failures experiment execution.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.ExperimentNotExistError(message=None, error_component=None)[source]

Exception for failures experiment execution.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

I/O Exceptions

The following exceptions are used for read and write errors. The first, IOError, extends Base Exception and is the base class for the others.

class microscope_automation.util.automation_exceptions.IOError(message=None, error_component=None)[source]

Exception for I/O errors.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.FileExistsError(message=None, error_component=None)[source]

Exception if file exists to prevent overriding it.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

class microscope_automation.util.automation_exceptions.MetaDataNotSavedError(message=None, error_component=None)[source]

Exception if data could not be saved to meta data file.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

Program Flow Exceptions

The following exception, which extends Base Exception is thrown when the automated workflow is stopped and images are no longer being taken.

class microscope_automation.util.automation_exceptions.StopCollectingError(message=None, error_component=None)[source]

Stop collecting sample positions.

error_dialog()[source]

Show error message to user.

Input:

none

Output:

none

Helper Functions

microscope_automation.util.automation_exceptions.set_error_blocking(block)[source]

Set blocking behavior of error dialogs.

Input:

block: if True use modal dialog for error reporting, otherwise print message

Output:

None

microscope_automation.util.automation_exceptions.get_error_blocking()[source]

Retrieve blocking behavior of error dialogs.

Input:

none

Output:

blocking: if True use modal dialog for error reporting, otherwise print message

Output:

None