about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2025-09-02 21:27:30 +0100
committerArun Isaac2025-09-02 22:32:03 +0100
commit7fd6a0ac1eccff5d772942b5de453309a967ca0b (patch)
tree1cebdc595adee34a9488dbd38a3b0a90cbf91295
parent2ab1e670b21b01dfd4f3e5997ce4290dd73268c6 (diff)
downloadpyhegp-7fd6a0ac1eccff5d772942b5de453309a967ca0b.tar.gz
pyhegp-7fd6a0ac1eccff5d772942b5de453309a967ca0b.tar.lz
pyhegp-7fd6a0ac1eccff5d772942b5de453309a967ca0b.zip
Drop duplicates in generated test phenotype frames.
-rw-r--r--tests/helpers/strategies.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/helpers/strategies.py b/tests/helpers/strategies.py
index 00c4c11..416a914 100644
--- a/tests/helpers/strategies.py
+++ b/tests/helpers/strategies.py
@@ -80,10 +80,14 @@ phenotype_names = st.lists(tabless_printable_ascii_text
 
 @st.composite
 def phenotype_frames(draw):
-    return draw(data_frames(
+    phenotype = draw(data_frames(
         columns=([column(name="sample-id",
                          dtype="str",
                          elements=tabless_printable_ascii_text)]
                  + columns(draw(phenotype_names),
                            dtype="float64",
                            elements=st.floats(allow_nan=False)))))
+    return phenotype.drop_duplicates(subset=list(
+        filter(is_phenotype_metadata_column,
+               phenotype.columns)),
+                                     ignore_index=True)