cf-xarray 0.10.9__tar.gz → 0.10.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/workflows/ci.yaml +8 -8
  2. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/workflows/pypi.yaml +6 -6
  3. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/workflows/testpypi-release.yaml +5 -5
  4. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/workflows/upstream-dev-ci.yaml +3 -3
  5. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.pre-commit-config.yaml +2 -2
  6. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/PKG-INFO +1 -1
  7. cf_xarray-0.10.10/cf_xarray/_version.py +1 -0
  8. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/accessor.py +0 -1
  9. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/geometry.py +5 -1
  10. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/helpers.py +7 -1
  11. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_accessor.py +3 -0
  12. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/units.py +1 -1
  13. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray.egg-info/PKG-INFO +1 -1
  14. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/pyproject.toml +0 -1
  15. cf_xarray-0.10.9/cf_xarray/_version.py +0 -1
  16. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.binder/environment.yml +0 -0
  17. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.deepsource.toml +0 -0
  18. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/dependabot.yml +0 -0
  19. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/release.yml +0 -0
  20. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.github/workflows/parse_logs.py +0 -0
  21. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.gitignore +0 -0
  22. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.readthedocs.yml +0 -0
  23. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/.tributors +0 -0
  24. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/CITATION.cff +0 -0
  25. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/LICENSE +0 -0
  26. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/README.rst +0 -0
  27. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/__init__.py +0 -0
  28. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/coding.py +0 -0
  29. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/criteria.py +0 -0
  30. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/datasets.py +0 -0
  31. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/formatting.py +0 -0
  32. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/groupers.py +0 -0
  33. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/options.py +0 -0
  34. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/parametric.py +0 -0
  35. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/py.typed +0 -0
  36. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/scripts/make_doc.py +0 -0
  37. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/scripts/print_versions.py +0 -0
  38. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/sgrid.py +0 -0
  39. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/__init__.py +0 -0
  40. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/conftest.py +0 -0
  41. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_coding.py +0 -0
  42. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_geometry.py +0 -0
  43. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_groupers.py +0 -0
  44. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_helpers.py +0 -0
  45. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_options.py +0 -0
  46. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_parametric.py +0 -0
  47. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_scripts.py +0 -0
  48. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/tests/test_units.py +0 -0
  49. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray/utils.py +0 -0
  50. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray.egg-info/SOURCES.txt +0 -0
  51. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray.egg-info/dependency_links.txt +0 -0
  52. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray.egg-info/requires.txt +0 -0
  53. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/cf_xarray.egg-info/top_level.txt +0 -0
  54. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/codecov.yml +0 -0
  55. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/2D_bounds_averaged.png +0 -0
  56. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/2D_bounds_error.png +0 -0
  57. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/2D_bounds_nonunique.png +0 -0
  58. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/Makefile +0 -0
  59. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/_static/dataset-diagram-logo.tex +0 -0
  60. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/_static/full-logo.png +0 -0
  61. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/_static/logo.png +0 -0
  62. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/_static/logo.svg +0 -0
  63. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/_static/rich-repr-example.png +0 -0
  64. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/_static/style.css +0 -0
  65. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/api.rst +0 -0
  66. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/bounds.md +0 -0
  67. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/cartopy_rotated_pole.png +0 -0
  68. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/coding.md +0 -0
  69. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/conf.py +0 -0
  70. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/contributing.rst +0 -0
  71. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/coord_axes.md +0 -0
  72. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/custom-criteria.md +0 -0
  73. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/dsg.md +0 -0
  74. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/examples/introduction.ipynb +0 -0
  75. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/faq.md +0 -0
  76. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/flags.md +0 -0
  77. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/geometry.md +0 -0
  78. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/grid_mappings.md +0 -0
  79. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/howtouse.md +0 -0
  80. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/index.rst +0 -0
  81. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/make.bat +0 -0
  82. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/parametricz.md +0 -0
  83. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/plotting.md +0 -0
  84. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/provenance.md +0 -0
  85. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/quickstart.md +0 -0
  86. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/roadmap.rst +0 -0
  87. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/selecting.md +0 -0
  88. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/sgrid_ugrid.md +0 -0
  89. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/units.md +0 -0
  90. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/doc/whats-new.rst +0 -0
  91. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/setup.cfg +0 -0
  92. {cf_xarray-0.10.9 → cf_xarray-0.10.10}/uv.lock +0 -0
@@ -34,17 +34,17 @@ jobs:
34
34
  python-version: "3.13"
35
35
  os: ubuntu-latest
36
36
  steps:
37
- - uses: actions/checkout@v5
37
+ - uses: actions/checkout@v6
38
38
  with:
39
39
  fetch-depth: 0 # Fetch all history for all branches and tags.
40
40
 
41
41
  - name: Set up Python
42
- uses: actions/setup-python@v5
42
+ uses: actions/setup-python@v6
43
43
  with:
44
44
  python-version: ${{ matrix.python-version }}
