Skip to content

Commit

Permalink
MAINT: fix minor failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adler-j committed Apr 26, 2016
1 parent 111391d commit 18553ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions odl/space/fspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,15 @@ def __call__(self, x, out=None, **kwargs):
raise TypeError
out = np.atleast_1d(np.squeeze(out))
except (TypeError, IndexError):
# TypeError is raised if a meshgrid was used but the function
# expected an array (1d only). In this case we try again with
# the first meshgrid vector.
# TypeError is raised if a meshgrid was used but the
# function expected an array (1d only). In this case we try
# again with the first meshgrid vector.
# IndexError is raised in expressions like x[x > 0] since
# "x > 0" evaluates to 'True', i.e. 1, and that index is
# out of range for a meshgrid tuple of length 1 :-). To get
# the real errors with indexing, we check again for the same
# scenario (scalar output when not valid) as in the first case.
# the real errors with indexing, we check again for the
# same scenario (scalar output when not valid) as in the
# first case.
out = self._call(x[0], **kwargs)
if np.ndim(out) == 0 and not scalar_out:
raise ValueError('invalid scalar output.')
Expand Down
4 changes: 2 additions & 2 deletions odl/tomo/backends/scikit_radon.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def scikit_sinogram_space(geometry, volume_space, sinogram_space):

padded_size = int(np.ceil(volume_space.shape[0] * np.sqrt(2)))
det_width = volume_space.domain.extent()[0] * np.sqrt(2)
scikit_detector_part = uniform_partition(-det_width/2.0 - 0.142,
det_width/2.0,
scikit_detector_part = uniform_partition(-det_width / 2.0,
det_width / 2.0,
padded_size)

scikit_range_part = geometry.motion_partition.insert(1,
Expand Down
2 changes: 1 addition & 1 deletion test/discr/lp_discr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_init(exponent):
@skip_if_no_cuda
def test_init_cuda(exponent):
# Normal discretization of unit interval
space = odl.FunctionSpace(odl.Interval(0, 1))
space = odl.FunctionSpace(odl.Interval(0, 1), out_dtype='float32')
part = odl.uniform_partition_fromintv(space.domain, 10)
rn = odl.CudaRn(10, exponent=exponent)
odl.DiscreteLp(space, part, rn, exponent=exponent)
Expand Down

0 comments on commit 18553ea

Please sign in to comment.