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: BaseFileNotFound

Raised when a barcode file is required

exception cytosnake.common.errors.BaseExecutorException#

Bases: RuntimeError

Base exception related to cytosnake execution

exception cytosnake.common.errors.BaseFileExistsError#

Bases: FileExistsError

Raised if an existing file or directory is found in a directory

exception cytosnake.common.errors.BaseFileNotFound#

Bases: FileNotFoundError

Raised if a requested file is not found in cytosnake

exception cytosnake.common.errors.BaseValueError#

Bases: ValueError

Base exception if incorrect values are passed

exception cytosnake.common.errors.BaseWorkflowException#

Bases: RuntimeError

Base exception related to cytosnake’s workflow errors in runtime

exception cytosnake.common.errors.ExtensionError#

Bases: BaseValueError

Raised when invalid extensions are captured

exception cytosnake.common.errors.InvalidArgumentException#

Bases: BaseValueError

Raised when arguments requirements are not met

exception cytosnake.common.errors.InvalidCytosnakeExec#

Bases: BaseExecutorException

Raised if invalid cytosnake executable is being called

exception cytosnake.common.errors.InvalidExecutableException#

Bases: BaseExecutorException

Raised if any executables

exception cytosnake.common.errors.InvalidModeException#

Bases: BaseValueError

Raised if in unsupported mode was passed

exception cytosnake.common.errors.InvalidWorkflowException#

Bases: BaseValueError

Raised if invalid workflows were specified

exception cytosnake.common.errors.MultipleModesException#

Bases: BaseValueError

Raised if multiple modes were provided

exception cytosnake.common.errors.MultipleWorkflowsException#

Bases: BaseValueError

Raised if multiple workflows are declared

exception cytosnake.common.errors.NoArgumentsException#

Bases: BaseValueError

Raised if no arguments were passed in the CLI interface

exception cytosnake.common.errors.ProjectExistsError#

Bases: BaseFileExistsError

Raised 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: BaseWorkflowException

Raised if a workflow fails during runtime

exception cytosnake.common.errors.WorkflowNotFoundError#

Bases: BaseFileNotFound

Raised 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

Module contents#