Skip to content

Commit

Permalink
Fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jan 24, 2024
1 parent 9e6ec9b commit eb399dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit eb399dd

Please sign in to comment.