Skip to content

Commit

Permalink
STY: fix pep8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kohr-h committed Mar 13, 2019
1 parent 33f7a60 commit 4d7e59d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
15 changes: 8 additions & 7 deletions odl/discr/lp_discr.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@ def __str__(self):
return repr(self)



class DiscreteLpElement(Tensor):

"""Representation of a `DiscreteLp` element."""
Expand Down Expand Up @@ -1231,12 +1230,14 @@ def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
# axes are being completely collapsed or don't change size.
raise ValueError('`reduceat` not supported')

elif (method == 'outer' and
not all(isinstance(inp, type(self)) for inp in inputs)):
raise TypeError(
"inputs must be of type {} for `method='outer'`, "
'got types {}'
''.format(type(self), tuple(type(inp) for inp in inputs)))
elif (
method == 'outer'
and not all(isinstance(inp, type(self)) for inp in inputs)
):
raise TypeError(
"inputs must be of type {} for `method='outer'`, got types "
'{}'.format(type(self), tuple(type(inp) for inp in inputs))
)

else: # method != '__call__', and otherwise valid

Expand Down
4 changes: 3 additions & 1 deletion odl/test/discr/discr_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,9 @@ def test_collocation_interpolation_identity():
part = odl.uniform_partition([0, 0], [1, 1], (4, 2))
fvals = np.arange(1, 9, dtype='float64').reshape(part.shape)

collocator = lambda f: point_collocation(f, part.meshgrid)
def collocator(f):
return point_collocation(f, part.meshgrid)

interpolators = [
nearest_interpolator(fvals, part.coord_vectors, variant='left'),
nearest_interpolator(fvals, part.coord_vectors, variant='right'),
Expand Down
1 change: 0 additions & 1 deletion odl/test/trafos/fourier_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
# --- Helper functions --- #



def _params_from_dtype(dtype):
if is_real_dtype(dtype):
halfcomplex = True
Expand Down
4 changes: 3 additions & 1 deletion odl/tomo/backends/astra_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
__all__ = ('astra_cpu_forward_projector', 'astra_cpu_back_projector')


# TODO: is magnification scaling at the right place?


def _default_proj_type(geom):
"""Return the default projector type for a given geometry."""
if isinstance(geom, ParallelBeamGeometry):
Expand All @@ -41,7 +44,6 @@ def _default_proj_type(geom):
''.format(type(geom))
)

# TODO: is magnification scaling at the right place?

def astra_cpu_forward_projector(vol_data, geometry, proj_space, out=None,
proj_type=None):
Expand Down
4 changes: 3 additions & 1 deletion odl/tomo/backends/skimage_radon.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def skimage_radon_back_projector(sinogram, geometry, volume_space, out=None):
from skimage.transform import iradon

theta = skimage_theta(geometry)
skimage_range = skimage_sinogram_space(geometry, volume_space, sinogram.space)
skimage_range = skimage_sinogram_space(
geometry, volume_space, sinogram.space
)

skimage_sinogram = skimage_range.element()
with writable_array(skimage_sinogram) as sino_arr:
Expand Down

0 comments on commit 4d7e59d

Please sign in to comment.