Skip to content

Commit 4809b5a

Browse files
aulemahalhuard
andauthored
Another numpy 2 fix (#377)
Co-authored-by: David Huard <[email protected]>
1 parent f09987f commit 4809b5a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
What's new
22
==========
33

4+
0.8.7 (unreleased)
5+
------------------
6+
* Cast grid sizes to python's int (another Numpy 2.0 fix). (:pull:`377`) By `Pascal Bourgault <https://github.com/aulemahal>`_.
7+
48
0.8.6 (2024-06-26)
59
------------------
610
* New ``xe.util.cell_area`` utility to compute the cell area using ESMF's internal mechanism. (:pull:`372`, :issue:`369`) By `Jiawei Zhuang <https://github.com/JiaweiZhuang>`_ and `Pascal Bourgault <https://github.com/aulemahal>`_.

xesmf/backend.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def from_xarray(cls, lon, lat, periodic=False, mask=None):
146146

147147
def get_shape(self, loc=ESMF.StaggerLoc.CENTER):
148148
"""Return shape of grid for specified StaggerLoc"""
149-
return tuple(self.size[loc])
149+
# We cast explicitly to python's int (numpy >=2)
150+
return tuple(map(int, self.size[loc]))
150151

151152

152153
class LocStream(ESMF.LocStream):

0 commit comments

Comments
 (0)