train: loop variable typing (mypy)
ci / test (3.12) (push) Failing after 8s
ci / test (3.13) (push) Failing after 10s

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01814GKVzZVL3FuF3DeiZXhv
This commit is contained in:
kemalandClaude Opus 5.5 committed 2026-09-29 19:54:24 +01:00
1 parent f347090a2f
commit de677d3456
1 file changed
+4 -4
+4 -4
View File
@@ -106,10 +106,10 @@ def fit_block(theta: F32, r: F32, use: npt.NDArray[np.bool_], haploid: npt.NDArr
# a locus with a single cluster is homozygous: an AB-labelled lone cluster moves to AA or BB by position # a locus with a single cluster is homozygous: an AB-labelled lone cluster moves to AA or BB by position
lone_ab = keep[:, 1] & ~keep[:, 0] & ~keep[:, 2] lone_ab = keep[:, 1] & ~keep[:, 0] & ~keep[:, 2]
if lone_ab.any(): if lone_ab.any():
for i in np.flatnonzero(lone_ab).tolist(): for j in np.flatnonzero(lone_ab).tolist():
hom = 0 if m[i, 1] < 0.5 else 2 hom = 0 if m[j, 1] < 0.5 else 2
assign[i, assign[i] == 1] = hom assign[j, assign[j] == 1] = hom
keep[i, 1], keep[i, hom] = False, True keep[j, 1], keep[j, hom] = False, True
counts = np.stack([(assign == k).sum(axis=1) for k in range(3)], axis=1) counts = np.stack([(assign == k).sum(axis=1) for k in range(3)], axis=1)
tm = np.full((L, 3), np.nan) tm = np.full((L, 3), np.nan)
td = np.full((L, 3), np.nan) td = np.full((L, 3), np.nan)