Skip to content

Commit 127a730

Browse files
Silence recent NumPy warning about np.bool
With a recent enough NumPy, tests now break with the warning: ``` /home/brandon/skyfield/skyfield/earthlib.py:3: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar. ```
1 parent f598772 commit 127a730

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

skyfield/earthlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Formulae for specific earth behaviors and effects."""
22

33
from numpy import (
4-
abs, arcsin, arccos, arctan2, array, bool, clip, cos, minimum,
4+
abs, arcsin, arccos, arctan2, array, bool_, clip, cos, minimum,
55
nan_to_num, ones_like, pi, sin, sqrt, tan, where, zeros_like,
66
)
77

@@ -150,7 +150,7 @@ def refraction(alt_degrees, temperature_C, pressure_mbar):
150150
def refract(alt_degrees, temperature_C, pressure_mbar):
151151
"""Given an unrefracted `alt` determine where it will appear in the sky."""
152152
alt = alt_degrees
153-
mask = ones_like(alt, dtype=bool)
153+
mask = ones_like(alt, dtype=bool_)
154154
while mask.sum():
155155
alt_previous = alt
156156
alt_new = alt_degrees + refraction(alt, temperature_C, pressure_mbar)

0 commit comments

Comments
 (0)