I\'m trying to increase cache size for my HDF5 files, but it doesn\'t seem to be working. This is what I have:
import h5py
with h5py.File(\"test.h5\", \'w\'
As of h5py version 2.9.0, this behavior is now available directly through the main h5py.File interface. There are three parameters that control the "raw data chunk cache" — rdcc_nbytes, rdcc_w0, and rdcc_nslots — which are documented here. The OP was trying to adjust the rdcc_nbytes setting, which can now simply be done as
import h5py
with h5py.File("test.h5", "w", rdcc_nbytes=5242880) as fid:
# Use fid for something here
The only difference is that you have to know how much space you actually need, rather than just multiplying by 5 as the OP wanted. The current default values are the same as the OP found. Of course, if you really wanted to do this programatically, you could just open it once, get the cache, close it, and then reopen with the desired parameters.