From b6028a7fa7c1c8dce450e0cec8f2b61e524a56a0 Mon Sep 17 00:00:00 2001 From: zethson Date: Wed, 11 Dec 2024 13:12:49 +0100 Subject: [PATCH] Fix choice Signed-off-by: zethson --- tests/tools/_distances/test_distances.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tools/_distances/test_distances.py b/tests/tools/_distances/test_distances.py index b7154bd8..7b92817b 100644 --- a/tests/tools/_distances/test_distances.py +++ b/tests/tools/_distances/test_distances.py @@ -55,7 +55,8 @@ def adata(request): else: adata = sc.pp.subsample(adata, 0.001, copy=True) - adata = adata[:, np.random.Generator.choice(adata.n_vars, 100, replace=False)].copy() + rng = np.random.default_rng() + adata = adata[:, rng.choice(adata.n_vars, 100, replace=False)].copy() adata.layers["lognorm"] = adata.X.copy() adata.layers["counts"] = np.round(adata.X.toarray()).astype(int)