Skip to content

Commit

Permalink
Minor variable renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Feb 5, 2024
1 parent 10ad737 commit b1643e9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,18 +330,18 @@ def get_weights(typed_pos, untyped_pos, typed_cm, untyped_cm):
# Calculate weights for ungenotyped positions.
weights = np.zeros(x, dtype=np.float64)
for i in range(len(right_idx)):
r = right_idx[i]
if r == 0:
k = right_idx[i]
if k == 0:
# Left of the first genotyped position.
weights[i] = 1.0
elif r == m:
elif k == m:
# Right of the last genotyped position.
weights[i] = 0.0
else:
# Between two genotyped positions.
cm_m2x = typed_cm[r] - untyped_cm[i]
cm_m2x = typed_cm[k] - untyped_cm[i]
# TODO: Check if this a subtle source of error.
cm_m2mM1 = max(typed_cm[r] - typed_cm[r - 1], _MIN_CM_DIST)
cm_m2mM1 = max(typed_cm[k] - typed_cm[k - 1], _MIN_CM_DIST)
weights[i] = cm_m2x / cm_m2mM1
return (weights, right_idx)

Expand Down

0 comments on commit b1643e9

Please sign in to comment.