cytosnake.common package#
Submodules#
cytosnake.common.errors module#
Module: errors.py
Modules containing CytoSnake specific exceptions
Base Exceptions: Focuses on basic error types like incorrect values or invalid operations.
CytoSnake Specific Errors: Exceptions that are specific to CytoSnake
- exception cytosnake.common.errors.BarcodeMissingError#
Bases:
BaseFileNotFoundRaised when a barcode file is required
- exception cytosnake.common.errors.BaseExecutorException#
Bases:
RuntimeErrorBase exception related to cytosnake execution
- exception cytosnake.common.errors.BaseFileExistsError#
Bases:
FileExistsErrorRaised if an existing file or directory is found in a directory
- exception cytosnake.common.errors.BaseFileNotFound#
Bases:
FileNotFoundErrorRaised if a requested file is not found in cytosnake
- exception cytosnake.common.errors.BaseValueError#
Bases:
ValueErrorBase exception if incorrect values are passed
- exception cytosnake.common.errors.BaseWorkflowException#
Bases:
RuntimeErrorBase exception related to cytosnake’s workflow errors in runtime
- exception cytosnake.common.errors.ExtensionError#
Bases:
BaseValueErrorRaised when invalid extensions are captured
- exception cytosnake.common.errors.InvalidArgumentException#
Bases:
BaseValueErrorRaised when arguments requirements are not met
- exception cytosnake.common.errors.InvalidCytosnakeExec#
Bases:
BaseExecutorExceptionRaised if invalid cytosnake executable is being called
- exception cytosnake.common.errors.InvalidExecutableException#
Bases:
BaseExecutorExceptionRaised if any executables
- exception cytosnake.common.errors.InvalidModeException#
Bases:
BaseValueErrorRaised if in unsupported mode was passed
- exception cytosnake.common.errors.InvalidWorkflowException#
Bases:
BaseValueErrorRaised if invalid workflows were specified
- exception cytosnake.common.errors.MultipleModesException#
Bases:
BaseValueErrorRaised if multiple modes were provided
- exception cytosnake.common.errors.MultipleWorkflowsException#
Bases:
BaseValueErrorRaised if multiple workflows are declared
- exception cytosnake.common.errors.NoArgumentsException#
Bases:
BaseValueErrorRaised if no arguments were passed in the CLI interface
- exception cytosnake.common.errors.ProjectExistsError#
Bases:
BaseFileExistsErrorRaised when .cytosnake file is found within a directory indicating that the current directory has already been set up for cytosnake analysis
- exception cytosnake.common.errors.WorkflowFailedException#
Bases:
BaseWorkflowExceptionRaised if a workflow fails during runtime
- exception cytosnake.common.errors.WorkflowNotFoundError#
Bases:
BaseFileNotFoundRaised if workflow file is not found
- cytosnake.common.errors.display_error(error: BaseException | Exception, e_msg: None | str = None, exit_code: int | None = 1) None#
This function takes in an error type and a custom message. If the custom message is None, then the default string data found within the exception type will be used. The function will print the message of the error and ensures a non-zero exit code.
- Parameters:
error (Union[BaseException, Exception]) – Takes in a python error object
e_msg (Optional[Union[None, str]]) – Custom error message. Will overwrite default message from error objects. [default=None]
exit_code (int) – Exit code when error is raised. Cannot be lower than 1. [Default=1]
- Return type:
None
- Raises:
TypeError – Raised if error object is not an error type Raised if e_msg is not a string type Raised if exit_code is not an integer type
ValueError – Raised if exit_code is a negative number or is equal to 0