From bd207f017df613cb69a1b38f0894430767c02691 Mon Sep 17 00:00:00 2001 From: raphael dussin Date: Thu, 10 Oct 2024 20:26:05 -0400 Subject: [PATCH] Update ci.yaml (#391) * 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> --- .github/workflows/ci.yaml | 4 ++-- xesmf/frontend.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db376f2d..60e3cb28 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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" @@ -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" diff --git a/xesmf/frontend.py b/xesmf/frontend.py index a500112f..2fee239c 100644 --- a/xesmf/frontend.py +++ b/xesmf/frontend.py @@ -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()): @@ -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(