HDF5Tomoscan: simplify code
There is redundancy of code like:
def start_time(self):
if self._start_time is None and self.master_file and os.path.exists:
self._check_hdf5scan_validity()
with HDF5File(self.master_file, "r", swmr=True) as h5_file:
if self._START_TIME_PATH in h5_file[self._entry]:
self._start_time = h5py_read_dataset(
h5_file[self._entry][self._START_TIME_PATH]
)
return self._start_time
It would be wise to create an helper function or a context manager to handle this repeated usage