Skip to content

Commit

Permalink
test new APRSlicer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljonsson committed Nov 6, 2023
1 parent 6d8abc9 commit fa7739b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pyapr/tests/test_reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ def test_reconstruction(mode, ndim):

assert np.allclose(slicer[0], lazy_slicer[0])
assert np.allclose(slicer[0, float(0), :], lazy_slicer[0, float(0), :])

assert np.max(slicer) == parts.max() == np.max(np.array(parts))

slicer = slicer.astype(np.float32)
assert isinstance(slicer.parts, pyapr.FloatParticles)

slicer = slicer.astype(int)
assert isinstance(slicer.parts, pyapr.IntParticles)

with pytest.raises(ValueError):
slicer = slicer.astype(np.int8)

0 comments on commit fa7739b

Please sign in to comment.