Commit 0c4b1414 authored by Pierre Paleo's avatar Pierre Paleo
Browse files

[hdf5tomoscan] fix: dont use "is" when comparing Enum and property

parent 558c9869
Pipeline #22401 failed with stages
in 1 minute and 4 seconds
......@@ -304,7 +304,7 @@ class HDF5TomoScan(TomoScanBase):
"""projections / radio, does not include the return projections"""
if self._projections is None:
if self.frames:
proj_frames = tuple(filter(lambda x: x.image_key is ImageKey.PROJECTION and x.is_control is False, self.frames))
proj_frames = tuple(filter(lambda x: x.image_key == ImageKey.PROJECTION and x.is_control == False, self.frames))
self._projections = {}
for proj_frame in proj_frames:
self._projections[proj_frame.index] = proj_frame.url
......@@ -319,7 +319,7 @@ class HDF5TomoScan(TomoScanBase):
def darks(self) -> typing.Union[dict, None]:
if self._darks is None:
if self.frames:
dark_frames = tuple(filter(lambda x: x.image_key is ImageKey.DARK_FIELD, self.frames))
dark_frames = tuple(filter(lambda x: x.image_key == ImageKey.DARK_FIELD, self.frames))
self._darks = {}
for dark_frame in dark_frames:
self._darks[dark_frame.index] = dark_frame.url
......@@ -330,7 +330,7 @@ class HDF5TomoScan(TomoScanBase):
def flats(self) -> typing.Union[dict, None]:
if self._flats is None:
if self.frames:
flat_frames = tuple(filter(lambda x: x.image_key is ImageKey.FLAT_FIELD, self.frames))
flat_frames = tuple(filter(lambda x: x.image_key == ImageKey.FLAT_FIELD, self.frames))
self._flats = {}
for flat_frame in flat_frames:
self._flats[flat_frame.index] = flat_frame.url
......@@ -380,7 +380,7 @@ class HDF5TomoScan(TomoScanBase):
""""""
frames = self.frames
if frames:
return_frames = list(filter(lambda x: x.is_control is True, frames))
return_frames = list(filter(lambda x: x.is_control == True, frames))
return return_frames
else:
return None
......
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