Skip to content

Commit 118fa28

Browse files
committed
BUG: fix impl check in RayTransform
1 parent fc13b6e commit 118fa28

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

odl/tomo/operators/ray_trafo.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ def __init__(self, reco_space, geometry, variant, **kwargs):
144144
RuntimeWarning)
145145
else:
146146
raise RuntimeError('bad impl')
147+
148+
impl_in = None
149+
147150
else:
148151
impl, impl_in = str(impl).lower(), impl
149152
if impl not in _SUPPORTED_IMPL:
@@ -157,8 +160,15 @@ def __init__(self, reco_space, geometry, variant, **kwargs):
157160
# Sanity checks
158161
if impl.startswith('astra'):
159162
if geometry.ndim > 2 and impl.endswith('cpu'):
160-
raise ValueError('`impl` {!r} only works for 2d'
161-
''.format(impl_in))
163+
if impl_in is None:
164+
raise ValueError(
165+
'fastest available `impl` {!r} only supports 2D'
166+
''.format(impl)
167+
)
168+
else:
169+
raise ValueError(
170+
'`impl` {!r} only supports 2D'.format(impl_in)
171+
)
162172

163173
# Print a warning if the detector midpoint normal vector at any
164174
# angle is perpendicular to the geometry axis in parallel 3d

0 commit comments

Comments
 (0)