Skip to content

Commit

Permalink
Update ci.yaml (#391)
Browse files Browse the repository at this point in the history
* Update ci.yaml

* update ci dev

* fix chunk problem

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
raphaeldussin and pre-commit-ci[bot] authored Oct 11, 2024
1 parent 69cd028 commit bd207f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
micromamba-version: "latest"
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Create conda environment
uses: mamba-org/provision-with-micromamba@v16
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
micromamba-version: "latest"
Expand Down
8 changes: 5 additions & 3 deletions xesmf/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,12 +1044,14 @@ def _init_para_regrid(self, ds_in, ds_out, kwargs):

if self.sequence_out:
ds_out = ds_out.rename({self.out_horiz_dims[1]: 'x_out'})
out_chunks = ds_out.chunks.get('x_out')
else:
ds_out = ds_out.rename(
{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']]

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

# Rename coords to avoid issues in xr.map_blocks
for coord in list(self.out_coords.keys()):
Expand All @@ -1060,7 +1062,7 @@ def _init_para_regrid(self, ds_in, ds_out, kwargs):
weights_dims = ('y_out', 'x_out', 'y_in', 'x_in')
templ = sps.zeros((self.shape_out + self.shape_in))
w_templ = xr.DataArray(templ, dims=weights_dims).chunk(
out_chunks
chunks
) # template has same chunks as ds_out

w = xr.map_blocks(
Expand Down

0 comments on commit bd207f0

Please sign in to comment.