Version: dev

Units

Parsing unit strings, converting between units and checking the dimensional consistency of equations.

OperationKindBindingsSummary
apply_unit_conversionfunctionJulia, PythonNon-mutating apply_unit_conversion!: returns a converted copy, or values itself when there is nothing to apply.
build_unit_envfunctionRust, GoBuild a HashMap<String, Unit> environment from model variable metadata, together with a list of warnings for any variables whose declared unit string could not be parsed.
convert_unitsfunctionTypeScript, Python, RustConvert a numeric value from one unit string to another.
parse_unitfunctionTypeScript, Rust, GoParse a unit string into canonical SI dimensions plus scale factor.
parse_unit_conversionfunctionJulia, PythonParse a loader variable’s RAW unit_conversion (number | Expression).
validate_equation_dimensionsfunctionJulia, Rust, GoValidate that an equation is dimensionally consistent.
validate_unitsfunctionTypeScript, PythonValidate dimensional consistency of equations in an ESM file.
exact_scaletypeRust, GoThe EXACT scale of a unit relative to SI (esm-spec §4.8.1 “Scales are EXACT”).
unittypeRust, GoRepresents a physical unit with dimensions
unit_findingtypeJulia, Python, RustA 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…
unit_warningtypeJulia, TypeScript, Python, Rust, GoA single dimensional-analysis finding, in the STRUCTURED form the Python, TypeScript and Go bindings have always used and Julia did not: this field was a bare Vector{String},…
unit_conversion_errorerrorJulia, TypeScript, PythonA unit_conversion that cannot be parsed or applied.
unit_finding_analysisconstantPython, Rust, GoThe checker could not DETERMINE a dimension – a symbolic exponent, an operator with no dimensional rule, an unknown variable, a missing pint.
unit_finding_dimensional_mismatchconstantPython, Rust, GoA PROVABLE inconsistency: metres added to kilograms, an equation whose sides cannot agree.
unit_finding_unparseableconstantPython, Rust, GoA declared unit string that denotes no real unit.

All topics