tango_simlib.utilities modules¶
tango_simlib.utilities.base_parser module¶
tango_simlib.utilities.fandango_json_parser module¶
This module performs the parsing of the TANGO device data json file as produced by the fandango library, containing the information needed to instantiate a useful device simulator.
Instructions on how to create this json file can be found at the link below: https://github.com/tango-controls/fandango/blob/master/doc/recipes/ExportDeviceData.rst
-
class
tango_simlib.utilities.fandango_json_parser.
FandangoExportDeviceParser
[source]¶ Bases:
tango_simlib.utilities.base_parser.Parser
-
get_device_attribute_metadata
()[source]¶ Returns the device’s attributes configuration.
- self._device_attributes: dict
The data structure format is a dict containing attribute info in a dict e.g.
{ ‘State’: {
‘abs_change’: ‘Not specified’, ‘archive_abs_change’: ‘Not specified’, ‘archive_period’: ‘Not specified’, ‘archive_rel_change’: ‘Not specified’, ‘data_format’: tango._tango.AttrDataFormat.SCALAR, ‘data_type’: tango._tango.CmdArgType.DevState, ‘description’: ‘’, ‘display_unit’: ‘No display unit’, ‘delta_t’: ‘Not specified’, ‘delta_val’: ‘Not specified’, ‘enum_labels’: [], ‘event_period’: ‘1000’, ‘label’: ‘State’, ‘max_alarm’: ‘Not specified’, ‘max_dim_x’: 1, ‘max_dim_y’: 0, ‘max_value’: ‘Not specified’, ‘max_warning’: ‘Not specified’, ‘min_alarm’: ‘Not specified’, ‘min_value’: ‘Not specified’, ‘min_warning’: ‘Not specified’, ‘name’: ‘State’, ‘polling’: 1000, ‘quality’: PyTango.AttrQuality.ATTR_VALID, ‘rel_change’: ‘Not specified’, ‘standard_unit’: ‘No standard unit’, ‘unit’: ‘’, ‘value’: 0, ‘writable’: ‘READ’},}
-
get_device_command_metadata
()[source]¶ Returns the device’s commands configuration.
- self._device_attributes: dict
The data structure format is a dict containing attribute info in a dict e.g. {
- ‘State’: {
- ‘doc_in’: ‘Uninitialised’, ‘doc_out’: ‘Device state’, ‘dtype_in’: tango._tango.CmdArgType.DevVoid, ‘dtype_out’: tango._tango.CmdArgType.DevState, ‘name’: ‘State’
},
}
-
get_device_properties_metadata
(property_group)[source]¶ Returns the device’s class or device property configuration.
- self._device_attributes: dict
The data structure format is a dict containing class or device property info in a dict. e.g. {
- ‘<property-name>’: {
- ‘DefaultPropValue’: ‘<list-of-strings>’, ‘name’: ‘<property-name>’, ‘type’: ‘<data-type>’}
}
-
preprocess_attribute_types
(attribute_data)[source]¶ Convert the attribute data types from strings to the TANGO types.
-
preprocess_command_types
(command_data)[source]¶ Convert the command input and output data types from strings to the TANGO types and rename the command properties to match with the keyword arguments of the command signature.
-
update_property_data
(property_data)[source]¶ Update key values to a dict with keys ‘DefaultPropValue’,’name’ and ‘type’.
property_data: dict e.g.
- {
- ‘<property-name>’: ‘<list-of-strings>’, ‘<property-name>’: ‘<list-of-strings>’
}
- property_data is reformatted to the format below
- {
- ‘<property-name>’: {
- ‘DefaultPropValue’: ‘<list-of-strings>’, ‘name’: ‘<property-name>’, ‘type’: ‘<data-type>’},
- ‘<property-name>’: {
- ‘DefaultPropValue’: ‘<list-of-strings>’, ‘name’: ‘<property-name>’, ‘type’: ‘<data-type>’}
}
-
tango_simlib.utilities.helper_module module¶
tango_simlib.utilities.simsdd_xml_json_parser module¶
This module performs the parsing of the SKA Self-Description Data XML schema file generated from the DSL.
-
class
tango_simlib.utilities.sim_sdd_xml_parser.
SDDParser
[source]¶ Bases:
tango_simlib.utilities.base_parser.Parser
Parses the SDD XML file generated from DSL.
data_description_file_name: str
device_class_name: str
tango_simlib.utilities.sim_xmi_parser module¶
Simlib library generic simulator generator utility to be used to generate an actual TANGO device that exhibits the behaviour defined in the data description file.
-
class
tango_simlib.utilities.sim_xmi_parser.
XmiParser
[source]¶ Bases:
tango_simlib.utilities.base_parser.Parser
Parses the XMI file generated from POGO.
data_description_file_name: str
device_class_name: str
-
extract_attributes_description_data
(description_data)[source]¶ Extract attribute description data from the xmi tree element.
- description_data: xml.etree.ElementTree.Element
XMI tree element with attribute data
Expected element tag(s) are (i.e. description_data.tag) ‘dynamicAttributes’
description_data.find(‘properties’).attrib contains {
‘description’: ‘’, ‘deltaValue’: ‘’, ‘maxAlarm’: ‘’, ‘maxValue’: ‘’, ‘minValue’: ‘’, ‘standardUnit’: ‘’, ‘minAlarm’: ‘’, ‘maxWarning’: ‘’, ‘unit’: ‘’, ‘displayUnit’: ‘’, ‘format’: ‘’, ‘deltaTime’: ‘’, ‘label’: ‘’, ‘minWarning’: ‘’}
and
description_data.attrib contains {
‘maxX’: ‘’, ‘maxY’: ‘’, ‘attType’: ‘Scalar’, ‘polledPeriod’: ‘0’, ‘displayLevel’: ‘OPERATOR’, ‘isDynamic’: ‘false’, ‘rwType’: ‘WRITE’, ‘allocReadMember’: ‘false’, ‘name’: ‘Constant’}
description_data.find(‘eventCriteria’).attrib contains {
‘relChange’: ‘10’, ‘absChange’: ‘0.5’, ‘period’: ‘1000’}
description_data.find(‘evArchiveCriteria’).attrib contains {
‘relChange’: ‘10’, ‘absChange’: ‘0.5’, ‘period’: ‘1000’}
- attribute_data: dict
- Dictionary of all attribute data required to create a tango attribute
-
extract_command_description_data
(description_data)[source]¶ Extract command description data from the xmi tree element.
- description_data: xml.etree.ElementTree.Element
XMI tree element with command data, where expected element tag(s) are (i.e. description_data.tag) [‘argin’, ‘argout’] and description_data.attrib contains {
‘description’: ‘Turn On Device’, ‘displayLevel’: ‘OPERATOR’, ‘isDynamic’: ‘false’, ‘execMethod’: ‘on’, ‘polledPeriod’: ‘0’, ‘name’: ‘On’}
- command_data: dict
- Dictionary of all the command data required to create a tango command
-
extract_device_class_descr
(description_data)[source]¶ Extract Tango device class description data from the xmi tree element.
- description_data: xml.etree.ElementTree.Element
XMI tree element with class description data, where expected element tag(s) are (i.e. description_data.tag) [‘inheritances(s)’, ‘identification’] and description_data.attrib contains {
‘description’: ‘’, ‘title’: ‘’, ‘sourcePath’: ‘’, ‘language’: ‘’, ‘filestogenerate’: ‘’, ‘license’: ‘’, ‘copyright’: ‘’, ‘hasMandatoryProperty’: ‘’, ‘hasConcreteProperty’: ‘’, ‘hasAbstractCommand’: ‘’, ‘hasAbstractAttribute’ : ‘’}
-
extract_property_description_data
(description_data, property_group)[source]¶ Extract device/class property description data from the xmi tree element.
- description_data: xml.etree.ElementTree.Element
XMI tree element with device property data
Expected element tag(s) are (i.e. description_data.tag) [‘DefaultPropValue’]
description_data.attrib contains {
‘description’: ‘’, ‘name’: ‘katcp_address’, ‘type’: ‘’}
- property_group: str
- A string representing a group to which the property belongs to, either device properties or class properties.
- device_property_data: dict
- Dictionary of all device property data required to create a tango device property
-
get_device_attribute_metadata
()[source]¶ Converts the device_attributes data structure into a dictionary to make searching easier.
- e.g.
- [{
- ‘dynamicAttributes’: {
- ‘displayLevel’: ‘’, ‘maxX’: <int>, ‘maxY’: <int>, ‘attType’: <tango._tango.AttrDataFormat>, ‘polledPeriod’: ‘’, ‘dataType’: <tango._tango.CmdArgType>, ‘isDynamic’: ‘<boolean>’, ‘rwType’: ‘’, ‘allocReadMember’: ‘<boolean>’, ‘name’: ‘<attribute-name>’
}, ‘eventCriteria’: {
‘relChange’: ‘’, ‘absChange’: ‘’, ‘period’: ‘’}, ‘evArchiveCriteria’: {
‘relChange’: ‘’, ‘absChange’: ‘’, ‘period’: ‘’}, ‘properties’: {
‘description’: ‘’, ‘deltaValue’: ‘’, ‘maxAlarm’: ‘’, ‘maxValue’: ‘’, ‘minValue’: ‘’, ‘standardUnit’: ‘’, ‘minAlarm’: ‘’, ‘maxWarning’: ‘’, ‘unit’: ‘’, ‘displayUnit’: ‘’, ‘format’: ‘’, ‘deltaTime’: ‘’, ‘label’: ‘’, ‘minWarning’: ‘’}
}]
- attributes: dict
A dictionary of all the device attributes together with their metadata specified in the POGO generated XMI file. The key represents the name of the attribute and the value is a dictionary of all the attribute’s metadata.
e.g. {‘<attribute-name>’: {
‘abs_change’: ‘’, ‘archive_abs_change’: ‘’, ‘archive_period’: ‘’, ‘archive_rel_change’: ‘’, ‘data_type’: <tango._tango.CmdArgType>, ‘data_format: <tango._tango.AttrDataFormat>, ‘delta_t’: ‘’, ‘delta_val’: ‘’, ‘description’: ‘’, ‘display_unit’: ‘’, ‘event_period’: ‘’, ‘format’: ‘’, ‘label’: ‘’, ‘max_alarm’: ‘’, ‘max_value’: ‘’, ‘max_warning’: ‘’, ‘min_alarm’: ‘’, ‘min_value’: ‘’, ‘min_warning’: ‘’, ‘name’: ‘<attribute-name>’, ‘period’: ‘’, ‘rel_change’: ‘’, ‘standard_unit’: ‘’, ‘unit’: ‘’, ‘writable’: ‘’, ‘enum_labels’: []}, # If attribute data type is DevEnum}
-
get_device_class_description_metadata
()[source]¶ Returns a dictionary containing the Tango class description information.
e.g. {
- ‘super_classes [{
- ‘classname’: ‘’, ‘sourcePath’: ‘<absolute path to the parent xmi file>’ }],
}
class_description : dict
- e.g.
- {
- ‘super_classes’: [
- {
- ‘classname’: ‘<device-class-name>’, ‘sourcePath’: ‘<absolute path to the parent xmi file>’
}
]
}
-
get_device_command_metadata
()[source]¶ Converts the device_commands data structure into a dictionary that makes searching easier.
- e.g.
- [
- {
- ‘name’: ‘<command-name>’, ‘arginDescription’: ‘’, ‘arginType’: <tango._tango.CmdArgType>, ‘argoutDescription’: ‘’, ‘argoutType’: <tango._tango.CmdArgType>, ‘description’: ‘’
}
]
- commands : dict
A dictionary of all the device commands together with their metadata specified in the POGO generated XMI file. The key represents the name of the command and the value is a dictionary of all the command’s metadata.
- e.g.
- {
- ‘<command-name>’: {
- ‘doc_in’: ‘’, ‘doc_out’: ‘’, ‘dtype_in’: <tango._tango.CmdArgTypee>, ‘dtype_out’: <tango._tango.CmdArgType>, ‘inherited’: ‘<boolean>’, ‘name’: ‘<command-name’
}
}
-
get_device_properties_metadata
(property_group)[source]¶ Creates a dictionary of the device/class properties and their metadata.
- e.g.
- [
- {
- ‘deviceProperties’: {
- ‘type’: <tango._tango.CmdArgType>, ‘mandatory’: ‘<boolean>’, ‘description’: ‘’, ‘name’: ‘<property-name>’, ‘DefaultPropValue’: ‘<any object>’
}
}
]
or
- [
- {
- ‘classProperties’: {
- ‘type’: <tango._tango.CmdArgType>, ‘mandatory’: ‘<boolean>’, ‘description’: ‘’, ‘name’: ‘’, ‘DefaultPropValue’: ‘<any object>’
}
}
]
- property_group: str
- A string representing a group to which the property belongs to, either device properties or class properties (deviceProperties or classProperties).
- properties: dict
A dictionary of all the device/class properties together with their metadata specified in the POGO generated XMI file. The keys represent the name of the device/class property and the value is a dictionary of all the property’s metadata.
- e.g.
- {
- ‘<property-name>’ : {
- ‘DefaultPropValue’: ‘<object>’, ‘description’: ‘’, ‘inherited’: ‘<boolean>’, ‘mandatory’: ‘<booolean>’, ‘name’: ‘<property-name>’, ‘type’: <tango._tango.CmdArgType>
}
}
-
parse
(sim_xmi_file)[source]¶ Read simulator description data from xmi file into self._device_properties.
Stores all the simulator description data from the xmi tree into appropriate attribute, command and device property data structures. Loops through the xmi tree class elements and appends description information of dynamic/attributes into self._device_attributes, commands into self._device_commands, and device_properties into self._device_properties.
- sim_xmi_file: str
- Name of simulator descrition data file
- Data structures, are type list with dictionary elements keyed with description data and values must be the corresponding data value.
-
tango_simlib.utilities.simdd_json_parser module¶
This module performs the parsing of the Simulator Description Datafile, containing the information needed to instantiate a useful device simulator.
-
class
tango_simlib.utilities.simdd_json_parser.
SimddParser
[source]¶ Bases:
tango_simlib.utilities.base_parser.Parser
Parses the SimDD JSON file.
data_description_file_name: str
device_class_name: str
-
get_device_attribute_metadata
()[source]¶ Returns a more formatted attribute data structure in a format of dict.
- e.g.
- {
- ‘<attribute-name>’: {
- ‘abs_change’: ‘’, ‘archive_abs_change’: ‘’, ‘archive_period’: ‘’, ‘archive_rel_change’: ‘’, ‘data_format’: ‘’, ‘data_type’: <tango._tango.CmdArgType>, ‘delta_t’: ‘’, ‘delta_val’: ‘’, ‘description’: ‘’, ‘display_level’: ‘’, ‘event_period’: ‘’, ‘label’: ‘’, ‘max_alarm’: ‘’, ‘max_bound’: ‘’, ‘max_dim_x’: ‘<int>’, ‘max_dim_y’: ‘<int>’, ‘max_slew_rate’: ‘’, ‘max_value’: ‘’, ‘mean’: ‘’, ‘min_alarm’: ‘’, ‘min_bound’: ‘’, ‘min_value’: ‘’, ‘name’: ‘<attribute-name>’, ‘quantity_simulation_type’: ‘<Quantity-subclass’, ‘period’: ‘’, ‘rel_change’: ‘’, ‘unit’: ‘’, ‘update_period’: ‘’, ‘writable’: ‘’},
}
-
get_device_cmd_override_metadata
()[source]¶ Returns more formatted device override info data structure in dict format.
- e.g.
- {
- ‘Sim_<class-name>_Override’: {
- ‘class_name’: ‘<override-class-name>’, ‘module_directory’: ‘<absolute-path>’, ‘module_name’: ‘<module_name>’, ‘name’: ‘Sim_<class-name>_Override’
}
}
-
get_device_command_metadata
()[source]¶ Returns a more formatted command data structure in a format of dict.
- e.g.
- {
- ‘<command-name>’: {
- ‘actions’: [
- {
- ‘behaviour’: ‘’, ‘source_variable’: ‘’
}
], ‘description’: ‘’, ‘dformat_in’: ‘’, ‘dformat_out’: ‘’, ‘doc_in’: ‘’, ‘doc_out’: ‘’, ‘dtype_in’: <tango._tango.CmdArgType>, ‘dtype_out’: <tango._tango.CmdArgType>, ‘name’: ‘<command-name>’, ‘override_handler’: ‘<boolean>’},
}
-
get_device_data_components_dict
(elements, element_type)[source]¶ Extract description data from the simdd json element.
- elements: list
- List of device data elements with items in unicode format
- e.g.
- [
- {
- ‘basicAttributeData’: {
‘name’: ‘<attribute-name>’, ‘unit’: ‘’, ‘label’: ‘’, ‘description’: ‘’, ‘data_type’: ‘<tango._tango.CmdArgType>’, ‘data_format’: ‘<tango._tango.AttrDataFormat>’, ‘delta_t’: ‘’, ‘delta_val’: ‘’, ‘data_shape’: {
‘max_dim_x’: ‘<int>’, ‘max_dim_y’: ‘<int>’}, ‘attributeErrorChecking’: {
‘min_value’: ‘’, ‘max_value’: ‘’, ‘min_alarm’: ‘’, ‘max_alarm’: ‘’}, ‘attributeInterlocks’: {
‘writable’: ‘’}, ‘dataSimulationParameters’: {
‘quantity_simulation_type’: ‘GaussianSlewLimited’, ‘min_bound’: ‘-10’,
‘max_bound’: ‘50’, ‘mean’: ‘25’, ‘max_slew_rate’: ‘1’, ‘update_period’: ‘1’, ‘std_dev’: ‘5’
}, ‘attributeControlSystem’: {
‘display_level’: ‘OPERATOR’, ‘period’: ‘1000’, ‘EventSettings’: {
- ‘eventArchiveCriteria’: {
- ‘archive_abs_change’: ‘0.5’, ‘archive_period’: ‘1000’, ‘archive_rel_change’: ‘10’
}, ‘eventCrateria’: {
‘abs_change’: ‘0.5’, ‘event_period’: ‘1000’, ‘rel_change’: ‘10’}
}
}
}
}]
- device_dict: dict
- device data dictionary in the format of self._device_attributes or self._device_commands
-
get_device_properties_metadata
(property_group)[source]¶ Returns a more formatted device prop data structure in a format of dict.
- e.g.
- {
- ‘<property-name>’: {
- ‘DefaultPropValue’: ‘’, # The key was changed from ‘default_value’
- # so as to have the same data structures # across all the three parsers.
‘name’: ‘<property-name>’, ‘type’: ‘<data-type’},
}
-
parse
(simdd_json_file)[source]¶ Read simulator description data from json file.
Stores all the simulator description data from the json file into appropriate attribute, command and device property data structures.
- simdd_json_file: str
- Name of simulator descrition data file
- Data structures, are type dict with dictionary elements keyed with element name
and values must be the corresponding data value.
-
tango_simlib.utilities.tango_device_parser module¶
This module performs the parsing of a running Tango device.
-
class
tango_simlib.utilities.tango_device_parser.
TangoDeviceParser
[source]¶ Bases:
tango_simlib.utilities.base_parser.Parser
Parses a running TANGO device to YAML.
-
get_device_attribute_metadata
()[source]¶ Returns the attributes.
- dict
- E.g.
- {
- ‘<attribute-name>’: {
- “data_format”: “SPECTRUM”, “data_type”: “DevString”, “description”: “”, “display_unit”: “No display unit”, “enum_labels”: [] “format”: “%s”, “label”: “Timing_info”, “max_alarm”: “Not specified”, “max_dim_x”: 64, “max_dim_y”: 0, “max_value”: “Not specified”, “min_alarm”: “Not specified”, “min_value”: “Not specified”, “name”: “<attribute-name>”, “standard_unit”: “No standard unit”, “unit”: “”, “writable”: “READ”,
}
… }
-
get_device_command_metadata
()[source]¶ Returns the commands.
- dict
- E.g.
- {
- ‘<command-name>’: {
- “doc_out”: “out_type_desc”, “disp_level”: “OPERATOR”, “name”: “<command-name>”, “doc_in”: “in_type_desc”, “dtype_out”: “DevVoid”, “dtype_in”: “DevVoid”,
}
… }
-
tango_simlib.utilities.testutils module¶
-
class
tango_simlib.utilities.testutils.
ClassCleanupUnittestMixin
[source]¶ Bases:
future.types.newobject.newobject
Implement class-level setup/deardown semantics that emulate addCleanup()
Subclasses can define a setUpClassWithCleanup() method that wraps addCleanup such that cls.addCleanup() can be used to add cleanup methods that will be called at class tear-down time.
-
classmethod
addCleanupClass
(function, *args, **kwargs)[source]¶ Add a cleanup that will be called at class tear-down time
-
classmethod
doCleanupsClass
()[source]¶ Run class-level cleanups registered with cls.addCleanupClass()
-
classmethod
setUpClass
()[source]¶ Call setUpClassWithCleanup with cls.addCleanup for class-level cleanup
Any exceptions raised during cls.setUpClassWithCleanup will result in the cleanups registered up to that point being called before logging the exception with traceback.
-
classmethod
setUpClassWithCleanup
()[source]¶ Do class-level setup and ensure that cleanup functions are called
It is inteded that subclasses override this class method
In this method calls to cls.addCleanup is forwarded to cls.addCleanupClass, which means callables registered with cls.addCleanup() is added to the class-level cleanup function stack.
-
classmethod
-
tango_simlib.utilities.testutils.
cleanup_tempdir
(test_instance, *mkdtemp_args, **mkdtemp_kwargs)[source]¶ Return filname of a new tempfile and add cleanup callback to test_instance.
Will not raise an error if the directory is not present when trying to delete.
Extra args and kwargs are passed on to the tempfile.mkdtemp call
-
tango_simlib.utilities.testutils.
cleanup_tempfile
(test_instance, unlink=False, *mkstemp_args, **mkstemp_kwargs)[source]¶ Return filename of a new tempfile and add cleanup callback to test_instance.
Will not raise an error if the file is not present when trying to delete.
If unlink=True the actual temp file will be deleted immediately. This is useful if you want to check behaviour in absence of a named file.
Extra args and kwargs are passed on to the tempfile.mkstemp call.
-
tango_simlib.utilities.testutils.
disable_attributes_polling
(test_case, device_proxy, device_server, attributes)[source]¶ Disable polling for a tango device server, en re-eable at end of test
-
tango_simlib.utilities.testutils.
set_attributes_polling
(test_case, device_proxy, device_server, poll_periods)[source]¶ Set attribute polling and restore after test
- test_case : unittest.TestCase instance
- Unit test case class instance
- device_proxy : PyTango.DeviceProxy instance
- The Tango device proxy instance
- device_server : PyTango.Device instance
- The instance of the device class device_proxy is talking to
- poll_periods : dict {“attribute_name” : poll_period}
- poll_poriod in milliseconds as per Tango APIs, 0 or falsy to disable polling.
- restore_polling : function
- This function can be used to restore polling if it is to happen before the end of the test. Should be idempotent if only one set_attributes_polling() is called per test.
tango_simlib.utilities.validate_device module¶
This module validates the conformance of a Tango device against a specification
-
tango_simlib.utilities.validate_device.
check_list_dict_differences
(spec_data, dev_data, type_str, bidirectional)[source]¶ Compare Commands and Attributes in the parsed YAML
- spec_data : list
List of dictionaries with specification data E.g [
- {‘disp_level’: ‘OPERATOR’,
- ‘doc_in’: ‘ON/OFF’, ‘doc_out’: ‘Uninitialised’, ‘dtype_in’: ‘DevBoolean’, ‘dtype_out’: ‘DevVoid’, ‘name’: ‘Capture’}, …
]
- dev_data : list
List of dictionaries with device data E.g [
- {‘disp_level’: ‘OPERATOR’,
- ‘doc_in’: ‘ON/OFF’, ‘doc_out’: ‘Uninitialised’, ‘dtype_in’: ‘DevBoolean’, ‘dtype_out’: ‘DevVoid’, ‘name’: ‘Capture’}, …
]
- type_str : str
- Either “Command” or “Attribute”
- bidirectional: bool
- Whether to include details on the device that is not in the specification
- issues : list
- A list of strings describing the issues, empty list for no issues
-
tango_simlib.utilities.validate_device.
check_property_differences
(spec_properties, dev_properties, bidirectional)[source]¶ Compare properties in the parsed YAML
- spec_data : list
List of dictionaries with specification data properties E.g [{‘name’: ‘AdminModeDefault’},
{‘name’: ‘AsynchCmdReplyNRetries’}, {‘name’: ‘AsynchCmdReplyTimeout’}, {‘name’: ‘CentralLoggerEnabledDefault’}, {‘name’: ‘ConfigureTaskTimeout’}, {‘name’: ‘ControlModeDefault_B’}]- dev_data : list
List of dictionaries with device data properties E.g [{‘name’: ‘AdminModeDefault’},
{‘name’: ‘AsynchCmdReplyNRetries’}, {‘name’: ‘AsynchCmdReplyTimeout’}, {‘name’: ‘CentralLoggerEnabledDefault’}, {‘name’: ‘ConfigureTaskTimeout’}, {‘name’: ‘ControlModeDefault_B’}]- bidirectional: bool
- Whether to include details on the device that is not in the specification
- issues : list
- A list of strings describing the issues, empty list for no issues
-
tango_simlib.utilities.validate_device.
check_single_dict_differences
(spec, dev, type_str, bidirectional)[source]¶ Compare a single attribute/command
- spec : dict
A single Attribute/Command dictionary form the specficication E.g {‘disp_level’: ‘OPERATOR’,
‘doc_in’: ‘ON/OFF’, ‘doc_out’: ‘Uninitialised’, ‘dtype_in’: ‘DevBoolean’, ‘dtype_out’: ‘DevVoid’, ‘name’: ‘Capture’}- dev : dict
A single Attribute/Command dictionary form the device E.g {‘disp_level’: ‘OPERATOR’,
‘doc_in’: ‘ON/OFF’, ‘doc_out’: ‘Uninitialised’, ‘dtype_in’: ‘DevBoolean’, ‘dtype_out’: ‘DevVoid’, ‘name’: ‘Capture’}- type_str : str
- Either “Command” or “Attribute”
- bidirectional: bool
- Whether to include details on the device that is not in the specification
- issues : list
- A list of strings describing the issues, empty list for no issues
-
tango_simlib.utilities.validate_device.
compare_data
(specification_yaml, tango_device_yaml, bidirectional)[source]¶ Compare 2 sets of YAML built from the specification and from the device
- specification_yaml : str
- The specification in YAML format
- tango_device_yaml : str
- The Tango device in YAML format
- bidirectional: bool
- Whether to include details on the device that is not in the specification
- str
- The validation result
-
tango_simlib.utilities.validate_device.
get_device_specification
(tango_device_name)[source]¶ Translate a device to YAML specification
- tango_device_name : str
- Tango device name in the domain/family/member format or the FQDN tango://<TANGO_HOST>:<TANGO_PORT>/domain/family/member
- str
- The device specification in YAML format
-
tango_simlib.utilities.validate_device.
validate_device_from_path
(tango_device_name, path_to_yaml_file, bidirectional)[source]¶ Retrieves the YAML from the file and checks conformance against the Tango device.
- path_to_yaml_file : str
- The path to the specification file
- tango_device_name : str
- Tango device name in the domain/family/member format or the FQDN tango://<TANGO_HOST>:<TANGO_PORT>/domain/family/member
- bidirectional: bool
- Whether to include details on the device that is not in the specification
- str
- The validation result
-
tango_simlib.utilities.validate_device.
validate_device_from_url
(tango_device_name, url_to_yaml_file, bidirectional)[source]¶ Retrieves the YAML from the URL and checks conformance against the Tango device.
- url_to_yaml_file : str
- The URL to the specification file
- tango_device_name : str
- Tango device name in the domain/family/member format or the FQDN tango://<TANGO_HOST>:<TANGO_PORT>/domain/family/member
- bidirectional: bool
- Whether to include details on the device that is not in the specification
- str
- The validation result