From 36bbdcc23d7d2a61decc810e755f4b1715d273b0 Mon Sep 17 00:00:00 2001 From: leo-desbureaux-tellae Date: Mon, 18 Sep 2023 16:15:19 +0200 Subject: [PATCH] test on seed --- bhepop2/bhepop2_enrichment.py | 2 ++ tests/test_bhepop2_enrich.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bhepop2/bhepop2_enrichment.py b/bhepop2/bhepop2_enrichment.py index 8714af6..53a39e3 100644 --- a/bhepop2/bhepop2_enrichment.py +++ b/bhepop2/bhepop2_enrichment.py @@ -71,7 +71,9 @@ def __init__( # random seed (maybe use a random generator instead) self.seed = seed + print("seed", seed) if seed is not None: + print("seed", seed) random.seed(seed) # original population to be enriched diff --git a/tests/test_bhepop2_enrich.py b/tests/test_bhepop2_enrich.py index 90feeb2..836d656 100644 --- a/tests/test_bhepop2_enrich.py +++ b/tests/test_bhepop2_enrich.py @@ -25,14 +25,14 @@ def test_bhepop2_enrich( # pop.to_csv("tests/data/nantes_enriched.csv", index=False) - pop = pop.to_numpy() - expected_enriched_population_nantes = expected_enriched_population_nantes.to_numpy() - shape = np.shape(pop) - assert np.shape(expected_enriched_population_nantes) == shape - for i in range(shape[0]): - for j in range(shape[1]): - if pop[i, j] != expected_enriched_population_nantes[i, j]: - print(i, j) - print(pop[i, j], expected_enriched_population_nantes[i, j]) + # pop = pop.to_numpy() + # expected_enriched_population_nantes = expected_enriched_population_nantes.to_numpy() + # shape = np.shape(pop) + # assert np.shape(expected_enriched_population_nantes) == shape + # for i in range(shape[0]): + # for j in range(shape[1]): + # if pop[i, j] != expected_enriched_population_nantes[i, j]: + # print(i, j) + # print(pop[i, j], expected_enriched_population_nantes[i, j]) assert np.all((pop == expected_enriched_population_nantes).to_numpy())