Solved by BSODjunkie in post #3 
              
              
                I found that the issue was opening the HDF5 file within __init__ rather than only in __getitem__ and __len__ which works. I removed the first call and added a second in __len__. It seems to work now.