forked from M-Labs/artiq
1
0
Fork 0

browser: support datasets that use h5 group notation

Signed-off-by: Leon Riesebos <leon.riesebos@duke.edu>
This commit is contained in:
Leon Riesebos 2022-04-05 23:47:49 -04:00 committed by Sebastien Bourdeauducq
parent b5dc9fd640
commit 386391e3f9
1 changed files with 16 additions and 7 deletions

View File

@ -188,15 +188,24 @@ 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 isinstance(v, h5py.Dataset):
rd[k] = (True, v[()])
f["archive"].visititems(visitor)
if "datasets" in f: if "datasets" in f:
for k, v in f["datasets"].items(): def visitor(k, v):
if k in rd: if isinstance(v, h5py.Dataset):
logger.warning("dataset '%s' is both in archive and " if k in rd:
"outputs", k) logger.warning("dataset '%s' is both in archive "
rd[k] = (True, v[()]) "and outputs", k)
rd[k] = (True, v[()])
f["datasets"].visititems(visitor)
self.datasets.init(rd) self.datasets.init(rd)