Skip to content

Commit

Permalink
Update assertion accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
WeilerP committed Apr 12, 2024
1 parent d384414 commit 3070592
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/preprocessing/test_moments.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_first_moments(
f"-layer={layer}-mode={mode}_first_moment.npy"
)
)
np.testing.assert_almost_equal(first_order_moment, ground_truth)
np.testing.assert_almost_equal(first_order_moment, ground_truth, decimal=4)

@pytest.mark.parametrize("dataset", ["pancreas", "dentategyrus"])
@pytest.mark.parametrize("n_obs", [50, 100])
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_second_moments(
f"-layer={layer}-mode={mode}_second_moment.npy"
)
)
np.testing.assert_almost_equal(second_order_moment, ground_truth)
np.testing.assert_almost_equal(second_order_moment, ground_truth, decimal=4)

@pytest.mark.parametrize("dataset", ["pancreas", "dentategyrus"])
@pytest.mark.parametrize("n_obs", [50, 100])
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_passing_array_for_layer(
f"-layer={layer}-mode={mode}_first_moment.npy"
)
)
np.testing.assert_almost_equal(first_order_moment, ground_truth)
np.testing.assert_almost_equal(first_order_moment, ground_truth, decimal=4)

@pytest.mark.parametrize("sparse", [True, False])
def test_analytic_example(self, sparse: bool):
Expand Down Expand Up @@ -377,7 +377,9 @@ def test_raw_input(self, adata, dataset: str, n_obs: int):
f"first_moment_spliced.npy"
)
)
np.testing.assert_almost_equal(adata.layers["Ms"], ground_truth_spliced)
np.testing.assert_almost_equal(
adata.layers["Ms"], ground_truth_spliced, decimal=4
)


class TestSecondOrderMoments:
Expand Down Expand Up @@ -497,4 +499,4 @@ def test_output(self, adata, dataset: str, n_obs: int):
f"-layer=unspliced-mode=connectivities_second_moment.npy"
)
)
np.testing.assert_almost_equal(second_order_moment, ground_truth)
np.testing.assert_almost_equal(second_order_moment, ground_truth, decimal=4)

0 comments on commit 3070592

Please sign in to comment.