Skip to content

Commit 6440ab4

Browse files
committed
Merge branch 'main' into index-variables
2 parents e530907 + 52283c6 commit 6440ab4

29 files changed

+735
-273
lines changed

.github/workflows/benchmarks-last-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
# We need the full repo to avoid this issue
1919
# https://github.com/actions/checkout/issues/23
20-
- uses: actions/checkout@v5
20+
- uses: actions/checkout@v6
2121
with:
2222
fetch-depth: 0
2323

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
# We need the full repo to avoid this issue
2222
# https://github.com/actions/checkout/issues/23
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 0
2626

.github/workflows/ci-additional.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ jobs:
2222
if: |
2323
github.repository == 'pydata/xarray'
2424
&& (github.event_name == 'push' || github.event_name == 'pull_request')
25+
&& !contains(github.event.pull_request.labels.*.name, 'skip-ci')
2526
outputs:
2627
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2728
steps:
28-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@v6
2930
with:
3031
fetch-depth: 2
3132
- uses: xarray-contrib/ci-trigger@v1
@@ -46,7 +47,7 @@ jobs:
4647
CONDA_ENV_FILE: ci/requirements/environment.yml
4748
PYTHON_VERSION: "3.12"
4849
steps:
49-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5051
with:
5152
fetch-depth: 0 # Fetch all history for all branches and tags.
5253

@@ -92,7 +93,7 @@ jobs:
9293
PYTHON_VERSION: "3.12"
9394

9495
steps:
95-
- uses: actions/checkout@v5
96+
- uses: actions/checkout@v6
9697
with:
9798
fetch-depth: 0 # Fetch all history for all branches and tags.
9899

@@ -143,7 +144,7 @@ jobs:
143144
PYTHON_VERSION: "3.11"
144145

145146
steps:
146-
- uses: actions/checkout@v5
147+
- uses: actions/checkout@v6
147148
with:
148149
fetch-depth: 0 # Fetch all history for all branches and tags.
149150

@@ -199,7 +200,7 @@ jobs:
199200
PYTHON_VERSION: "3.12"
200201

201202
steps:
202-
- uses: actions/checkout@v5
203+
- uses: actions/checkout@v6
203204
with:
204205
fetch-depth: 0 # Fetch all history for all branches and tags.
205206

@@ -255,7 +256,7 @@ jobs:
255256
PYTHON_VERSION: "3.11"
256257

257258
steps:
258-
- uses: actions/checkout@v5
259+
- uses: actions/checkout@v6
259260
with:
260261
fetch-depth: 0 # Fetch all history for all branches and tags.
261262

@@ -307,7 +308,7 @@ jobs:
307308
COLUMNS: 120
308309

309310
steps:
310-
- uses: actions/checkout@v5
311+
- uses: actions/checkout@v6
311312
with:
312313
fetch-depth: 0 # Fetch all history for all branches and tags.
313314

.github/workflows/ci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ jobs:
2222
if: |
2323
github.repository == 'pydata/xarray'
2424
&& (github.event_name == 'push' || github.event_name == 'pull_request')
25+
&& !contains(github.event.pull_request.labels.*.name, 'skip-ci')
2526
outputs:
2627
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2728
steps:
28-
- uses: actions/checkout@v5
29+
- uses: actions/checkout@v6
2930
with:
3031
fetch-depth: 2
3132
- uses: xarray-contrib/ci-trigger@v1
@@ -79,7 +80,7 @@ jobs:
7980
numprocesses: 1
8081
os: ubuntu-latest
8182
steps:
82-
- uses: actions/checkout@v5
83+
- uses: actions/checkout@v6
8384
with:
8485
fetch-depth: 0 # Fetch all history for all branches and tags.
8586
- name: Set environment variables

