exa.core.plotting.qpu_core.utils.get_scaling_from_unit

exa.core.plotting.qpu_core.utils.get_scaling_from_unit#

get_scaling_from_unit(unit)#

Helper function to determine the applied scaling factor from the unit prefix. Currently, the function assumes that the first letter in the unit is the scaling factor. This is correct for our most commonly used units such as: A, V and Hz. Will not work as intended if the unit is kg.

Parameters:

unit (str) – string of the unit.

Returns:

A float corresponding to the scaling applied to the base SI unit.

Return type:

float