Skip to content

Commit

Permalink
Merge pull request #187 from akrherz/gh186_numpy_deprecations
Browse files Browse the repository at this point in the history
address numpy 1.20 builtin deprecations
  • Loading branch information
jswhit committed Sep 17, 2021
2 parents 1a49d47 + 0c3ac54 commit 662e47c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pygrib/_pygrib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ cdef class gribmessage(object):
raise RuntimeError(grib_get_error_message(err))
elif typ == GRIB_TYPE_LONG:
# is value an array or a scalar?
datarr = np.asarray(value, np.int)
datarr = np.asarray(value, int)
is_array = False
if datarr.shape:
is_array = True
Expand All @@ -1071,7 +1071,7 @@ cdef class gribmessage(object):
raise RuntimeError(grib_get_error_message(err))
elif typ == GRIB_TYPE_DOUBLE:
# is value an array or a scalar?
datarr = np.asarray(value, np.float)
datarr = np.asarray(value, float)
is_array = False
if datarr.shape:
is_array = True
Expand Down Expand Up @@ -1142,7 +1142,7 @@ cdef class gribmessage(object):
storageorder='F'
else:
storageorder='C'
datarr = np.zeros(size, np.int, order=storageorder)
datarr = np.zeros(size, int, order=storageorder)
err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
if err:
raise RuntimeError(grib_get_error_message(err))
Expand Down

0 comments on commit 662e47c

Please sign in to comment.