cf-xarray 0.10.1__tar.gz → 0.10.2__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 (96) hide show
  1. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/workflows/ci.yaml +24 -29
  2. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/workflows/upstream-dev-ci.yaml +1 -1
  3. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/PKG-INFO +3 -2
  4. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/__init__.py +6 -1
  5. cf_xarray-0.10.2/cf_xarray/_version.py +1 -0
  6. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/groupers.py +6 -0
  7. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_groupers.py +2 -0
  8. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray.egg-info/PKG-INFO +3 -2
  9. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray.egg-info/SOURCES.txt +1 -0
  10. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray.egg-info/requires.txt +1 -1
  11. cf_xarray-0.10.2/ci/environment-all-min-deps.yml +24 -0
  12. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/api.rst +3 -2
  13. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/pyproject.toml +3 -2
  14. cf_xarray-0.10.1/cf_xarray/_version.py +0 -1
  15. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.binder/environment.yml +0 -0
  16. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.deepsource.toml +0 -0
  17. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/dependabot.yml +0 -0
  18. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/release.yml +0 -0
  19. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/workflows/parse_logs.py +0 -0
  20. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/workflows/pypi.yaml +0 -0
  21. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.github/workflows/testpypi-release.yaml +0 -0
  22. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.gitignore +0 -0
  23. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.pre-commit-config.yaml +0 -0
  24. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.readthedocs.yml +0 -0
  25. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/.tributors +0 -0
  26. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/CITATION.cff +0 -0
  27. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/LICENSE +0 -0
  28. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/README.rst +0 -0
  29. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/accessor.py +0 -0
  30. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/coding.py +0 -0
  31. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/criteria.py +0 -0
  32. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/datasets.py +0 -0
  33. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/formatting.py +0 -0
  34. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/geometry.py +0 -0
  35. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/helpers.py +0 -0
  36. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/options.py +0 -0
  37. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/parametric.py +0 -0
  38. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/py.typed +0 -0
  39. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/scripts/make_doc.py +0 -0
  40. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/scripts/print_versions.py +0 -0
  41. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/sgrid.py +0 -0
  42. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/__init__.py +0 -0
  43. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/conftest.py +0 -0
  44. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_accessor.py +0 -0
  45. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_coding.py +0 -0
  46. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_geometry.py +0 -0
  47. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_helpers.py +0 -0
  48. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_options.py +0 -0
  49. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_parametric.py +0 -0
  50. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_scripts.py +0 -0
  51. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/tests/test_units.py +0 -0
  52. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/units.py +0 -0
  53. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray/utils.py +0 -0
  54. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray.egg-info/dependency_links.txt +0 -0
  55. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/cf_xarray.egg-info/top_level.txt +0 -0
  56. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/ci/doc.yml +0 -0
  57. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/ci/environment-no-optional-deps.yml +0 -0
  58. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/ci/environment.yml +0 -0
  59. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/ci/upstream-dev-env.yml +0 -0
  60. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/codecov.yml +0 -0
  61. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/2D_bounds_averaged.png +0 -0
  62. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/2D_bounds_error.png +0 -0
  63. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/2D_bounds_nonunique.png +0 -0
  64. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/Makefile +0 -0
  65. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/_static/dataset-diagram-logo.tex +0 -0
  66. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/_static/full-logo.png +0 -0
  67. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/_static/logo.png +0 -0
  68. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/_static/logo.svg +0 -0
  69. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/_static/rich-repr-example.png +0 -0
  70. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/_static/style.css +0 -0
  71. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/bounds.md +0 -0
  72. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/cartopy_rotated_pole.png +0 -0
  73. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/coding.md +0 -0
  74. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/conf.py +0 -0
  75. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/contributing.rst +0 -0
  76. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/coord_axes.md +0 -0
  77. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/custom-criteria.md +0 -0
  78. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/dsg.md +0 -0
  79. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/examples/introduction.ipynb +0 -0
  80. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/faq.md +0 -0
  81. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/flags.md +0 -0
  82. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/geometry.md +0 -0
  83. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/grid_mappings.md +0 -0
  84. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/howtouse.md +0 -0
  85. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/index.rst +0 -0
  86. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/make.bat +0 -0
  87. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/parametricz.md +0 -0
  88. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/plotting.md +0 -0
  89. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/provenance.md +0 -0
  90. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/quickstart.md +0 -0
  91. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/roadmap.rst +0 -0
  92. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/selecting.md +0 -0
  93. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/sgrid_ugrid.md +0 -0
  94. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/units.md +0 -0
  95. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/doc/whats-new.rst +0 -0
  96. {cf_xarray-0.10.1 → cf_xarray-0.10.2}/setup.cfg +0 -0
@@ -18,7 +18,7 @@ env:
18
18
 
19
19
  jobs:
20
20
  build:
21
- name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
21
+ name: Build (${{ matrix.python-version }}, ${{ matrix.os }}), ${{ matrix.env }}
22
22
  runs-on: ${{ matrix.os }}
