unit_finding
Stable type · Units
Tier: stable · Kind: type · Topic: Units
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
UnitFinding | not exported | UnitFinding | UnitFinding | not exported |
Julia
struct UnitFinding
UnitFinding(subpath::String, message::String, code::String)
UnitFinding(subpath, message, code)
UnitFinding
A units finding: subpath RELATIVE to the owning model’s JSON pointer (e.g.
"equations/0", "variables/invalid_sum"), a human-readable message, and the
esm-spec §4.8.4 severity code.
Both codes are HARD ERRORS — the type exists to distinguish why the file is
wrong, not to distinguish an error from a warning. An UNDETERMINABLE dimension
is never a finding at all: it is reported by returning nothing from the
engine, and the enclosing check is skipped.
TypeScript
TypeScript does not export this type.
Python
class UnitFinding
UnitFinding(code: str, message: str, lhs_units: str = '', rhs_units: str = '')
One coded dimensional-analysis finding.
Carries the code decided at the raise site alongside the prose, so
validate
can build a
UnitWarning
without parsing the message.
Rust
pub struct UnitFinding {
pub severity: UnitSeverity,
pub message: String,
}
impl UnitFinding { pub fn is_error(&self) -> bool }
impl UnitFinding { pub fn code(&self) -> &'static str }
A single dimensional finding produced while propagating an expression.
Go
Go does not export this type.