Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 5c41b3b

Browse files
committed
Use good rand parameters for nb model in wald test_vsrest.py
1 parent a775b72 commit 5c41b3b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

diffxpy/unit_test/test_vsrest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77

88
import diffxpy.api as de
99

10-
# NOTE: This test fails sometimes, and passes other times.
1110
class TestVsRest(unittest.TestCase):
12-
13-
def test_null_distribution_wald(self, n_cells: int = 2000, n_genes: int = 100, n_groups: int = 2):
11+
# NOTE: This test fails sometimes, and passes other times when the groups or loc are less extreme.
12+
def test_null_distribution_wald(self, n_cells: int = 2000, n_genes: int = 100, n_groups: int = 4):
1413
"""
1514
Test if de.test_wald_loc() generates a uniform p-value distribution
1615
if it is given data simulated based on the null model. Returns the p-value
@@ -24,7 +23,7 @@ def test_null_distribution_wald(self, n_cells: int = 2000, n_genes: int = 100, n
2423
logging.getLogger("batchglm").setLevel(logging.WARNING)
2524
logging.getLogger("diffxpy").setLevel(logging.WARNING)
2625
model = NBModel()
27-
rand_fn_loc = lambda shape: np.random.uniform(2, 5, shape)
26+
rand_fn_loc = lambda shape: np.random.uniform(9, 10, shape)
2827
rand_fn_scale = lambda shape: np.random.uniform(1, 2, shape)
2928
model.generate_artificial_data(
3029
n_obs=n_cells,

0 commit comments

Comments
 (0)