Skip to content

Commit 420aeca

Browse files
authored
Merge pull request #634 from malariagen/618-bad-random-value
Random error when performing tests
2 parents 69d0576 + dddad32 commit 420aeca

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/anoph/test_pca.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_pca_plotting(fixture, api: AnophelesPca):
9696
n_snps = random.randint(4, n_snps_available)
9797
# PC3 required for plot_pca_coords_3d()
9898
assert min(n_samples, n_snps) > 3
99-
n_components = random.randint(3, min(n_samples, n_snps))
99+
n_components = random.randint(3, min(n_samples, n_snps, 10))
100100

101101
# Run the PCA.
102102
pca_df, pca_evr = api.pca(
@@ -184,7 +184,7 @@ def test_pca_exclude_samples(fixture, api: AnophelesPca):
184184
# PCA parameters.
185185
n_samples = ds.sizes["samples"] - n_samples_excluded
186186
n_snps_available = ds.sizes["variants"]
187-
n_snps = random.randint(1, n_snps_available)
187+
n_snps = random.randint(4, n_snps_available)
188188
n_components = random.randint(2, min(n_samples, n_snps, 10))
189189

190190
# Run the PCA.
@@ -245,7 +245,7 @@ def test_pca_fit_exclude_samples(fixture, api: AnophelesPca):
245245
# PCA parameters.
246246
n_samples = ds.sizes["samples"]
247247
n_snps_available = ds.sizes["variants"]
248-
n_snps = random.randint(1, n_snps_available)
248+
n_snps = random.randint(4, n_snps_available)
249249
n_components = random.randint(2, min(n_samples, n_snps, 10))
250250

251251
# Run the PCA.

0 commit comments

Comments
 (0)