pytams.xmlutils =============== .. py:module:: pytams.xmlutils .. autoapi-nested-parse:: A set of utility for XML serializing. Attributes ---------- .. autoapisummary:: pytams.xmlutils.POD_cast_dict Exceptions ---------- .. autoapisummary:: pytams.xmlutils.XMLUtilsError Functions --------- .. autoapisummary:: pytams.xmlutils.oneliner_ndarray pytams.xmlutils.manual_cast_snapshot pytams.xmlutils.manual_cast_snapshot_noise pytams.xmlutils.manual_cast pytams.xmlutils.manual_cast_str pytams.xmlutils.dict_to_xml pytams.xmlutils.xml_to_dict pytams.xmlutils.get_val_type pytams.xmlutils.new_element pytams.xmlutils.make_xml_snapshot pytams.xmlutils.read_xml_snapshot Module Contents --------------- .. py:function:: oneliner_ndarray() -> collections.abc.Generator[Any, None, None] Force ndarray print on a single line temporarily. .. py:exception:: XMLUtilsError Bases: :py:obj:`Exception` Exception class for the xmlutils. .. py:function:: manual_cast_snapshot(elem: xml.etree.ElementTree.Element) -> Any Manually cast XML snapshot state. .. py:function:: manual_cast_snapshot_noise(elem: xml.etree.ElementTree.Element) -> Any Manually cast XML snapshot noise. .. py:function:: manual_cast(elem: xml.etree.ElementTree.Element) -> Any Manually cast XML elements reads. .. py:data:: POD_cast_dict :type: dict[str, collections.abc.Callable[Ellipsis, Any]] .. py:function:: manual_cast_str(type_str: str, elem_text: str) -> Any Manually cast from strings. .. py:function:: dict_to_xml(tag: str, d: dict[Any, Any]) -> xml.etree.ElementTree.Element Return an Element from a dictionnary. :param tag: a root tag :param d: a dictionary .. py:function:: xml_to_dict(elem: xml.etree.ElementTree.Element | None) -> dict[Any, Any] Return an dictionnary an Element. :param elem: an etree element :returns: a dictionary containing the element entries .. py:function:: get_val_type(val: Any) -> str Return the type of val. :param val: a value :returns: val type .. py:function:: new_element(key: str, val: Any) -> xml.etree.ElementTree.Element Return an Element from two args. :param key: the element key :param val: the element value :returns: an ElementTree element .. py:function:: make_xml_snapshot(idx: int, time: float, score: float, noise: Any, state: Any) -> xml.etree.ElementTree.Element Return a snapshot in XML elemt format. :param idx: snapshot index :param time: the time stamp :param score: the snapshot score function :param noise: the stochastic noise :param state: the associated state .. py:function:: read_xml_snapshot(snap: xml.etree.ElementTree.Element) -> tuple[float, float, Any, Any] Return snapshot data from an XML snapshot elemt. :param snap: an XML snapshot elemt