pytams.xmlutils¶
A set of utility for XML serializing.
Attributes¶
Exceptions¶
Exception class for the xmlutils. |
Functions¶
|
Force ndarray print on a single line temporarily. |
|
Manually cast XML snapshot state. |
|
Manually cast XML snapshot noise. |
|
Manually cast XML elements reads. |
|
Manually cast from strings. |
|
Return an Element from a dictionnary. |
|
Return an dictionnary an Element. |
|
Return the type of val. |
|
Return an Element from two args. |
|
Return a snapshot in XML elemt format. |
|
Return snapshot data from an XML snapshot elemt. |
Module Contents¶
- oneliner_ndarray() collections.abc.Generator[Any, None, None] [source]¶
Force ndarray print on a single line temporarily.
- manual_cast_snapshot(elem: xml.etree.ElementTree.Element) Any [source]¶
Manually cast XML snapshot state.
- manual_cast_snapshot_noise(elem: xml.etree.ElementTree.Element) Any [source]¶
Manually cast XML snapshot noise.
- manual_cast(elem: xml.etree.ElementTree.Element) Any [source]¶
Manually cast XML elements reads.
- POD_cast_dict: dict[str, collections.abc.Callable[Ellipsis, Any]][source]¶
- dict_to_xml(tag: str, d: dict[Any, Any]) xml.etree.ElementTree.Element [source]¶
Return an Element from a dictionnary.
- Parameters:
tag – a root tag
d – a dictionary
- xml_to_dict(elem: xml.etree.ElementTree.Element | None) dict[Any, Any] [source]¶
Return an dictionnary an Element.
- Parameters:
elem – an etree element
- Returns:
a dictionary containing the element entries
- get_val_type(val: Any) str [source]¶
Return the type of val.
- Parameters:
val – a value
- Returns:
val type
- new_element(key: str, val: Any) xml.etree.ElementTree.Element [source]¶
Return an Element from two args.
- Parameters:
key – the element key
val – the element value
- Returns:
an ElementTree element
- make_xml_snapshot(idx: int, time: float, score: float, noise: Any, state: Any) xml.etree.ElementTree.Element [source]¶
Return a snapshot in XML elemt format.
- Parameters:
idx – snapshot index
time – the time stamp
score – the snapshot score function
noise – the stochastic noise
state – the associated state