Exceptions¶
Exception types raised by ionworkspipeline.
- class ionworkspipeline.exceptions.UserConfigurationError(*args, diagnostics: str | None = None)¶
Raised when a pipeline or element configuration is invalid.
Use it instead of a bare
ValueErrorfor anything the user fixes in their configuration. It subclassesValueErrorsoexcept ValueErrorhandlers keep catching araise ValueErrorthat is upgraded to it.Parameters¶
- messagestr
Human-readable description of what is wrong, written for the end user.
- diagnosticsstr or None, optional
Engineering detail kept out of the message, such as the traceback of the failure behind it. Keyword-only.
Extends:
ValueError
- class ionworkspipeline.exceptions.ModelError(*args, diagnostics: str | None = None)¶
Raised when a model fails to set up, discretise, initialise, or evaluate.
A
UserConfigurationErrorsubclass, which keeps the optimizer’sexcept ValueErrorNaN-fallback, but with its ownMODELkind so a model failure is reported as one rather than as generic configuration.Parameters¶
- messagestr
Human-readable description naming the objective and the underlying failure, written for the end user.
Extends:
UserConfigurationError
- class ionworkspipeline.exceptions.ParameterNotFoundError¶
Raised when a parameter key is not found in a pybamm ParameterValues lookup.
Subclasses
KeyErrorso existingexcept KeyErrorhandlers remain unaffected. The first positional argument is the human-readable message produced by pybamm’sFuzzyDict, e.g."'Negative electrode loading [A.h.cm-2]' not found. Best matches are [...]".Extends:
KeyError
- class ionworkspipeline.exceptions.AllStartsFailedError(message: str, *, child_failure: Failure | None = None, diagnostics: str | None = None, child_exception_type: str | None = None, child_message: str | None = None, child_error_code: str | None = None, child_log_url: str | None = None)¶
Raised when no fit is found: no start completed, or every evaluation failed.
Subclasses
RuntimeErrorso existingexcept RuntimeErrorhandlers remain unaffected. It takes the kind of the failure carried aschild_failure, so the fit as a whole is classified the way that failure was:classify_failure()readsfailure.Parameters¶
- messagestr
Summary of the total failure, written for the end user.
- child_failureFailure or None, optional
The failure the fit is classified by: the first failed start’s when no start completed, otherwise the first error an evaluation raised.
Nonewhen no start recorded an error (e.g. every start was canceled), which classifies the fit as internal.- diagnosticsstr or None, optional
Per-start statuses, costs and the first failure’s traceback, kept out of
message.- child_exception_typestr or None, optional
Deprecated; use
child_failure.exception_type.- child_messagestr or None, optional
Deprecated; use
child_failure.message.- child_error_codestr or None, optional
Deprecated; use
child_failure.kind.- child_log_urlstr or None, optional
Deep-link to the error-tracking event the failing start already captured, or
None.
Extends:
RuntimeError