Skip to content

Commit

Permalink
TST: add inplace test for tomo projectors, closes #266
Browse files Browse the repository at this point in the history
  • Loading branch information
adler-j committed Aug 10, 2016
1 parent f89eca6 commit 96f305b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/tomo/operators/ray_trafo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,14 @@ def projector(request):
raise ValueError('geom not valid')


def test_projector(projector):
@pytest.fixture(scope="module",
params=[True, False],
ids=[' inplace ', ' out of place '])
def inplace(request):
return request.param


def test_projector(projector, inplace):
"""Test discrete Ray transform forward projection."""

# TODO: this needs to be improved
Expand All @@ -166,7 +173,11 @@ def test_projector(projector):
vol = projector.domain.one()

# Calculate projection
proj = projector(vol)
if inplace:
proj = projector.range.zero()
projector(vol, out=proj)
else:
proj = projector(vol)

# We expect maximum value to be along diagonal
expected_max = projector.domain.partition.extent()[0] * np.sqrt(2)
Expand Down

0 comments on commit 96f305b

Please sign in to comment.