Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for almost equal like equality #988

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: unit test for #982, verify nan equality support
  • Loading branch information
wasade committed Dec 3, 2024
commit 1f884a1e3cfc334064b92960a18087f9dde1e076
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