LABSN/expyfun — pull request #212 by Eric89GXL (2014-10-20 20:18:02+00:00)
Title: ENH: Much faster HDF5 IO

Ready for review/merge @rkmaddox. Switches us to `h5py` from `pytables` for our HDF5 IO. The `h5py` interface is not only nicer, but the speedup is impressive. On my system, it took ~20 seconds to read the file using the old `pytables` routines. Now reading that file with `h5py` it takes 2 seconds, with compression on. With compression off, it takes 0.5 seconds:
```
print('read original')
t0 = time()
x = read_hdf5('stim_1v2a.hdf5')
print(round(time() - t0))

print('write w/comp')
t0 = time()
write_hdf5('test.hdf5', x, overwrite=True)
print(round(time() - t0))

print('read w/comp')
t0 = time()
y = read_hdf5('test.hdf5')
print(round(time() - t0, 1))
for key, val in x.items():
np.testing.assert_array_equal(val, y[key])

print('write w/o comp')
t0 = time()
write_hdf5('test.hdf5', x, overwrite=True, compression=0)
print(round(time() - t0))

print('read w/o comp')
t0 = time()
y = read_hdf5('test.hdf5')
print(round(time() - t0, 1))
for key, val in x.items():
np.testing.assert_array_equal(val, y[key])
```
Output:
```
read original
2.0
write w/comp
1.0
read w/comp
0.4
write w/o comp
1.0
read w/o comp
0.5
```
And thanks to the fact that we're using standard HDF5 storage mechanisms, these should be backward-compatible changes. Hooray!