Skip to content

Commit 2671a7f

Browse files
authored
Merge branch 'main' into bug/594-mixed-coords
2 parents bde699c + e82882b commit 2671a7f

File tree

11 files changed

+34
-29
lines changed

11 files changed

+34
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ jobs:
3434
python-version: "3.13"
3535
os: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
3838
with:
3939
fetch-depth: 0 # Fetch all history for all branches and tags.
4040

4141
- name: Set up Python
42-
uses: actions/setup-python@v5
42+
uses: actions/setup-python@v6
4343
with:
4444
python-version: ${{ matrix.python-version }}
4545

4646
- name: Install uv
47-
uses: astral-sh/setup-uv@v4
47+
uses: astral-sh/setup-uv@v7
4848
with:
4949
enable-cache: true
5050

@@ -58,7 +58,7 @@ jobs:
5858
pytest -n auto --cov=./ --cov-report=xml
5959
6060
- name: Upload code coverage to Codecov
61-
uses: codecov/[email protected].0
61+
uses: codecov/[email protected].1
6262
with:
6363
file: ./coverage.xml
6464
flags: unittests
@@ -73,17 +73,17 @@ jobs:
7373
matrix:
7474
python-version: ["3.11", "3.13"]
7575
steps:
76-
- uses: actions/checkout@v5
76+
- uses: actions/checkout@v6
7777
with:
7878
fetch-depth: 0 # Fetch all history for all branches and tags.
7979

8080
- name: Set up Python
81-
uses: actions/setup-python@v5
81+
uses: actions/setup-python@v6
8282
with:
8383
python-version: ${{ matrix.python-version }}
8484

8585
- name: Install uv
86-
uses: astral-sh/setup-uv@v4
86+
uses: astral-sh/setup-uv@v7
8787
with:
8888
enable-cache: true
8989

@@ -98,7 +98,7 @@ jobs:
9898
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report cf_xarray/
9999
100100
- name: Upload mypy coverage to Codecov
101-
uses: codecov/[email protected].0
101+
uses: codecov/[email protected].1
102102
with:
103103
file: mypy_report/cobertura.xml
104104
flags: mypy

.github/workflows/pypi.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
if: github.repository == 'xarray-contrib/cf-xarray'
1414
steps:
15-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
18-
- uses: actions/setup-python@v5
18+
- uses: actions/setup-python@v6
1919
name: Install Python
2020
with:
2121
python-version: "3.11"
@@ -41,7 +41,7 @@ jobs:
4141
else
4242
echo "✅ Looks good"
4343
fi
44-
- uses: actions/upload-artifact@v4
44+
- uses: actions/upload-artifact@v5
4545
with:
4646
name: releases
4747
path: dist
@@ -50,11 +50,11 @@ jobs:
5050
needs: build-artifacts
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/setup-python@v5
53+
- uses: actions/setup-python@v6
5454
name: Install Python
5555
with:
5656
python-version: "3.11"
57-
- uses: actions/download-artifact@v5
57+
- uses: actions/download-artifact@v6
5858
with:
5959
name: releases
6060
path: dist
@@ -91,7 +91,7 @@ jobs:
9191
id-token: write
9292

9393
steps:
94-
- uses: actions/download-artifact@v5
94+
- uses: actions/download-artifact@v6
9595
with:
9696
name: releases
9797
path: dist

