Skip to content

Commit

Permalink
TST: unit test for biocore#982, verify nan equality support
Browse files Browse the repository at this point in the history
  • Loading branch information
wasade committed Dec 3, 2024
1 parent 7a0b196 commit 1f884a1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions biom/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2571,6 +2571,16 @@ def test_allclose(self):
self.assertFalse(self.st1.allclose(st4))
self.assertTrue(self.st1.allclose(st4, atol=1e-1))

st5 = self.st1.copy()
st6 = self.st1.copy()

st5._data.data[0] = np.nan
st6._data.data[0] = np.nan

self.assertFalse(st5.allclose(st6))
self.assertFalse(st5.allclose(st6, atol=1e-1))
self.assertTrue(st5.allclose(st6, equal_nan=True))

def test_eq(self):
"""sparse equality"""
self.assertTrue(self.st1 == self.st2)
Expand Down

0 comments on commit 1f884a1

Please sign in to comment.