Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation error in xarray 2024.10 #395

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/cancel-workflow-action@0.12.1
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
Loading