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

Commit 68bc5e7

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

diffxpy/unit_test/test_vsrest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ def test_null_distribution_rank(self, n_cells: int = 2000, n_genes: int = 100, n
148148

149149
return True
150150

151-
def test_null_distribution_ttest(self, n_cells: int = 2000, n_genes: int = 100, n_groups: int = 2):
151+
# NOTE: This test fails sometimes, and passes other times when the groups or loc are less extreme.
152+
def test_null_distribution_ttest(self, n_cells: int = 2000, n_genes: int = 100, n_groups: int = 4):
152153
"""
153154
Test if de.test_wald_loc() generates a uniform p-value distribution
154155
if it is given data simulated based on the null model. Returns the p-value
@@ -161,6 +162,8 @@ def test_null_distribution_ttest(self, n_cells: int = 2000, n_genes: int = 100,
161162
logging.getLogger("tensorflow").setLevel(logging.ERROR)
162163
logging.getLogger("batchglm").setLevel(logging.WARNING)
163164
logging.getLogger("diffxpy").setLevel(logging.WARNING)
165+
rand_fn_loc = lambda shape: np.random.uniform(9, 10, shape)
166+
rand_fn_scale = lambda shape: np.random.uniform(1, 2, shape)
164167
model = NBModel()
165168
model.generate_artificial_data(
166169
n_obs=n_cells,

0 commit comments

Comments
 (0)