def _get_ds_descriptions_unsorted(
cls, data, ignore_keys=['attrs', 'plotter'], nums=None):
"""Recursive method to get all the file names or datasets out of a
dictionary `data` created with the :meth`array_info` method"""
ds_description = {'ds', 'fname', 'num', 'arr', 'store'}
if 'ds' in data:
# make sure that the data set has a number assigned to it
data['ds'].psy.num
keys_in_data = ds_description.intersection(data)
if keys_in_data:
return {key: data[key] for key in keys_in_data}
for key in ignore_keys:
data.pop(key, None)
func = partial(cls._get_ds_descriptions_unsorted,
ignore_keys=ignore_keys, nums=nums)
return chain(*map(lambda d: [d] if isinstance(d, dict) else d,
map(func, six.itervalues(data))))
评论列表
文章目录