I see you're taking a break from kenken.
There are two great packages for saving Numpy arrays to HDF5: h5py and
pytables. I used h5py in the la package.
So if you have your own data object then you can use either h5py or
pytables to store it in HDF5. If you want to use larry as your data
object, it will be store in HDF5 using h5py.
Yeah, I haven't used pytables so I'm not much help. Here's an example
of how to save a structed array using h5py:
Make a structured array:
>> x = np.zeros((2,),dtype=('i4,f4,a10'))
>> x[:] = [(1,2.,'Hello'),(2,3.,"World")]
>> x
array([(1, 2.0, 'Hello'), (2, 3.0, 'World')],
dtype=[('f0', '<i4'), ('f1', '<f4'), ('f2', '|S10')])
Save it to HDF5:
>> import h5py
>> f = h5py.File('/tmp/example.hdf5')
>> f['x'] = x
Load the structured array later:
$ ipython
>> import h5py
>> f = h5py.File('/tmp/example.hdf5')
>> f['x'][:]
array([(1, 2.0, 'Hello'), (2, 3.0, 'World')],
dtype=[('f0', '<i4'), ('f1', '<f4'), ('f2', '|S10')])
larry can merge quickly but it does it outside of the archive. And
larry does not use structured arrays, it uses plain old numpy arrays.
> And I have to limit myself to just the 2 KenKens above the daily
> crossword in the NYT, otherwise I'd never get any work done :)
I'll have to start playing again---soon as I can find a 2x2 kenken.