H5Parser method to close files
From Sebastian Thomas:
I have a question concerning the H5Parser https://gitlab.psi.ch/OPAL/pyOPALTools/blob/master/opal/parser/H5Parser.py
I'm not an extremely experienced coder, but shouldn't the file opened in H5Parser.parse("file") via
self.__h5f = h5py.File(fname, 'r')
be closed again? Wenn I use the parser on an H5 file in a juyter notebook, I run into some problems because for example OPAL tries to delete the monitor output, but is not allowed to, due to the file "beeing in use". I ask mainly out of curiosity.
Since h5py 2.4 opened file will automatically close: http://docs.h5py.org/en/stable/whatsnew/2.4.html#files-will-now-auto-close
However, if the H5Parser still exists, this will not work, and it would be nice to have a manual option to close the file.
Proposal is to add a specific close method to H5Parser, as discussed with @frey_m.