perturbopy.postproc.utils.constants.prefix_exp

perturbopy.postproc.utils.constants.prefix_exp(prefix)

” Finds the exponent corresponding to a prefix. For example, the prefix ‘c’ (centi) corresponds to 1e-2, so the exponent returned would be -2.

Parameters:

prefix (str) – The 1-2 letter case-sensitive prefix.

Returns:

exponent – The exponent corresponding to the prefix.

Return type:

int

Raises:

ValueError – If prefix is not in prefix_exps_dict.keys(). These are: [‘y’, ‘z’, ‘a’, ‘f’, ‘p’, ‘n’, ‘mu’, ‘m’, ‘c’, ‘d’, ‘da’, ‘h’, ‘k’, ‘M’, ‘G’, ‘T’, ‘P’, ‘E’, ‘Z’, ‘Y’]

Examples

>>> prefix_exp('c')
-2
>>> prefix_exp('mu')
-6
>>> prefix_exp(k)
3