Skip to content

Commit

Permalink
argmax/argmin need to return ints [some test code was removed]
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Oct 18, 2024
1 parent 0a3cffc commit c636655
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spectral_cube/tests/test_spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,14 @@ def test_argmax(self):
self._check_numpy(self.c.argmax, d, np.nanargmax)
self.c = self.d = None

def test_argmax_rays(self):
"""
regression test: argmax must have integer dtype
"""
d = np.where(self.d > 0.5, self.d, -10)
result = self.c.argmax(how='ray')
assert 'int' in str(result.dtype)

def test_argmin(self):
d = np.where(self.d > 0.5, self.d, 10)
self._check_numpy(self.c.argmin, d, np.nanargmin)
Expand Down

0 comments on commit c636655

Please sign in to comment.