@data_factory(label="Numpy save file", identifier=is_npy, priority=100)
def npy_reader(filename, format='auto', auto_merge=False, **kwargs):

    import numpy as np
    npy_data = np.load(filename)

    if not hasattr(npy_data.dtype, 'names'):
        raise ValueError("Numpy save file loading currently only supports structured"
                         " arrays, e.g., with specified names.")

    d = Data()
    for name in npy_data.dtype.names:
        comp = Component.autotyped(npy_data[name])
        d.add_component(comp, label=name)

    return d
Read in a Numpy structured array saved to a .npy or .npz file.
dataset/ETHPy150Open glue-viz/glue/glue/core/data_factories/npy.py/npy_reader