windkit.io.wasp.parse_wwh_element#
- windkit.io.wasp.parse_wwh_element(root, context='WWH element')[source]#
Parse the root element of a workspace inventory.
Only the
.tag/.attrib/.find/.findall/.itersubset of the ElementTree interface is used, so bothlxml.etreeandxml.etree.ElementTreeelements are accepted.- Parameters:
root (lxml.etree._Element or xml.etree.ElementTree.Element) – The
<WaspHierarchyFile>root element ofInventory.xml.context (str, optional) – Identifier used in error messages, typically the source file path.
- Returns:
Dictionary with keys:
"format_version": str"lowest_compatible_format_version": str or None"saving_component": str or None"saved_at": str or None"members": list of dict, one perWaspHierarchyMemberin document order, so a member comes before its children. Each is the dict ofparse_wwh_member_element()with two more keys:"parent"(index intomembersof the member whoseChildMembersholds it, or None) and"children"(list of indices).
- Return type:
- Raises:
WindkitFileFormatError – If the element is not a
WaspHierarchyFileor has noFormatVersion, or a member fails as described inparse_wwh_member_element().ValueError – If a generalised wind climate is malformed, as described in
parse_gwc_element().