Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
tomoscan
Commits
0c4b1414
Commit
0c4b1414
authored
Mar 03, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/esrf/hdf5scan.py
View file @
0c4b1414
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment