cf-xarray 0.10.3__tar.gz → 0.10.5__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.3 → cf_xarray-0.10.5}/PKG-INFO +3 -2
  2. cf_xarray-0.10.5/cf_xarray/_version.py +1 -0
  3. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/accessor.py +21 -2
  4. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/groupers.py +11 -4
  5. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray.egg-info/PKG-INFO +3 -2
  6. cf_xarray-0.10.3/cf_xarray/_version.py +0 -1
  7. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.binder/environment.yml +0 -0
  8. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.deepsource.toml +0 -0
  9. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/dependabot.yml +0 -0
  10. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/release.yml +0 -0
  11. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/workflows/ci.yaml +0 -0
  12. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/workflows/parse_logs.py +0 -0
  13. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/workflows/pypi.yaml +0 -0
  14. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/workflows/testpypi-release.yaml +0 -0
  15. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.github/workflows/upstream-dev-ci.yaml +0 -0
  16. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.gitignore +0 -0
  17. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.pre-commit-config.yaml +0 -0
  18. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.readthedocs.yml +0 -0
  19. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/.tributors +0 -0
  20. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/CITATION.cff +0 -0
  21. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/LICENSE +0 -0
  22. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/README.rst +0 -0
  23. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/__init__.py +0 -0
  24. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/coding.py +0 -0
  25. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/criteria.py +0 -0
  26. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/datasets.py +0 -0
  27. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/formatting.py +0 -0
  28. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/geometry.py +0 -0
  29. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/helpers.py +0 -0
  30. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/options.py +0 -0
  31. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/parametric.py +0 -0
  32. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/py.typed +0 -0
  33. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/scripts/make_doc.py +0 -0
  34. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/scripts/print_versions.py +0 -0
  35. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/sgrid.py +0 -0
  36. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/__init__.py +0 -0
  37. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/conftest.py +0 -0
  38. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_accessor.py +0 -0
  39. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_coding.py +0 -0
  40. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_geometry.py +0 -0
  41. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_groupers.py +0 -0
  42. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_helpers.py +0 -0
  43. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_options.py +0 -0
  44. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_parametric.py +0 -0
  45. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_scripts.py +0 -0
  46. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/tests/test_units.py +0 -0
  47. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/units.py +0 -0
  48. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray/utils.py +0 -0
  49. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray.egg-info/SOURCES.txt +0 -0
  50. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray.egg-info/dependency_links.txt +0 -0
  51. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray.egg-info/requires.txt +0 -0
  52. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/cf_xarray.egg-info/top_level.txt +0 -0
  53. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/ci/doc.yml +0 -0
  54. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/ci/environment-all-min-deps.yml +0 -0
  55. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/ci/environment-no-optional-deps.yml +0 -0
  56. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/ci/environment.yml +0 -0
  57. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/ci/upstream-dev-env.yml +0 -0
  58. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/codecov.yml +0 -0
  59. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/2D_bounds_averaged.png +0 -0
  60. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/2D_bounds_error.png +0 -0
  61. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/2D_bounds_nonunique.png +0 -0
  62. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/Makefile +0 -0
  63. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/_static/dataset-diagram-logo.tex +0 -0
  64. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/_static/full-logo.png +0 -0
  65. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/_static/logo.png +0 -0
  66. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/_static/logo.svg +0 -0
  67. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/_static/rich-repr-example.png +0 -0
  68. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/_static/style.css +0 -0
  69. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/api.rst +0 -0
  70. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/bounds.md +0 -0
  71. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/cartopy_rotated_pole.png +0 -0
  72. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/coding.md +0 -0
  73. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/conf.py +0 -0
  74. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/contributing.rst +0 -0
  75. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/coord_axes.md +0 -0
  76. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/custom-criteria.md +0 -0
  77. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/dsg.md +0 -0
  78. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/examples/introduction.ipynb +0 -0
  79. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/faq.md +0 -0
  80. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/flags.md +0 -0
  81. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/geometry.md +0 -0
  82. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/grid_mappings.md +0 -0
  83. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/howtouse.md +0 -0
  84. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/index.rst +0 -0
  85. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/make.bat +0 -0
  86. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/parametricz.md +0 -0
  87. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/plotting.md +0 -0
  88. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/provenance.md +0 -0
  89. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/quickstart.md +0 -0
  90. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/roadmap.rst +0 -0
  91. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/selecting.md +0 -0
  92. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/sgrid_ugrid.md +0 -0
  93. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/units.md +0 -0
  94. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/doc/whats-new.rst +0 -0
  95. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/pyproject.toml +0 -0
  96. {cf_xarray-0.10.3 → cf_xarray-0.10.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: cf_xarray
3
- Version: 0.10.3
3
+ Version: 0.10.5
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
@@ -229,6 +229,7 @@ Requires-Dist: shapely; extra == "all"
229
229
  Requires-Dist: regex; extra == "all"
230
230
  Requires-Dist: rich; extra == "all"
231
231
  Requires-Dist: pooch; extra == "all"
232
+ Dynamic: license-file
232
233
 
233
234
  .. image:: https://img.shields.io/static/v1.svg?logo=Jupyter&label=Pangeo+Binder&message=GCE+us-central1&color=blue&style=for-the-badge
234
235
  :target: https://binder.pangeo.io/v2/gh/xarray-contrib/cf-xarray/main?urlpath=lab
@@ -0,0 +1 @@
1
+ __version__ = "0.10.5"
@@ -26,8 +26,27 @@ import xarray as xr
26
26
  from xarray import DataArray, Dataset
27
27
  from xarray.core.groupby import GroupBy
28
28
  from xarray.core.resample import Resample
29
- from xarray.core.rolling import Coarsen, Rolling
30
- from xarray.core.weighted import Weighted
29
+
30
+ try:
31
+ from xarray.core.rolling import ( # type:ignore[import-not-found,no-redef,unused-ignore]
32
+ Coarsen,
33
+ Rolling,
34
+ )
35
+ except ImportError:
36
+ from xarray.computation.rolling import ( # type:ignore[import-not-found,no-redef,unused-ignore]
37
+ Coarsen,
38
+ Rolling,
39
+ )
40
+
41
+ try:
42
+ from xarray.core.weighted import (
43
+ Weighted, # type:ignore[import-not-found,no-redef,unused-ignore]
44
+ )
45
+ except ImportError:
46
+ from xarray.computation.weighted import ( # type:ignore[import-not-found,no-redef,unused-ignore]
47
+ Weighted,
48
+ )
49
+
31
50
 
32
51
  from . import parametric, sgrid
33
52
  from .criteria import (
@@ -2,11 +2,12 @@ from dataclasses import dataclass
2
2
 
3
3
  import numpy as np
4
4
  import pandas as pd
5
- from xarray.groupers import EncodedGroups, UniqueGrouper
5
+ from xarray import Variable
6
+ from xarray.groupers import EncodedGroups, Grouper, UniqueGrouper
6
7
 
7
8
 
8
9
  @dataclass
9
- class FlagGrouper(UniqueGrouper):
10
+ class FlagGrouper(Grouper):
10
11
  """
11
12
  Grouper object that allows convenient categorical grouping by a CF flag variable.
12
13
 
@@ -23,12 +24,12 @@ class FlagGrouper(UniqueGrouper):
23
24
  values = np.array(group.attrs["flag_values"])
24
25
  full_index = pd.Index(group.attrs["flag_meanings"].split(" "))
25
26
 
26
- self.labels = values
27
+ grouper = UniqueGrouper(labels=values)
27
28
 
28
29
  # TODO: we could optimize here, since `group` is already factorized,
29
30
  # but there are subtleties. For example, the attrs must be up to date,
30
31
  # any value that is not in flag_values will cause an error, etc.
31
- ret = super().factorize(group)
32
+ ret = grouper.factorize(group)
32
33
 
33
34
  ret.codes.attrs.pop("flag_values")
34
35
  ret.codes.attrs.pop("flag_meanings")
@@ -36,5 +37,11 @@ class FlagGrouper(UniqueGrouper):
36
37
  return EncodedGroups(
37
38
  codes=ret.codes,
38
39
  full_index=full_index,
40
+ unique_coord=Variable(
41
+ dims=ret.codes.name, data=np.array(full_index), attrs=ret.codes.attrs
42
+ ),
39
43
  group_indices=ret.group_indices,
40
44
  )
45
+
46
+ def reset(self):
47
+ raise NotImplementedError()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: cf_xarray
3
- Version: 0.10.3
3
+ Version: 0.10.5
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
@@ -229,6 +229,7 @@ Requires-Dist: shapely; extra == "all"
229
229
  Requires-Dist: regex; extra == "all"
230
230
  Requires-Dist: rich; extra == "all"
231
231
  Requires-Dist: pooch; extra == "all"
232
+ Dynamic: license-file
232
233
 
233
234
  .. image:: https://img.shields.io/static/v1.svg?logo=Jupyter&label=Pangeo+Binder&message=GCE+us-central1&color=blue&style=for-the-badge
234
235
  :target: https://binder.pangeo.io/v2/gh/xarray-contrib/cf-xarray/main?urlpath=lab
@@ -1 +0,0 @@
1
- __version__ = "0.10.3"
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
File without changes
File without changes