Skip to content

Commit 155a0f2

Browse files
committed
3rd attempt to fix failing windows tests
1 parent 23874cd commit 155a0f2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/pygrib/_pygrib.pyx

+5-3
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ cdef class gribmessage(object):
13211321
else:
13221322
missval = 1.e30
13231323
if self.expand_reduced:
1324-
lonsperlat = self['pl']
1324+
lonsperlat = self['pl'].astype(np.int64)
13251325
nx = lonsperlat.max()
13261326
datarr = redtoreg(datarr, lonsperlat, missval=missval)
13271327
else:
@@ -1559,7 +1559,8 @@ cdef class gribmessage(object):
15591559
lats = self['distinctLatitudes']
15601560
if lat2 < lat1 and lats[-1] > lats[0]: lats = lats[::-1]
15611561
ny = self['Nj']
1562-
nx = self['pl'].max()
1562+
lonsperlat = self['pl'].astype(np.int64)
1563+
nx = lonsperlat.max()
15631564
lon1 = self['longitudeOfFirstGridPointInDegrees']
15641565
lon2 = self['longitudeOfLastGridPointInDegrees']
15651566
lons = np.linspace(lon1,lon2,nx)
@@ -1570,7 +1571,8 @@ cdef class gribmessage(object):
15701571
elif self['gridType'] == 'reduced_ll': # reduced lat/lon grid
15711572
if self.expand_reduced:
15721573
ny = self['Nj']
1573-
nx = self['pl'].max()
1574+
lonsperlat = self['pl'].astype(np.int64)
1575+
nx = lonsperlat.max()
15741576
lat1 = self['latitudeOfFirstGridPointInDegrees']
15751577
lat2 = self['latitudeOfLastGridPointInDegrees']
15761578
lon1 = self['longitudeOfFirstGridPointInDegrees']

0 commit comments

Comments
 (0)