pcdsdevices.utils.get_status_float

pcdsdevices.utils.get_status_float(status_info, *keys, default_value='N/A', precision=4, format='f', scale=1.0, include_plus_sign=False)

Get the value of a dictionary key.

Format the value with the precision requested if it is a float value.

Parameters:
  • status_info (dict) – Dictionary to look through.

  • keys (list) – List of keys to look through with nested dictionarie.

  • default_value (str, optional) – A default value to return if the item value was not found.

  • precision (int, optional) – Precision requested for the float values. Defaults to 4.

  • format (str, optional) – Format specifier to use for the floating point value. Defaults to ‘f’.

  • scale (float, optional) – Scale to apply to value prior to formatting.

  • include_plus_sign (bool, optional) – Include a plus sign before a positive value for text alignment purposes. Defaults to False.

Returns:

value (dictionary item value, or N/A) – Value of the last key in the keys list formated with precision.