.github/workflows/testpypi-release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
if: ${{ contains( github.event.pull_request.labels.*.name, 'test-build') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v5
20+
- uses: actions/checkout@v6
2121
with:
2222
fetch-depth: 0
2323

24-
- uses: actions/setup-python@v5
24+
- uses: actions/setup-python@v6
2525
name: Install Python
2626
with:
2727
python-version: "3.11"
@@ -53,7 +53,7 @@ jobs:
5353
echo "✅ Looks good"
5454
fi
5555
56-
- uses: actions/upload-artifact@v4
56+
- uses: actions/upload-artifact@v5
5757
with:
5858
name: releases
5959
path: dist
@@ -62,11 +62,11 @@ jobs:
6262
needs: build-artifacts
6363
runs-on: ubuntu-latest
6464
steps:
65-
- uses: actions/setup-python@v5
65+
- uses: actions/setup-python@v6
6666
name: Install Python
6767
with:
6868
python-version: "3.11"
69-
- uses: actions/download-artifact@v5
69+
- uses: actions/download-artifact@v6
7070
with:
7171
name: releases
7272
path: dist

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ jobs:
2828
matrix:
2929
python-version: ["3.13"]
3030
steps:
31-
- uses: actions/checkout@v5
31+
- uses: actions/checkout@v6
3232
with:
3333
fetch-depth: 0 # Fetch all history for all branches and tags.
3434

3535
- name: Set up Python
36-
uses: actions/setup-python@v5
36+
uses: actions/setup-python@v6
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939

4040
- name: Install uv
41-
uses: astral-sh/setup-uv@v4
41+
uses: astral-sh/setup-uv@v7
4242

4343
- name: Install dependencies
4444
run: |

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010

1111
- repo: https://github.com/astral-sh/ruff-pre-commit
1212
# Ruff version.
13-
rev: 'v0.12.2'
13+
rev: 'v0.13.3'
1414
hooks:
1515
- id: ruff
1616
args: ["--fix", "--show-fixes"]
@@ -41,7 +41,7 @@ repos:
4141
additional_dependencies: [mdformat==0.7.17]
4242

4343
- repo: https://github.com/pre-commit/pre-commit-hooks
44-
rev: v5.0.0
44+
rev: v6.0.0
4545
hooks:
4646
- id: trailing-whitespace
4747
- id: end-of-file-fixer

cf_xarray/accessor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ def _guess_bounds(da, dim=None, out_dim="bounds"):
796796
f"If dim is None, variable {da.name} must be 1D or 2D. Received {da.ndim}D variable instead."
797797
)
798798
dim = da.dims
799-
800799
if not isinstance(dim, str):
801800
if len(dim) > 2:
802801
raise NotImplementedError(

cf_xarray/geometry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,11 @@ def points_to_cf(
586586
coord = None
587587
pts_ = pts
588588

589-
x, y, node_count, crdX, crdY = [], [], [], [], []
589+
x: list[np.ndarray] = []
590+
y: list[np.ndarray] = []
591+
node_count: list[int] = []
592+
crdX: list[float] = []
593+
crdY: list[float] = []
590594
for pt in pts_:
591595
if isinstance(pt, MultiPoint):
592596
xy = np.concatenate([p.coords for p in pt.geoms])

cf_xarray/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _guess_bounds_1d(da, dim):
3434
result = xr.concat([first, bounds], dim=dim).transpose(..., "bounds")
3535
if ADDED_INDEX:
3636
result = result.drop_vars(dim)
37-
return result
37+
return result.drop_attrs(deep=False)
3838

3939

4040
def _guess_bounds_2d(da, dims):

cf_xarray/tests/test_accessor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,9 @@ def test_add_bounds(dims):
832832
assert_allclose(
833833
added[name].reset_coords(drop=True), expected[dim].transpose(..., "bounds")
834834
)
835+
if dim == "lat":
836+
# The CF axes shouldn't have changed
837+
assert added.cf.axes["Y"] == ["lat"]
835838

836839
_check_unchanged(original, ds)
837840

cf_xarray/units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def short_formatter(unit, registry, **options):
6060
# Reused with modification from MetPy under the terms of the BSD 3-Clause License.
6161
# Copyright (c) 2015,2017,2019 MetPy Developers.
6262
# Create registry, with preprocessors for UDUNITS-style powers (m2 s-2) and percent signs
63-
units = pint.UnitRegistry(
63+
units: pint.UnitRegistry = pint.UnitRegistry(
6464
autoconvert_offset_to_baseunit=True,
6565
preprocessors=[
6666
functools.partial(

0 commit comments

Comments
 (0)