Skip to content

Commit 662e47c

Browse files
authored
Merge pull request #187 from akrherz/gh186_numpy_deprecations
address numpy 1.20 builtin deprecations
2 parents 1a49d47 + 0c3ac54 commit 662e47c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pygrib/_pygrib.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ cdef class gribmessage(object):
10511051
raise RuntimeError(grib_get_error_message(err))
10521052
elif typ == GRIB_TYPE_LONG:
10531053
# is value an array or a scalar?
1054-
datarr = np.asarray(value, np.int)
1054+
datarr = np.asarray(value, int)
10551055
is_array = False
10561056
if datarr.shape:
10571057
is_array = True
@@ -1071,7 +1071,7 @@ cdef class gribmessage(object):
10711071
raise RuntimeError(grib_get_error_message(err))
10721072
elif typ == GRIB_TYPE_DOUBLE:
10731073
# is value an array or a scalar?
1074-
datarr = np.asarray(value, np.float)
1074+
datarr = np.asarray(value, float)
10751075
is_array = False
10761076
if datarr.shape:
10771077
is_array = True
@@ -1142,7 +1142,7 @@ cdef class gribmessage(object):
11421142
storageorder='F'
11431143
else:
11441144
storageorder='C'
1145-
datarr = np.zeros(size, np.int, order=storageorder)
1145+
datarr = np.zeros(size, int, order=storageorder)
11461146
err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
11471147
if err:
11481148
raise RuntimeError(grib_get_error_message(err))

0 commit comments

Comments
 (0)