From 543c29ffb00ff2a35dd60f5c4a37118828bfbe4f Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Sun, 14 Jan 2024 12:16:16 +0000 Subject: [PATCH] Fix bug and add assertions --- python/tests/beagle_numba.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index 8a6cdcc5d2..8ab5a732f0 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -67,7 +67,10 @@ def convert_to_genetic_map_positions(pos, genetic_map=None): fb = genetic_map.gen_pos[ left_idx[i] ] # Genetic map position at right of marker i. - est_gen_pos[i] = fa + (pos[i] - a) / (b - a) * (fa - fb) + assert pos[i] > a, "Query position not greater than left-bound position." + assert b > a, "Physical positions not in ascending order." + assert fb > fa, "Genetic map positions not in ascending order." + est_gen_pos[i] = fa + (pos[i] - a) / (b - a) * (fb - fa) return est_gen_pos