MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / open_dataset

Method open_dataset

dedalus/tools/post.py:384–391  ·  view source on GitHub ↗
(self, filename_or_obj, *, drop_variables=None)

Source from the content-addressed store, hash-verified

382 """Xarray backend targeting Dedalus HDF5 outputs."""
383
384 def open_dataset(self, filename_or_obj, *, drop_variables=None):
385 with h5py.File(filename_or_obj, 'r') as file:
386 data_arrays = {}
387 for dset in file['tasks'].values():
388 name = dset.name.split('/')[-1]
389 if drop_variables is None or name not in drop_variables:
390 data_arrays[name] = dedalus_h5_to_xarray(dset)
391 return xarray.Dataset(data_arrays)
392

Callers

nothing calls this directly

Calls 2

dedalus_h5_to_xarrayFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected