Skip to content

Commit fa7739b

Browse files
committed
test new APRSlicer methods
1 parent 6d8abc9 commit fa7739b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pyapr/tests/test_reconstruction.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,14 @@ def test_reconstruction(mode, ndim):
4141

4242
assert np.allclose(slicer[0], lazy_slicer[0])
4343
assert np.allclose(slicer[0, float(0), :], lazy_slicer[0, float(0), :])
44+
45+
assert np.max(slicer) == parts.max() == np.max(np.array(parts))
46+
47+
slicer = slicer.astype(np.float32)
48+
assert isinstance(slicer.parts, pyapr.FloatParticles)
49+
50+
slicer = slicer.astype(int)
51+
assert isinstance(slicer.parts, pyapr.IntParticles)
52+
53+
with pytest.raises(ValueError):
54+
slicer = slicer.astype(np.int8)

0 commit comments

Comments
 (0)