Skip to content

Commit abf8aa0

Browse files
committed
FieldXmf: no longer cache full xml tree
1 parent fd89898 commit abf8aa0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

stagpy/stagyyparsers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,6 @@ def field_subdomains(self, path_root: Path, name: str) -> Iterator[FieldSub]:
836836
class FieldXmf:
837837
path: Path
838838

839-
@cached_property
840-
def _root(self) -> Element:
841-
return xmlET.parse(str(self.path)).getroot()
842-
843839
def _maybe_get(
844840
self,
845841
elt: Element,
@@ -859,7 +855,8 @@ def _maybe_get(
859855
def _data(self) -> Mapping[int, XmfEntry]:
860856
# Geometry stuff from surface field is not useful
861857
data = {}
862-
for snap in self._root[0][0]:
858+
root = xmlET.parse(str(self.path)).getroot()
859+
for snap in root[0][0]:
863860
time = self._maybe_get(snap, "Time", "Value", float)
864861
mo_lambda = self._maybe_get(snap, "mo_lambda", "Value", float)
865862
mo_thick_sol = self._maybe_get(snap, "mo_thick_sol", "Value", float)

0 commit comments

Comments
 (0)