forked from M-Labs/artiq
browser: support datasets that use h5 group notation
Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
This commit is contained in:
parent
acfac324ee
commit
dfc6ecbf3d
|
@ -188,16 +188,25 @@ class FilesDock(QtWidgets.QDockWidget):
|
||||||
except:
|
except:
|
||||||
logger.warning("unable to read metadata from %s",
|
logger.warning("unable to read metadata from %s",
|
||||||
info.filePath(), exc_info=True)
|
info.filePath(), exc_info=True)
|
||||||
rd = dict()
|
|
||||||
|
rd = {}
|
||||||
if "archive" in f:
|
if "archive" in f:
|
||||||
rd = {k: (True, v[()]) for k, v in f["archive"].items()}
|
def visitor(k, v):
|
||||||
if "datasets" in f:
|
if isinstance(v, h5py.Dataset):
|
||||||
for k, v in f["datasets"].items():
|
|
||||||
if k in rd:
|
|
||||||
logger.warning("dataset '%s' is both in archive and "
|
|
||||||
"outputs", k)
|
|
||||||
rd[k] = (True, v[()])
|
rd[k] = (True, v[()])
|
||||||
|
|
||||||
|
f["archive"].visititems(visitor)
|
||||||
|
|
||||||
|
if "datasets" in f:
|
||||||
|
def visitor(k, v):
|
||||||
|
if isinstance(v, h5py.Dataset):
|
||||||
|
if k in rd:
|
||||||
|
logger.warning("dataset '%s' is both in archive "
|
||||||
|
"and outputs", k)
|
||||||
|
rd[k] = (True, v[()])
|
||||||
|
|
||||||
|
f["datasets"].visititems(visitor)
|
||||||
|
|
||||||
self.datasets.init(rd)
|
self.datasets.init(rd)
|
||||||
|
|
||||||
self.dataset_changed.emit(info.filePath())
|
self.dataset_changed.emit(info.filePath())
|
||||||
|
|
Loading…
Reference in New Issue