Skip to content

Commit

Permalink
Add assertions to check on weights
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Feb 5, 2024
1 parent 984b840 commit 8930b1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/tests/beagle_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,11 @@ def interpolate_allele_probs(sm, ref_h, typed_pos, untyped_pos, typed_cm, untype
for a in alleles:
if ref_h[i, j] == a:
if k == 0:
assert w == 1.0, "Weight should be 1.0."
probs[i, a] += sm[k, j]
if k == m:
# FIXME: It's unclear how BEAGLE handles this case.
assert w == 0.0, "Weight should be 0.0."
probs[i, a] += sm[k - 1, j]
else:
probs[i, a] += w * sm[k - 1, j]
Expand Down

0 comments on commit 8930b1e

Please sign in to comment.