def get_all_hdf_dataset(hdf, fileter_func=None, path='/'):
res = []
# init queue
q = queue()
for i in hdf[path].keys():
q.put(i)
# get list of all file
while not q.empty():
p = q.pop()
if 'Dataset' in str(type(hdf[p])):
if fileter_func is not None and not fileter_func(p):
continue
res.append(p)
elif 'Group' in str(type(hdf[p])):
for i in hdf[p].keys():
q.put(p + '/' + i)
return res
评论列表
文章目录