cavcalc.parameters.tools.get_default_units#

cavcalc.parameters.tools.get_default_units(ptype: Union[str, ParameterType])#

Get the default units, as a string, of the given parameter type.

The default units value is obtained from the loaded config file(s); i.e. the first instance of the corresponding option in the load order: current working directory -> user config directory -> package install location.

Parameters:
ptypestr | ParameterType

The name (as it appears in the config file for example), or ParameterType, of the parameter.

Returns:
unitsOptional[str]

A string representing the units for the given parameter, or None, if ptype does not correspond to any valid option in any of the loaded config files.