Crashes with silx.io.get_data(), again
There still seems to be problems when using get_data
from silx.
- Apparently the SWMR mode was set to False by default when using
get_data()
- On the other hand, nabu keeps open HDF5 file descriptors in
H5Reader
(for performance - might be questionable), which is then used byChunkReader
, and incidentallyFlatFieldDataUrls
and so on
A workaround is to set the environment variable HDF5_USE_FILE_LOCKING=1
if lock issues occur.
Consider the following code:
radio_cor_finder = CORFinder("centered", dataset_info, do_flatfield=True, cor_options=cor_options)
sino_cor_finder = SinoCORFinder("sino-sliding-window", dataset_info, slice_idx="middle", do_flatfield=True, cor_options=cor_options)
composite_cor_finder = CompositeCORFinder(dataset_info, cor_options=cor_options)
From silx 2.0, these three estimators cannot be used simultaneously:
-
radio_cor_finder
has aself.flatfield
which is aFlatFieldDataUrls
instance, which keeps open HDF5 files descriptors -
sino_cor_finder
has adata_reader
which is aH5Reader
, having the same issue -
composite_cor_finder
has aget_data()
which now usesswmr=None
(wasTrue
insilx < 2.0
)
An immediate but very brittle solution is do to
del radio_cor_finder.flatfield
del sino_cor_finder.data_reader
once the data and flats are loaded by these instances.