45
45
 
46
46
  - name: Install uv
47
- uses: astral-sh/setup-uv@v4
47
+ uses: astral-sh/setup-uv@v7
48
48
  with:
49
49
  enable-cache: true
50
50
 
@@ -58,7 +58,7 @@ jobs:
58
58
  pytest -n auto --cov=./ --cov-report=xml
59
59
 
60
60
  - name: Upload code coverage to Codecov
61
- uses: codecov/codecov-action@v5.5.0
61
+ uses: codecov/codecov-action@v5.5.1
62
62
  with:
63
63
  file: ./coverage.xml
64
64
  flags: unittests
@@ -73,17 +73,17 @@ jobs:
73
73
  matrix:
74
74
  python-version: ["3.11", "3.13"]
75
75
  steps:
76
- - uses: actions/checkout@v5
76
+ - uses: actions/checkout@v6
77
77
  with:
78
78
  fetch-depth: 0 # Fetch all history for all branches and tags.
79
79
 
80
80
  - name: Set up Python
81
- uses: actions/setup-python@v5
81
+ uses: actions/setup-python@v6
82
82
  with:
83
83
  python-version: ${{ matrix.python-version }}
84
84
 
85
85
  - name: Install uv
86
- uses: astral-sh/setup-uv@v4
86
+ uses: astral-sh/setup-uv@v7
87
87
  with:
88
88
  enable-cache: true
89
89
 
@@ -98,7 +98,7 @@ jobs:
98
98
  python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report cf_xarray/
99
99
 
100
100
  - name: Upload mypy coverage to Codecov
101
- uses: codecov/codecov-action@v5.5.0
101
+ uses: codecov/codecov-action@v5.5.1
102
102
  with:
103
103
  file: mypy_report/cobertura.xml
104
104
  flags: mypy
@@ -12,10 +12,10 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  if: github.repository == 'xarray-contrib/cf-xarray'
14
14
  steps:
15
- - uses: actions/checkout@v5
15
+ - uses: actions/checkout@v6
16
16
  with:
17
17
  fetch-depth: 0
18
- - uses: actions/setup-python@v5
18
+ - uses: actions/setup-python@v6
19
19
  name: Install Python
20
20
  with:
21
21
  python-version: "3.11"
@@ -41,7 +41,7 @@ jobs:
41
41
  else
42
42
  echo "✅ Looks good"
43
43
  fi
44
- - uses: actions/upload-artifact@v4
44
+ - uses: actions/upload-artifact@v5
45
45
  with:
46
46
  name: releases
47
47
  path: dist
@@ -50,11 +50,11 @@ jobs:
50
50
  needs: build-artifacts
51
51
  runs-on: ubuntu-latest
52
52
  steps:
53
- - uses: actions/setup-python@v5
53
+ - uses: actions/setup-python@v6
54
54
  name: Install Python
55
55
  with:
56
56
  python-version: "3.11"
57
- - uses: actions/download-artifact@v5
57
+ - uses: actions/download-artifact@v6
58
58
  with:
59
59
  name: releases
60
60
  path: dist
@@ -91,7 +91,7 @@ jobs:
91
91
  id-token: write
92
92
 
93
93
  steps:
94
- - uses: actions/download-artifact@v5
94
+ - uses: actions/download-artifact@v6
95
95
  with:
96
96
  name: releases
97
97
  path: dist
