src.util.exceptions module¶
All framework-specific exceptions are placed in a single module to simplify imports.
-
src.util.exceptions.exit_on_exception(exc, msg=None)[source]¶ Prints information about a fatal exception to the console beofre exiting. Use case is in user-facing subcommands (
mdtf installetc.), since we have more sophisticated logging in the framework itself. :param exc:Exceptionobject :param msg: additional message to print. :type msg: str, optional
-
src.util.exceptions.exit_handler(code=1, msg=None)[source]¶ Wraps all calls to
sys.exit(); could do additional cleanup not handled by atexit() here.
-
exception
src.util.exceptions.TimeoutAlarm[source]¶ Bases:
ExceptionDummy exception raised if a subprocess times out.
-
exception
src.util.exceptions.MDTFBaseException[source]¶ Bases:
ExceptionBase class to describe all MDTF-specific errors that can happen during the framework’s operation.
-
exception
src.util.exceptions.ChildFailureEvent(obj)[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionException raised when a member of the object hierarchy is deactivated because all its child objects have failed.
-
exception
src.util.exceptions.PropagatedEvent(exc, parent)[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionException passed between members of the object hierarchy when a parent object (
MDTFObjectBase) has been deactivated and needs to deactivate its children.
-
exception
src.util.exceptions.MDTFFileNotFoundError(path)[source]¶ Bases:
FileNotFoundError,src.util.exceptions.MDTFBaseExceptionWrapper for
FileNotFoundErrorwhich handles error codes so we don’t have to remember to importerrnoeverywhere.
-
exception
src.util.exceptions.MDTFFileExistsError(path)[source]¶ Bases:
FileExistsError,src.util.exceptions.MDTFBaseExceptionWrapper for
FileExistsErrorwhich handles error codes so we don’t have to remember to importerrnoeverywhere.
-
exception
src.util.exceptions.MDTFCalledProcessError(returncode, cmd, output=None, stderr=None)[source]¶ Bases:
subprocess.CalledProcessError,src.util.exceptions.MDTFBaseExceptionWrapper for
subprocess.CalledProcessError.
-
exception
src.util.exceptions.WormKeyError[source]¶ Bases:
KeyError,src.util.exceptions.MDTFBaseExceptionRaised when attempting to overwrite or delete an entry in a
WormDict.
-
exception
src.util.exceptions.DataclassParseError[source]¶ Bases:
ValueError,src.util.exceptions.MDTFBaseExceptionRaised when parsing input data fails on a
mdtf_dataclass()orregex_dataclass().
-
exception
src.util.exceptions.RegexParseError[source]¶ Bases:
ValueError,src.util.exceptions.MDTFBaseExceptionRaised when parsing input data fails on a
RegexPattern().
-
exception
src.util.exceptions.RegexSuppressedError[source]¶ Bases:
ValueError,src.util.exceptions.MDTFBaseExceptionRaised when parsing input data fails on a
RegexPattern(), but we’ve decided to supress error based on the associated RegexPattern’s match_error_filter attribute.
-
exception
src.util.exceptions.UnitsError[source]¶ Bases:
ValueError,src.util.exceptions.MDTFBaseExceptionRaised when trying to convert between quantities with physically inequivalent units.
-
exception
src.util.exceptions.ConventionError(conv_name)[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionException raised by a duplicate variable convention name.
-
exception
src.util.exceptions.MixedDatePrecisionException(func_name='', msg='')[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionException raised when we attempt to operate on
DateorDateRangeobjects with differing levels of precision, which shouldn’t happen with data sampled at a single frequency.
-
exception
src.util.exceptions.FXDateException(func_name='', msg='')[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionException raised when
FXDateorFXDateRangeclasses, which are placeholder/sentinel classes used to indicate static data with no time dependence, are accessed like realDateorDateRangeobjects.
-
exception
src.util.exceptions.DataRequestError[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionDummy class used for fatal errors that take place during the data query/fetch/preprocess stage of the framework.
-
exception
src.util.exceptions.MDTFEvent[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionDummy class to denote non-fatal errors, specifically “events” that are passed during the data query/fetch/preprocess stage of the framework.
-
exception
src.util.exceptions.FatalErrorEvent[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionDummy class used to “convert”
MDTFEvents to fatal errors (resulting in deactivation of a variable, pod or case.) via exception chaining.
-
exception
src.util.exceptions.DataProcessingEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.MDTFEventBase class and common formatting code for events raised in data query/fetch. These should not be used for fatal errors (when a variable or POD is deactivated.)
-
exception
src.util.exceptions.DataQueryEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.DataProcessingEventException signaling a failure to find requested data in the remote location.
-
exception
src.util.exceptions.DataExperimentEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.DataProcessingEventException signaling a failure to uniquely select an experiment for all variables based on query results.
-
exception
src.util.exceptions.DataFetchEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.DataProcessingEventException signaling a failure to obtain data from the remote location.
-
exception
src.util.exceptions.DataPreprocessEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.DataProcessingEventException signaling an error in preprocessing data after it’s been fetched, but before any PODs run.
-
exception
src.util.exceptions.MetadataEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.DataProcessingEventException signaling discrepancies in variable metadata.
-
exception
src.util.exceptions.MetadataError[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionException signaling unrecoverable errors in variable metadata.
-
exception
src.util.exceptions.UnitsUndefinedError[source]¶ Bases:
src.util.exceptions.MetadataErrorException signaling unrecoverable errors in variable metadata.
-
exception
src.util.exceptions.GenericDataSourceEvent(msg='', dataset=None)[source]¶ Bases:
src.util.exceptions.DataProcessingEventException signaling a failure originating in the DataSource query/fetch pipeline whose cause doesn’t fall into the above categories.
-
exception
src.util.exceptions.PodExceptionBase(msg=None, pod=None)[source]¶ Bases:
src.util.exceptions.MDTFBaseExceptionBase class and common formatting code for exceptions affecting a single POD.
-
_error_str= ''¶
-
-
exception
src.util.exceptions.PodConfigError(msg=None, pod=None)[source]¶ Bases:
src.util.exceptions.PodExceptionBaseException raised if we can’t parse info in a POD’s settings.jsonc file. (Covers issues with the file format/schema; malformed JSONC will raise a
JSONDecodeErrorwhenparse_json()attempts to parse the file.-
_error_str= "Couldn't parse the settings.jsonc file"¶
-
-
exception
src.util.exceptions.PodConfigEvent[source]¶ Bases:
src.util.exceptions.MDTFEventException raised during non-fatal events in resolving POD configuration.
-
exception
src.util.exceptions.PodDataError(msg=None, pod=None)[source]¶ Bases:
src.util.exceptions.PodExceptionBaseException raised if POD doesn’t have required data to run.
-
_error_str= 'Requested data not available'¶
-
-
exception
src.util.exceptions.PodRuntimeError(msg=None, pod=None)[source]¶ Bases:
src.util.exceptions.PodExceptionBaseException raised if POD doesn’t have required resources to run.
-
_error_str= 'Error in setting the runtime environment'¶
-
-
exception
src.util.exceptions.PodExecutionError(msg=None, pod=None)[source]¶ Bases:
src.util.exceptions.PodExceptionBaseException raised if POD exits with non-zero retcode or otherwise raises an error during execution.
-
_error_str= 'Error during POD execution'¶
-