Skip to content

Commit 0a83c7b

Browse files
benjefferymergify[bot]
authored andcommitted
Supress subnormal warning
1 parent 1c7928b commit 0a83c7b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tsinfer/__init__.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@
1818
#
1919
"""
2020
Tree sequence inference.
21-
22-
Python 3 only.
2321
"""
2422
import sys
23+
import warnings
24+
25+
# tsinfer #957. This warning pops up as a result of using fast-math. It bascially means
26+
# that tiny tiny values are being rounded to zero, which should be fine for our purposes.
27+
warnings.filterwarnings(
28+
"ignore",
29+
message="The value of the smallest subnormal for <class 'numpy.float64'> "
30+
"type is zero",
31+
)
32+
2533

2634
if sys.version_info[0] < 3:
2735
raise Exception("Python 3 only")

0 commit comments

Comments
 (0)