From eb399dd7080e747334aa182de7e195cb15e5b3e2 Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Wed, 24 Jan 2024 09:17:30 +0000 Subject: [PATCH] Fix assertion --- python/tests/beagle_numba.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index d8bb3859b2..07e38b60ab 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -104,11 +104,11 @@ def convert_to_genetic_map_positions(pos, genetic_map=None): :return: Genetic map positions (cM). :rtype: numpy.ndarray """ + if genetic_map is None: + return pos / 1e6 assert np.all(pos >= genetic_map.base_pos[0]) and np.all( pos < genetic_map.base_pos[-1] ), "Physical positions outside of genetic map." - if genetic_map is None: - return pos / 1e6 # Approximate genetic map distances by linear interpolation. # Note np.searchsorted(a, v, side='right') returns i s.t. a[i-1] <= v < a[i]. right_idx = np.searchsorted(genetic_map.base_pos, pos, side="right")