23
23
  defaults:
24
24
  run:
@@ -27,7 +27,15 @@ jobs:
27
27
  fail-fast: false
28
28
  matrix:
29
29
  os: ["ubuntu-latest"]
30
- python-version: ["3.10", "3.12"]
30
+ python-version: ["3.10", "3.13"]
31
+ env: [""]
32
+ include:
33
+ - env: "all-min-deps"
34
+ python-version: "3.10"
35
+ os: ubuntu-latest
36
+ - env: "no-optional-deps"
37
+ python-version: "3.13"
38
+ os: ubuntu-latest
31
39
  steps:
32
40
  - uses: actions/checkout@v4
33
41
  with:
@@ -35,10 +43,22 @@ jobs:
35
43
  - name: Set environment variables
36
44
  run: |
37
45
  echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
46
+ if [[ "${{ matrix.env }}" == "" ]] ;
47
+ then
48
+ echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
49
+ fi
50
+ if [[ "${{ matrix.env }}" == "no-optional-deps" ]] ;
51
+ then
52
+ echo "CONDA_ENV_FILE=ci/environment-no-optional-deps.yml" >> $GITHUB_ENV
53
+ fi
54
+ if [[ "${{ matrix.env }}" == "all-min-deps" ]] ;
55
+ then
56
+ echo "CONDA_ENV_FILE=ci/environment-all-min-deps.yml" >> $GITHUB_ENV
57
+ fi
38
58
  - name: Set up conda environment
39
59
  uses: mamba-org/setup-micromamba@v2
40
60
  with:
41
- environment-file: ci/environment.yml
61
+ environment-file: ${{ env.CONDA_ENV_FILE }}
42
62
  environment-name: cf_xarray_test
43
63
  cache-environment: true
44
64
  create-args: >-
@@ -58,31 +78,6 @@ jobs:
58
78
  name: codecov-umbrella
59
79
  fail_ci_if_error: false
60
80
 
61
- no-optional-deps:
62
- name: no-optional-deps
63
- runs-on: ubuntu-latest
64
- defaults:
65
- run:
66
- shell: bash -l {0}
67
- steps:
68
- - uses: actions/checkout@v4
69
- with:
70
- # need to fetch all tags to get a correct version
71
- fetch-depth: 0 # fetch all branches and tags
72
- - name: Set up conda environment
73
- uses: mamba-org/setup-micromamba@v2
74
- with:
75
- environment-file: ci/environment-no-optional-deps.yml
76
- environment-name: cf_xarray_test
77
- cache-environment: true
78
- - name: Install cf_xarray
79
- run: |
80
- python -m pip install --no-deps -e .
81
- - name: Run Tests
82
- shell: bash -l {0}
83
- run: |
84
- pytest -n 2
85
-
86
81
  mypy:
87
82
  name: mypy
88
83
  runs-on: "ubuntu-latest"
@@ -91,7 +86,7 @@ jobs:
91
86
  shell: bash -l {0}
92
87
  strategy:
93
88
  matrix:
94
- python-version: ["3.10", "3.12"]
89
+ python-version: ["3.10", "3.13"]
95
90
  steps:
96
91
  - uses: actions/checkout@v4
97
92
  with:
@@ -29,7 +29,7 @@ jobs:
29
29
  strategy:
30
30
  fail-fast: false
31
31
  matrix:
32
- python-version: ["3.12"]
32
+ python-version: ["3.13"]
33
33
  steps:
34
34
  - uses: actions/checkout@v4
35
35
  with:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cf_xarray
3
- Version: 0.10.1
3
+ Version: 0.10.2
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
@@ -217,10 +217,11 @@ Classifier: Programming Language :: Python
217
217
  Classifier: Programming Language :: Python :: 3.10
218
218
  Classifier: Programming Language :: Python :: 3.11
219
219
  Classifier: Programming Language :: Python :: 3.12
220
+ Classifier: Programming Language :: Python :: 3.13
220
221
  Requires-Python: >=3.10
221
222
  Description-Content-Type: text/x-rst
222
223
  License-File: LICENSE
223
- Requires-Dist: xarray>=2022.03.0
224
+ Requires-Dist: xarray>=2023.09.0
224
225
  Provides-Extra: all
225
226
  Requires-Dist: matplotlib; extra == "all"
226
227
  Requires-Dist: pint!=0.24.0,>=0.18; extra == "all"
@@ -1,3 +1,7 @@
1
+ import xarray
2
+ from packaging.version import Version
3
+
4
+ from . import geometry as geometry
1
5
  from . import sgrid # noqa
2
6
  from .accessor import CFAccessor # noqa
