Evaluation errors
mdo_framework.core.errors
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
EvaluationError
Bases: ValueError
An evaluation point failed; the run may continue with other points.
It subclasses ValueError because GEMSEO's parallel execution re-raises
only ValueError subclasses.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
str
|
Stable machine-readable code of the error class. |
retryable |
bool
|
Whether evaluating the same point again may succeed. |
message |
What went wrong, without the tool prefix. |
|
tool |
Name of the tool that failed, if any. |
Source code in src/mdo_framework/core/errors.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
__init__(message, *, tool=None)
Build the error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
What went wrong. |
required |
tool
|
str | None
|
Name of the tool that failed, prefixed to the message. |
None
|
Source code in src/mdo_framework/core/errors.py
27 28 29 30 31 32 33 34 35 36 | |
to_payload()
Serialize the error for a service response.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The |
dict[str, Any]
|
|
Source code in src/mdo_framework/core/errors.py
38 39 40 41 42 43 44 45 46 47 48 49 50 | |
InfeasiblePointError
Bases: ToolError
A tool declares that it cannot compute this point, e.g. a failed mesh.
Tools raise it themselves to report a point outside their domain of validity, which is a point failure rather than a tool crash.
Source code in src/mdo_framework/core/errors.py
71 72 73 74 75 76 77 78 | |
MDANotConvergedError
Bases: EvaluationError
The coupled tools did not reach a fixed point within the MDA limits.
Source code in src/mdo_framework/core/errors.py
81 82 83 84 | |
ToolError
Bases: EvaluationError
A tool could not produce valid outputs for a point.
Source code in src/mdo_framework/core/errors.py
53 54 55 56 | |
ToolExecutionError
Bases: ToolError
The tool function raised an exception.
Source code in src/mdo_framework/core/errors.py
59 60 61 62 | |
ToolOutputError
Bases: ToolError
The tool returned outputs that break the output contract.
Source code in src/mdo_framework/core/errors.py
65 66 67 68 | |
evaluation_error_from_payload(payload)
Rebuild the error a service serialized with EvaluationError.to_payload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload
|
Any
|
The decoded |
required |
Returns:
| Type | Description |
|---|---|
EvaluationError | None
|
The error with the same class, message and tool, or |
EvaluationError | None
|
payload is not a serialized evaluation error: unknown |
EvaluationError | None
|
field types, or a |
Source code in src/mdo_framework/core/errors.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |