Commit f692d7d0 authored by payno's avatar payno
Browse files

[hdf5tomoscan] fix: path is the master file and not the folder path

parent e70955e3
Pipeline #30753 passed with stages
in 3 minutes and 21 seconds
......@@ -122,16 +122,6 @@ class HDF5TomoScan(TomoScanBase):
scan = os.path.dirname(scan)
else:
self.master_file = self.get_master_file(scan)
self.master_file = os.path.join(scan, os.path.basename(scan))
if os.path.exists(self.master_file + '.nx'):
self.master_file = self.master_file + '.nx'
elif os.path.exists(self.master_file + '.hdf5'):
self.master_file = self.master_file + '.hdf5'
elif os.path.exists(self.master_file + '.h5'):
self.master_file = self.master_file + '.h5'
else:
self.master_file = self.master_file + '.nx'
else:
self.master_file = None
......@@ -284,6 +274,7 @@ class HDF5TomoScan(TomoScanBase):
@docstring(TomoScanBase.to_dict)
def to_dict(self) -> dict:
res = super().to_dict()
res[self.DICT_PATH_KEY] = self.master_file
res[self._DICT_ENTRY_KEY] = self.entry
return res
......@@ -312,6 +303,7 @@ class HDF5TomoScan(TomoScanBase):
assert self.DICT_PATH_KEY in data
self.path = data[self.DICT_PATH_KEY]
self._entry = data[self._DICT_ENTRY_KEY]
self.master_file = self.get_master_file(self.path)
return self
@property
......
......@@ -85,7 +85,7 @@ class TestHDF5Scan(HDF5TestBaseClass):
# check conversion to dict
_dict = self.scan.to_dict()
scan2 = HDF5TomoScan.from_dict(_dict)
self.assertEqual(scan2.path, self.scan.path)
self.assertEqual(scan2.master_file, self.scan.master_file)
self.assertEqual(scan2.entry, self.scan.entry)
def testFrames(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment