@@ -864,19 +864,19 @@ def root(self) -> Element:
864864 return xmlET .parse (str (self .path )).getroot ()
865865
866866
867- def read_geom_h5 (xdmf : FieldXmf , snapshot : int ) -> Tuple [ Dict [ str , Any ], Element ]:
867+ def read_geom_h5 (xdmf : FieldXmf , snapshot : int ) -> dict [ str , Any ]:
868868 """Extract geometry information from hdf5 files.
869869
870870 Args:
871871 xdmf_file: path of the xdmf file.
872872 snapshot: snapshot number.
873873 Returns:
874- geometry information and root of xdmf document .
874+ geometry information.
875875 """
876876 header : Dict [str , Any ] = {}
877877 xdmf_root = xdmf .root
878878 if snapshot is None :
879- return {}, xdmf_root
879+ return {}
880880
881881 # Domain, Temporal Collection, Snapshot
882882 # should check that this is indeed the required snapshot
@@ -907,7 +907,7 @@ def read_geom_h5(xdmf: FieldXmf, snapshot: int) -> Tuple[Dict[str, Any], Element
907907 coord_shape .append (_get_dim (xdmf .path , data_item ))
908908 coord_h5 .append (xdmf .path .parent / data_text .strip ().split (":/" , 1 )[0 ])
909909 _read_coord_h5 (coord_h5 , coord_shape , header , twod )
910- return header , xdmf_root
910+ return header
911911
912912
913913def _to_spherical (flds : ndarray , header : Dict [str , Any ]) -> ndarray :
@@ -978,9 +978,8 @@ def read_field_h5(
978978 unavailable.
979979 """
980980 if header is None :
981- header , xdmf_root = read_geom_h5 (xdmf , snapshot )
982- else :
983- xdmf_root = xdmf .root
981+ header = read_geom_h5 (xdmf , snapshot )
982+ xdmf_root = xdmf .root
984983
985984 npc = header ["nts" ] // header ["ncs" ] # number of grid point per node
986985 flds = np .zeros (_flds_shape (fieldname , header ))
0 commit comments