Source code for ClearMap.Utils.exceptions

"""
Custom exceptions for ``ClearMap``
"""


[docs] class ClearMapException(Exception): """ Base exception for all exceptions in ClearMap """ pass
[docs] class ClearMapIoException(ClearMapException): """ Base exception for all exceptions related to input/output operations """ pass
[docs] class SourceModuleNotFoundError(ClearMapIoException): """ Exception raised when a source module is not found """ pass
[docs] class IncompatibleSource(ClearMapIoException): def __init__(self, source, variable_name, current_vars): self.source = source self.variable_name = variable_name self.current_value = current_vars.get(variable_name) self.source_value = getattr(source, variable_name, None) super().__init__(self._generate_message()) def _generate_message(self): return (f'Incompatible {self.variable_name} {self.current_value} != ' f'{self.source_value} for the source {self.source}!')
[docs] class MissingRequirementException(ClearMapException): """ Exception raised when a processing step is missing a required condition (i.e. an other step has not been run yet) """ pass
[docs] class ConfigNotFoundError(ClearMapException): """ Exception raised when a configuration file is not found """ pass
[docs] class PlotGraphError(ClearMapException): """ Exception raised when attempting to plot a graph that is e.g. too large """ pass
[docs] class ClearMapVRamException(ClearMapException): """ Exception raised when there is insufficient VRAM available for a processing step """ pass
[docs] class SmiError(ClearMapException): """ Exception raised when there is an error with the ``nvidia-smi`` command """ pass
[docs] class GroupStatsError(ClearMapException): """ Exception raised when there is an error with the group statistics """ pass
[docs] class ClearMapWorkspaceError(ClearMapException): """ Exception raised when there is an error with the workspace """ pass
[docs] class ClearMapAssetError(ClearMapWorkspaceError): """ Exception raised when there is an error with the asset """ pass
[docs] class AssetNotFoundError(ClearMapAssetError): """ Exception raised when an asset is not found """ pass