From 5054308251cc72d55d51bcb95c9fc1354bf06453 Mon Sep 17 00:00:00 2001 From: payno <henri.payno@gmail.com> Date: Wed, 10 Feb 2021 08:14:17 +0100 Subject: [PATCH] [io] replace get_data and HDF5File from thirdparty to the one from silx --- est/io/io.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/est/io/io.py b/est/io/io.py index 74a2e251..9198a14b 100644 --- a/est/io/io.py +++ b/est/io/io.py @@ -38,7 +38,20 @@ from est.units import ur from est.core.types.dim import Dim from est.core.types import Spectra from est.io.utils.spec import read_spectrum as read_spec_spectrum -from est.thirdparty.silx.hdf5file import get_data, HDF5File + +try: + from silx.io.h5py_utils import File as HDF5File +except: + from est.thirdparty.silx.hdf5file import get_data, HDF5File +else: + from silx.io.utils import get_data as silx_get_data + from silx.io.h5py_utils import retry, retry_contextmanager + from silx.utils.retry import retry_contextmanager + + @retry(retry_timeout=0.5) + def get_data(url): + return silx_get_data(url) + try: from est.io.utils.larch import read_ascii as larch_read_ascii -- GitLab