Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from scverse/ig/fix_tests
Browse files Browse the repository at this point in the history
(fix): fix tests really
  • Loading branch information
Zethson authored Jan 3, 2024
2 parents 8cc646d + a32b652 commit 6907fb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/multi_condition_comparisions/tl/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def _check_count_matrix(self, array: np.ndarray | spmatrix, tolerance: float = 1
else:
if not array.dtype.kind == "i" or not np.all(np.abs(array - np.round(array)) < tolerance):
raise ValueError("Matrix must be a count matrix.")
if (array < 0).sum() > 0:
raise ValueError("Non.zero elements of the matrix must be postiive.")

return True

Expand Down
2 changes: 1 addition & 1 deletion tests/test_edge_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_valid_count_matrix(statsmodels_stub):

def test_valid_sparse_count_matrix(statsmodels_stub):
"""Test with a valid sparse count matrix."""
matrix = sp.csr_matrix([[1, 0], [0, 2]])
matrix = sp.sparse.csr_matrix([[1, 0], [0, 2]])
assert statsmodels_stub._check_count_matrix(matrix)


Expand Down

0 comments on commit 6907fb6

Please sign in to comment.