Skip to content

Commit a69fb89

Browse files
authored
Merge pull request #262 from penguinpee/numpy-2.x
Use legacy printing
2 parents f52c4cb + c3e9895 commit a69fb89

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/pygrib/_pygrib.pyx

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ from numpy import ma
1515
import pyproj
1616
npc.import_array()
1717

18+
# Print scalars legacy style (e.g. (15.0) not np.float64(15.0))
19+
# https://numpy.org/doc/2.2/release/2.0.0-notes.html#representation-of-numpy-scalars-changed
20+
if np.lib.NumpyVersion(np.__version__) >= '2.0.0':
21+
np.set_printoptions(legacy="1.25")
22+
1823
ctypedef fused float_type:
1924
float
2025
double

0 commit comments

Comments
 (0)