Skip to content

Commit 0dac590

Browse files
committed
Added the error catching line. No warnings in my last 3 attempts at tests.
1 parent e3166e8 commit 0dac590

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

malariagen_data/anoph/fst.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ def _fst_gwss(
8282
).compute()
8383

8484
with self._spinner(desc="Compute Fst"):
85-
fst = allel.moving_hudson_fst(ac1, ac2, size=window_size)
86-
# Sometimes Fst can be very slightly below zero, clip for simplicity.
87-
fst = np.clip(fst, a_min=clip_min, a_max=1)
88-
x = allel.moving_statistic(pos, statistic=np.mean, size=window_size)
85+
with np.errstate(divide="ignore", invalid="ignore"):
86+
fst = allel.moving_hudson_fst(ac1, ac2, size=window_size)
87+
# Sometimes Fst can be very slightly below zero, clip for simplicity.
88+
fst = np.clip(fst, a_min=clip_min, a_max=1)
89+
x = allel.moving_statistic(pos, statistic=np.mean, size=window_size)
8990

9091
results = dict(x=x, fst=fst)
9192

0 commit comments

Comments
 (0)