From b1643e99fd13ce2b5a50f1e1902216ed93b76db9 Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Mon, 5 Feb 2024 12:19:41 -0800 Subject: [PATCH] Minor variable renaming --- python/tests/beagle_numba.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/tests/beagle_numba.py b/python/tests/beagle_numba.py index 4f113e8550..2f9c7d3b52 100644 --- a/python/tests/beagle_numba.py +++ b/python/tests/beagle_numba.py @@ -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)