optimizing h5py calling