units
Centralized IAM→PyPSA unit conventions — one place for every conversion factor.
Conversion numbers live here, never as literals in the transforms or the Coupler, so that
(a) a factor like 1e6 has a named, documented home, and (b) switching to another IAM means
supplying a different table, not hunting through the code.
The single source of truth is UNIT_CONVERSIONS: a (from_unit, to_unit) → factor table.
The symbol YAML declares each quantity's source/target unit (unit/units + to_unit,
or per-row in a schema) and the loader resolves the factor through unit_factor. Identical
units convert with factor 1.0 and need no table entry.
Naming note: molar masses use MOLAR_MASS_* (g/mol) — never MW, which here clashes with
megawatts.
unit_factor(from_unit, to_unit)
¶
Return the multiplicative factor converting from_unit → to_unit.
Identical units return 1.0. An undeclared pair raises (fail loud, not silently wrong) —
add it to UNIT_CONVERSIONS.