Skip to content

Commit

Permalink
Fix deprecation error in xarray 2024.10 (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
aulemahal authored Oct 31, 2024
1 parent 7083733 commit 83ab848
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- python-version: "3.11"
esmf-version: 8.6
- python-version: "3.12"
esmf-version: 8.6
esmf-version: 8.7
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ What's new
0.8.8 (unreleased)
------------------
* Fix ESMpy memory issues by explictly freeing the Grid memory upon garbage collection of ``Regridder`` objects. By `Pascal Bourgault <https://github.com/aulemahal>`_.
* Address deprecation for xarray 2024.10 in the parallel weight generation. By `Pascal Bourgault <https://github.com/aulemahal>`_.

0.8.7 (2024-07-16)
------------------
Expand Down
6 changes: 3 additions & 3 deletions xesmf/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,9 +1049,9 @@ def _init_para_regrid(self, ds_in, ds_out, kwargs):
{self.out_horiz_dims[0]: 'y_out', self.out_horiz_dims[1]: 'x_out'}
)

out_chunks = [ds_out.chunks.get(k) for k in ['y_out', 'x_out']]
in_chunks = [ds_in.chunks.get(k) for k in ['y_in', 'x_in']]
chunks = out_chunks + in_chunks
out_chunks = {k: ds_out.chunks.get(k) for k in ['y_out', 'x_out']}
in_chunks = {k: ds_in.chunks.get(k) for k in ['y_in', 'x_in']}
chunks = out_chunks | in_chunks

# Rename coords to avoid issues in xr.map_blocks
for coord in list(self.out_coords.keys()):
Expand Down

0 comments on commit 83ab848

Please sign in to comment.