Skip to content

Commit

Permalink
Add a test for #147
Browse files Browse the repository at this point in the history
  • Loading branch information
gtca committed Oct 17, 2024
1 parent d52b60d commit 174812b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_atac_preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def test_tfidf_to_layer(self):
self.assertEqual(adata.X[0, 0], orig_value)
self.assertEqual(str("%.3f" % adata.layers["new"][0, 0]), "4.659")

def test_tfidf_from_layer(self):
adata = self.adata.copy()
adata.layers["counts"] = adata.X.copy() + 1
adata.X = None
ac.pp.tfidf(adata, from_layer="counts")
self.assertEqual(str("%.3f" % adata.X[0, 0]), "2.856")


class TestTFIDFSparse(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 174812b

Please sign in to comment.