3
7
  from .coding import ( # noqa
@@ -9,6 +13,7 @@ from .helpers import bounds_to_vertices, vertices_to_bounds # noqa
9
13
  from .options import set_options # noqa
10
14
  from .utils import _get_version
11
15
 
12
- from . import geometry, groupers # noqa
16
+ if Version(xarray.__version__) >= Version("2024.07.0"):
17
+ from . import groupers as groupers
13
18
 
14
19
  __version__ = _get_version()
@@ -0,0 +1 @@
1
+ __version__ = "0.10.2"
@@ -7,6 +7,12 @@ from xarray.groupers import EncodedGroups, UniqueGrouper
7
7
 
8
8
  @dataclass
9
9
  class FlagGrouper(UniqueGrouper):
10
+ """
11
+ Grouper object that allows convenient categorical grouping by a CF flag variable.
12
+
13
+ Labels in the grouped output will be restricted to those listed in ``flag_meanings``.
14
+ """
15
+
10
16
  def factorize(self, group) -> EncodedGroups:
11
17
  if "flag_values" not in group.attrs or "flag_meanings" not in group.attrs:
12
18
  raise ValueError(
@@ -3,6 +3,8 @@ import pytest
3
3
  import xarray as xr
4
4
  from xarray.testing import assert_identical
5
5
 
6
+ pytest.importorskip("xarray", "2024.07.0")
7
+
6
8
  from cf_xarray.datasets import flag_excl
7
9
  from cf_xarray.groupers import FlagGrouper
8
10
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cf_xarray
3
- Version: 0.10.1
3
+ Version: 0.10.2
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
@@ -217,10 +217,11 @@ Classifier: Programming Language :: Python
217
217
  Classifier: Programming Language :: Python :: 3.10
218
218
  Classifier: Programming Language :: Python :: 3.11
219
219
  Classifier: Programming Language :: Python :: 3.12
220
+ Classifier: Programming Language :: Python :: 3.13
220
221
  Requires-Python: >=3.10
221
222
  Description-Content-Type: text/x-rst
222
223
  License-File: LICENSE
223
- Requires-Dist: xarray>=2022.03.0
224
+ Requires-Dist: xarray>=2023.09.0
224
225
  Provides-Extra: all
225
226
  Requires-Dist: matplotlib; extra == "all"
226
227
  Requires-Dist: pint!=0.24.0,>=0.18; extra == "all"
@@ -51,6 +51,7 @@ cf_xarray/tests/test_parametric.py
51
51
  cf_xarray/tests/test_scripts.py
52
52
  cf_xarray/tests/test_units.py
53
53
  ci/doc.yml
54
+ ci/environment-all-min-deps.yml
54
55
  ci/environment-no-optional-deps.yml
55
56
  ci/environment.yml
56
57
  ci/upstream-dev-env.yml
@@ -1,4 +1,4 @@
1
- xarray>=2022.03.0
1
+ xarray>=2023.09.0
2
2
 
3
3
  [all]
4
4
  matplotlib
@@ -0,0 +1,24 @@
1
+ name: cf_xarray_test
2
+ channels:
3
+ - conda-forge
4
+ dependencies:
5
+ - pytest-cov
6
+ - pytest
7
+ - pytest-xdist
8
+ - dask
9
+ - flox
10
+ - lxml
11
+ - matplotlib-base
12
+ - netcdf4
13
+ - pandas
14
+ - pint==0.19
15
+ - pooch
16
+ - regex
17
+ - rich
18
+ - pooch
19
+ - scipy
20
+ - shapely
21
+ - xarray==2023.09.0
22
+ - pip
23
+ - pip:
24
+ - pytest-pretty
@@ -21,8 +21,8 @@ Geometries
21
21
  ----------
22
22
  .. autosummary::
23
23
  :toctree: generated/
24
- geometry.decode_geometries
25
24
 
25
+ geometry.decode_geometries
26
26
  geometry.encode_geometries
27
27
  geometry.shapely_to_cf
28
28
  geometry.cf_to_shapely
@@ -33,7 +33,8 @@ Groupers
33
33
  --------
34
34
  .. autosummary::
35
35
  :toctree: generated/
36
- groupers.FlagGrouper
36
+
37
+ groupers.FlagGrouper
37
38
 
38
39
  .. currentmodule:: xarray
39
40
 
@@ -14,9 +14,10 @@ classifiers = [
14
14
  "Programming Language :: Python :: 3.10",
15
15
  "Programming Language :: Python :: 3.11",
16
16
  "Programming Language :: Python :: 3.12",
17
+ "Programming Language :: Python :: 3.13",
17
18
  ]
18
19
  dependencies = [
19
- "xarray>=2022.03.0",
20
+ "xarray>=2023.09.0",
20
21
  ]
21
22
  dynamic = ["version"]
22
23
 
@@ -32,7 +33,7 @@ changelog = "https://cf-xarray.readthedocs.io/en/latest/whats-new.html"
32
33
  [build-system]
33
34
  requires = [
34
35
  # xarray is need for dynamic version string
35
- "xarray>=2022.03.0",
36
+ "xarray>=2023.09.0",
36
37
  "setuptools>=45",
37
38
  "setuptools_scm[toml]>=6.2",
38
39
  ]
@@ -1 +0,0 @@
1
- __version__ = "0.10.1"
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
File without changes
File without changes
File without changes