Skip to content

Commit

Permalink
Supress subnormal warning
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery committed Jan 8, 2025
1 parent 1c7928b commit 61619b1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tsinfer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@
#
"""
Tree sequence inference.
Python 3 only.
"""
import sys
import warnings

# tsinfer #957. This warning pops up as a result of using fast-math. It bascially means
# that tiny tiny values are being rounded to zero, which should be fine for our purposes.
warnings.filterwarnings(
"ignore",
message="The value of the smallest subnormal for <class 'numpy.float64'> "
"type is zero",
)


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

0 comments on commit 61619b1

Please sign in to comment.