.github/workflows/hypothesis.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ jobs:
2121
if: |
2222
github.repository == 'pydata/xarray'
2323
&& (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule')
24+
&& !contains(github.event.pull_request.labels.*.name, 'skip-ci')
2425
outputs:
2526
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2627
steps:
27-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
2829
with:
2930
fetch-depth: 2
3031
- uses: xarray-contrib/ci-trigger@v1
@@ -52,7 +53,7 @@ jobs:
5253
PYTHON_VERSION: "3.12"
5354

5455
steps:
55-
- uses: actions/checkout@v5
56+
- uses: actions/checkout@v6
5657
with:
5758
fetch-depth: 0 # Fetch all history for all branches and tags.
5859

.github/workflows/nightly-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
if: github.repository == 'pydata/xarray'
1010
steps:
11-
- uses: actions/checkout@v5
11+
- uses: actions/checkout@v6
1212
with:
1313
fetch-depth: 0
1414
- uses: actions/setup-python@v6

.github/workflows/pypi-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
startsWith(github.ref, 'refs/tags/v')
2121
) }}
2222
steps:
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424
with:
2525
fetch-depth: 0
2626
- uses: actions/setup-python@v6

.github/workflows/upstream-dev-ci.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ jobs:
2525
if: |
2626
github.repository == 'pydata/xarray'
2727
&& (github.event_name == 'push' || github.event_name == 'pull_request')
28+
&& !contains(github.event.pull_request.labels.*.name, 'skip-ci')
2829
outputs:
2930
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
3031
steps:
31-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@v6
3233
with:
3334
fetch-depth: 2
3435
- uses: xarray-contrib/ci-trigger@v1
@@ -55,7 +56,7 @@ jobs:
5556
matrix:
5657
python-version: ["3.12"]
5758
steps:
58-
- uses: actions/checkout@v5
59+
- uses: actions/checkout@v6
5960
with:
6061
fetch-depth: 0 # Fetch all history for all branches and tags.
6162
- name: Set up conda environment
@@ -111,7 +112,7 @@ jobs:
111112
matrix:
112113
python-version: ["3.11"]
113114
steps:
114-
- uses: actions/checkout@v5
115+
- uses: actions/checkout@v6
115116
with:
116117
fetch-depth: 0 # Fetch all history for all branches and tags.
117118
- name: Set up conda environment

asv_bench/benchmarks/coarsen.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import numpy as np
2+
3+
import xarray as xr
4+
5+
from . import randn
6+
7+
# Sizes chosen to test padding optimization
8+
nx_padded = 4003 # Not divisible by 10 - requires padding
9+
ny_padded = 4007 # Not divisible by 10 - requires padding
10+
11+
nx_exact = 4000 # Divisible by 10 - no padding needed
12+
ny_exact = 4000 # Divisible by 10 - no padding needed
13+
14+
window = 10
15+
16+
17+
class Coarsen:
18+
def setup(self, *args, **kwargs):
19+
# Case 1: Requires padding on both dimensions
20+
self.da_padded = xr.DataArray(
21+
randn((nx_padded, ny_padded)),
22+
dims=("x", "y"),
23+
coords={"x": np.arange(nx_padded), "y": np.arange(ny_padded)},
24+
)
25+
26+
# Case 2: No padding required
27+
self.da_exact = xr.DataArray(
28+
randn((nx_exact, ny_exact)),
29+
dims=("x", "y"),
30+
coords={"x": np.arange(nx_exact), "y": np.arange(ny_exact)},
31+
)
32+
33+
def time_coarsen_with_padding(self):
34+
"""Coarsen 2D array where both dimensions require padding."""
35+
self.da_padded.coarsen(x=window, y=window, boundary="pad").mean()
36+
37+
def time_coarsen_no_padding(self):
38+
"""Coarsen 2D array where dimensions are exact multiples (no padding)."""
39+
self.da_exact.coarsen(x=window, y=window, boundary="pad").mean()
40+
41+
def peakmem_coarsen_with_padding(self):
42+
"""Peak memory for coarsening with padding on both dimensions."""
43+
self.da_padded.coarsen(x=window, y=window, boundary="pad").mean()
44+
45+
def peakmem_coarsen_no_padding(self):
46+
"""Peak memory for coarsening without padding."""
47+
self.da_exact.coarsen(x=window, y=window, boundary="pad").mean()

ci/requirements/environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ dependencies:
3737
- pre-commit
3838
- pyarrow # pandas raises a deprecation warning without this, breaking doctests
3939
- pydap
40-
- pydap-server
4140
- pytest
4241
- pytest-asyncio
4342
- pytest-cov

0 commit comments

Comments
 (0)