pymasep.common.characteristic ============================= .. py:module:: pymasep.common.characteristic Classes ------- .. autoapisummary:: pymasep.common.characteristic.Characteristic Module Contents --------------- .. py:class:: Characteristic(environment, name = None, parent = None, xml_node = None, template=None, src_copy = None) Bases: :py:obj:`pymasep.common.BaseObject` Object to handle characteristic of an Object :param environment: an Environment instance :param name: name of the BaseObject. :param xml_node: XML used to create the object. :param template: Template of the base object. Needed if no xml_node. If the template is present, must include a value_type (see :ref:`templates`) :param parent: parent object (see objects hierarchy) :param src_copy: Characteristic to copy. See copy_obs() :raise pymasep.common.exception.CreationException: If no XML or no template is present .. py:attribute:: _value :type: Any :value: None .. py:attribute:: value_type :type: type type of the characteristic value .. py:property:: value :type: Any Value of the characteristic. The type is defined in self.value_type :return: The value of the characteristic .. py:method:: id_str() Create a string unique ID of the Characteristic. Depends on the content of the BaseObject and the value of the Characteristic :return: The string unique ID .. py:method:: to_xml() Transform the Characteristic to XML. See :ref:`serialization` for more information. :return: XML version of the Characteristic .. py:method:: from_xml(environment, xml_node) Transform an XML to a Characteristic. The instance must be created before (with __init__(), passing the xml_node). See :ref:`serialization` for more information. :param environment: The environment where the BaseObject is created. :param xml_node: The XML node that contains Characteristic data. :raise pymasep.common.exception.CreationException: Initializer or SubElement must be present. If state is 'init', the initializer must be an Interface Initializer if state is 'init', SubElement value must be None. If state is 'run', no template or initializer is allowed. .. py:method:: copy_obs(params) Deep copy the Characteristic to a new instance. :param params: Not used for a Characteristic Note : this method copy the reference of the parent. The parent should do the parent copy and assignment