pycba.units.resolve#

resolve(units=None)[source]#

Resolve a units argument to a UnitSystem.

None returns the global default (see set_units()); a string is looked up among the presets (case-insensitive); a UnitSystem is returned unchanged.

Raises:

KeyError – If units is an unknown preset name.

Return type:

UnitSystem