@@ -17,11 +17,11 @@ jobs:
17
17
  if: ${{ contains( github.event.pull_request.labels.*.name, 'test-build') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
- - uses: actions/checkout@v5
20
+ - uses: actions/checkout@v6
21
21
  with:
22
22
  fetch-depth: 0
23
23
 
24
- - uses: actions/setup-python@v5
24
+ - uses: actions/setup-python@v6
25
25
  name: Install Python
26
26
  with:
27
27
  python-version: "3.11"
@@ -53,7 +53,7 @@ jobs:
53
53
  echo "✅ Looks good"
54
54
  fi
55
55
 
56
- - uses: actions/upload-artifact@v4
56
+ - uses: actions/upload-artifact@v5
57
57
  with:
58
58
  name: releases
59
59
  path: dist
@@ -62,11 +62,11 @@ jobs:
62
62
  needs: build-artifacts
63
63
  runs-on: ubuntu-latest
64
64
  steps:
65
- - uses: actions/setup-python@v5
65
+ - uses: actions/setup-python@v6
66
66
  name: Install Python
67
67
  with:
68
68
  python-version: "3.11"
69
- - uses: actions/download-artifact@v5
69
+ - uses: actions/download-artifact@v6
70
70
  with:
71
71
  name: releases
72
72
  path: dist
@@ -28,17 +28,17 @@ jobs:
28
28
  matrix:
29
29
  python-version: ["3.13"]
30
30
  steps:
31
- - uses: actions/checkout@v5
31
+ - uses: actions/checkout@v6
32
32
  with:
33
33
  fetch-depth: 0 # Fetch all history for all branches and tags.
34
34
 
35
35
  - name: Set up Python
36
- uses: actions/setup-python@v5
36
+ uses: actions/setup-python@v6
37
37
  with:
38
38
  python-version: ${{ matrix.python-version }}
39
39
 
40
40
  - name: Install uv
41
- uses: astral-sh/setup-uv@v4
41
+ uses: astral-sh/setup-uv@v7
42
42
 
43
43
  - name: Install dependencies
44
44
  run: |
@@ -10,7 +10,7 @@ repos:
10
10
 
11
11
  - repo: https://github.com/astral-sh/ruff-pre-commit
12
12
  # Ruff version.
13
- rev: 'v0.12.2'
13
+ rev: 'v0.13.3'
14
14
  hooks:
15
15
  - id: ruff
16
16
  args: ["--fix", "--show-fixes"]
@@ -41,7 +41,7 @@ repos:
41
41
  additional_dependencies: [mdformat==0.7.17]
42
42
 
43
43
  - repo: https://github.com/pre-commit/pre-commit-hooks
44
- rev: v5.0.0
44
+ rev: v6.0.0
45
45
  hooks:
46
46
  - id: trailing-whitespace
47
47
  - id: end-of-file-fixer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cf_xarray
3
- Version: 0.10.9
3
+ Version: 0.10.10
4
4
  Summary: A convenience wrapper for using CF attributes on xarray objects
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -0,0 +1 @@
1
+ __version__ = "0.10.10"
@@ -796,7 +796,6 @@ def _guess_bounds(da, dim=None, out_dim="bounds"):
796
796
  f"If dim is None, variable {da.name} must be 1D or 2D. Received {da.ndim}D variable instead."
797
797
  )
798
798
  dim = da.dims
799
-
800
799
  if not isinstance(dim, str):
801
800
  if len(dim) > 2:
802
801
  raise NotImplementedError(
@@ -586,7 +586,11 @@ def points_to_cf(
586
586
  coord = None
587
587
  pts_ = pts
588
588
 
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] = []
590
594
  for pt in pts_:
591
595
  if isinstance(pt, MultiPoint):
592
596
  xy = np.concatenate([p.coords for p in pt.geoms])
@@ -34,7 +34,7 @@ def _guess_bounds_1d(da, dim):
34
34
  result = xr.concat([first, bounds], dim=dim).transpose(..., "bounds")
35
35
  if ADDED_INDEX:
36
36
  result = result.drop_vars(dim)
37
- return result
37
+ return result.drop_attrs(deep=False)
38
38
 
39
39
 
40
40
  def _guess_bounds_2d(da, dims):
@@ -338,6 +338,12 @@ def _get_ordered_vertices(
338
338
  elif order == "descending":
339
339
  endpoints = np.maximum(bounds[..., :, 0], bounds[..., :, 1])
340
340
  last_endpoint = np.minimum(bounds[..., -1, 0], bounds[..., -1, 1])
341
+ else:
342
+ raise NotImplementedError(
343
+ f"Cannot determine vertices for non-monotonic bounds with {order} core "
344
+ "dimension orders. Try normalizing the coordinates to a monotonic "
345
+ "convention and try again."
346
+ )
341
347
 
342
348
  vertices = np.concatenate(
343
349
  [endpoints, np.expand_dims(last_endpoint, axis=-1)], axis=-1
@@ -832,6 +832,9 @@ def test_add_bounds(dims):
832
832
  assert_allclose(
833
833
  added[name].reset_coords(drop=True), expected[dim].transpose(..., "bounds")
834
834
  )
835
+ if dim == "lat":
836
+ # The CF axes shouldn't have changed
837
+ assert added.cf.axes["Y"] == ["lat"]
835
838
 
836
839
  _check_unchanged(original, ds)
837
840
 
@@ -60,7 +60,7 @@ def short_formatter(unit, registry, **options):
60
60
  # Reused with modification from MetPy under the terms of the BSD 3-Clause License.
61
61
  # Copyright (c) 2015,2017,2019 MetPy Developers.
62
62
  # Create registry, with preprocessors for UDUNITS-style powers (m2 s-2) and percent signs
63
- units = pint.UnitRegistry(
63
+ units: pint.UnitRegistry = pint.UnitRegistry(
64
64
  autoconvert_offset_to_baseunit=True,
65
65
  preprocessors=[
66
66
  functools.partial(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cf_xarray
3
- Version: 0.10.9
3
+ Version: 0.10.10
4
4
  Summary: A convenience wrapper for using CF attributes on xarray objects
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -107,7 +107,6 @@ docstring-code-format = true
107
107
 
108
108
 
109
109
  [tool.pytest]
110
- python_files = "test_*.py"
111
110
  testpaths = ["cf_xarray/tests"]
112
111
 
113
112
  [tool.rstcheck]
@@ -1 +0,0 @@
1
- __version__ = "0.10.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes