In HED 8.5.0 a unit class may name a derived unit as its default. currentUnits lists only ampere and A but has defaultUnits=mA; likewise powerUnits (mW), resistanceUnits (kOhm), and electricPotentialUnits (uV, now that the explicit uV entry is removed).
Current behavior: SchemaUnitClass.defaultUnit (src/schema/entries.js) looks the default up among the explicitly listed units only, so it returns undefined for all four classes.
Expected behavior: return the listed unit from which the default derives (A for mA, W for mW, Ohm for kOhm, V for uV). For 8.4.0 nothing changes, since every default there is listed explicitly.
Nothing in src/ calls this getter today, but tests/otherTests/schema.spec.js does, and that test also hard-codes the 8.4.0 unit lists. When it is updated for 8.5.0 it needs the eight new unit classes and should compare the default by derivation rather than by name.
Same change is needed in hed-typescript (src/schema/entries/unitClass.ts).
In HED 8.5.0 a unit class may name a derived unit as its default.
currentUnitslists onlyampereandAbut hasdefaultUnits=mA; likewisepowerUnits(mW),resistanceUnits(kOhm), andelectricPotentialUnits(uV, now that the explicituVentry is removed).Current behavior:
SchemaUnitClass.defaultUnit(src/schema/entries.js) looks the default up among the explicitly listed units only, so it returnsundefinedfor all four classes.Expected behavior: return the listed unit from which the default derives (
AformA,WformW,OhmforkOhm,VforuV). For 8.4.0 nothing changes, since every default there is listed explicitly.Nothing in
src/calls this getter today, buttests/otherTests/schema.spec.jsdoes, and that test also hard-codes the 8.4.0 unit lists. When it is updated for 8.5.0 it needs the eight new unit classes and should compare the default by derivation rather than by name.Same change is needed in hed-typescript (
src/schema/entries/unitClass.ts).