tango.pyaml.tango_pyaml_utils#

Small helpers shared by the Tango pyAML classes.

Functions

tango_to_PyAMLException(df)

Convert a Tango DevFailed exception to a PyAMLException.

to_float_or_none(s)

Convert a value to float, returning None when impossible.

tango.pyaml.tango_pyaml_utils.tango_to_PyAMLException(df)#

Convert a Tango DevFailed exception to a PyAMLException.

Parameters:

df (tango.DevFailed) – The original Tango exception to convert.

Returns:

pyaml.PyAMLException – Converted exception including reason, description, origin and severity.

Return type:

PyAMLException

tango.pyaml.tango_pyaml_utils.to_float_or_none(s)#

Convert a value to float, returning None when impossible.

Tango reports unset attribute limits as the string "Not specified"; this helper maps such values to None.

Parameters:

s (object) – Value to convert (typically a string or a number).

Returns:

float or None – The converted value, or None if s cannot be converted.