about summary refs log tree commit diff
path: root/tests/helpers
diff options
context:
space:
mode:
authorArun Isaac2026-01-14 20:29:33 +0000
committerArun Isaac2026-01-16 23:06:32 +0000
commita76dedb432aa99f53681144c488ac19b9c23e660 (patch)
tree17ba9a6502c0f71a4355f0b8210666b65749ea15 /tests/helpers
parent1e6efe6ef73cbb65839a95883899442f5dc4afe1 (diff)
downloadpyhegp-a76dedb432aa99f53681144c488ac19b9c23e660.tar.gz
pyhegp-a76dedb432aa99f53681144c488ac19b9c23e660.tar.lz
pyhegp-a76dedb432aa99f53681144c488ac19b9c23e660.zip
Add intercept column in phenotypes file.
Diffstat (limited to 'tests/helpers')
-rw-r--r--tests/helpers/strategies.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/helpers/strategies.py b/tests/helpers/strategies.py
index 3771ed0..171c721 100644
--- a/tests/helpers/strategies.py
+++ b/tests/helpers/strategies.py
@@ -1,5 +1,5 @@
 ### pyhegp --- Homomorphic encryption of genotypes and phenotypes
-### Copyright © 2025 Arun Isaac <arunisaac@systemreboot.net>
+### Copyright © 2025–2026 Arun Isaac <arunisaac@systemreboot.net>
 ###
 ### This file is part of pyhegp.
 ###
@@ -104,13 +104,21 @@ phenotype_names = st.lists(tabless_printable_ascii_text
 @st.composite
 def phenotype_frames(draw,
                      number_of_samples=st.integers(min_value=0,
-                                                   max_value=10)):
+                                                   max_value=10),
+                     intercept_present=st.booleans()):
     _number_of_samples = draw(number_of_samples)
     return draw(data_frames(
         columns=([column(name="sample-id",
                          dtype="str",
                          elements=tabless_printable_ascii_text,
                          unique=True)]
+                 + ([column(name="intercept",
+                            dtype="float64",
+                            elements=st.floats(min_value=-1,
+                                               max_value=1,
+                                               allow_nan=False))]
+                    if draw(intercept_present)
+                    else [])
                  + columns(draw(phenotype_names),
                            dtype="float64",
                            elements=st.floats(min_value=-1000,