xeofs 2.3.1__tar.gz → 2.3.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 (47) hide show
  1. {xeofs-2.3.1 → xeofs-2.3.2}/PKG-INFO +2 -2
  2. {xeofs-2.3.1 → xeofs-2.3.2}/pyproject.toml +2 -2
  3. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/_base_cross_model.py +6 -0
  4. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/_base_model.py +5 -0
  5. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/transformer.py +9 -4
  6. {xeofs-2.3.1 → xeofs-2.3.2}/LICENSE +0 -0
  7. {xeofs-2.3.1 → xeofs-2.3.2}/README.md +0 -0
  8. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/__init__.py +0 -0
  9. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/_version.py +0 -0
  10. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/data_container/__init__.py +0 -0
  11. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/data_container/data_container.py +0 -0
  12. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/__init__.py +0 -0
  13. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/cca.py +0 -0
  14. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/decomposer.py +0 -0
  15. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/eeof.py +0 -0
  16. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/eof.py +0 -0
  17. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/eof_rotator.py +0 -0
  18. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/gwpca.py +0 -0
  19. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/mca.py +0 -0
  20. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/mca_rotator.py +0 -0
  21. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/opa.py +0 -0
  22. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/models/rotator_factory.py +0 -0
  23. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/__init__.py +0 -0
  24. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/concatenator.py +0 -0
  25. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/dimension_renamer.py +0 -0
  26. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/list_processor.py +0 -0
  27. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/multi_index_converter.py +0 -0
  28. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/preprocessor.py +0 -0
  29. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/sanitizer.py +0 -0
  30. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/scaler.py +0 -0
  31. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/preprocessing/stacker.py +0 -0
  32. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/__init__.py +0 -0
  33. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/constants.py +0 -0
  34. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/data_types.py +0 -0
  35. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/dimension_renamer.py +0 -0
  36. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/distance_metrics.py +0 -0
  37. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/hilbert_transform.py +0 -0
  38. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/io.py +0 -0
  39. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/kernels.py +0 -0
  40. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/numba_utils.py +0 -0
  41. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/rotation.py +0 -0
  42. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/sanity_checks.py +0 -0
  43. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/statistics.py +0 -0
  44. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/utils/xarray_utils.py +0 -0
  45. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/validation/__init__.py +0 -0
  46. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/validation/_base_bootstrapper.py +0 -0
  47. {xeofs-2.3.1 → xeofs-2.3.2}/xeofs/validation/bootstrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xeofs
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis
5
5
  Home-page: https://github.com/xarray-contrib/xeofs
6
6
  License: MIT
@@ -22,7 +22,7 @@ Requires-Dist: scikit-learn (>=1.0.2,<2.0.0)
22
22
  Requires-Dist: statsmodels (>=0.14.0,<0.15.0)
23
23
  Requires-Dist: tqdm (>=4.64.0,<5.0.0)
24
24
  Requires-Dist: typing-extensions (>=4.8.0,<5.0.0)
25
- Requires-Dist: xarray (<=2023.12)
25
+ Requires-Dist: xarray (>=2023)
26
26
  Requires-Dist: xarray-datatree (>=0.0.5)
27
27
  Requires-Dist: zarr (>=2.0.0,<3.0.0)
28
28
  Project-URL: Documentation, https://xeofs.readthedocs.io/en/latest/
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "xeofs"
3
- version = "2.3.1"
3
+ version = "2.3.2"
4
4
  description = "Comprehensive EOF analysis in Python with xarray: A versatile, multidimensional, and scalable tool for advanced climate data analysis"
5
5
  authors = ["Niclas Rieger <niclasrieger@gmail.com>", "Samuel J. Levang <slevang@gmail.com>"]
6
6
  license = "MIT"
@@ -14,7 +14,7 @@ python = ">=3.10,<3.12"
14
14
  poetry = "^1.6"
15
15
  numpy = "^1.24"
16
16
  pandas = "^2"
17
- xarray = "<=2023.12"
17
+ xarray = ">=2023"
18
18
  scikit-learn = "^1.0.2"
19
19
  pooch = "^1.6.0"
20
20
  tqdm = "^4.64.0"
@@ -248,6 +248,12 @@ class _BaseCrossModel(ABC):
248
248
  Reconstructed data of right field.
249
249
 
250
250
  """
251
+ # Handle scalar mode in xr.dot
252
+ if "mode" not in scores1.dims:
253
+ scores1 = scores1.expand_dims("mode")
254
+ if "mode" not in scores2.dims:
255
+ scores2 = scores2.expand_dims("mode")
256
+
251
257
  data1, data2 = self._inverse_transform_algorithm(scores1, scores2)
252
258
 
253
259
  # Unstack and rescale the data
@@ -305,6 +305,11 @@ class _BaseModel(ABC):
305
305
  if normalized:
306
306
  norms = self.data["norms"].sel(mode=scores.mode)
307
307
  scores = scores * norms
308
+
309
+ # Handle scalar mode in xr.dot
310
+ if "mode" not in scores.dims:
311
+ scores = scores.expand_dims("mode")
312
+
308
313
  data_reconstructed = self._inverse_transform_algorithm(scores)
309
314
 
310
315
  # Reconstructing the data using a single mode introduces a
@@ -96,14 +96,19 @@ class Transformer(BaseEstimator, TransformerMixin, ABC):
96
96
  ds = data
97
97
  else:
98
98
  # Convert DataArray to Dataset
99
+ coords = {}
100
+ data_vars = {}
99
101
  if data.name in data.coords:
100
102
  # Convert a coord-like DataArray to Dataset and note multiindexes
101
103
  if isinstance(data.to_index(), pd.MultiIndex):
102
104
  multiindexes[data.name] = [n for n in data.to_index().names]
103
- # Make sure the DataArray has some name so we can create a string mapping
104
- elif data.name is None:
105
- data.name = key
106
- ds = xr.Dataset(data_vars={data.name: data})
105
+ coords[data.name] = data
106
+ else:
107
+ # Make sure the DataArray has some name so we can create a string mapping
108
+ if data.name is None:
109
+ data.name = key
110
+ data_vars[data.name] = data
111
+ ds = xr.Dataset(data_vars=data_vars, coords=coords)
107
112
  name_map = data.name
108
113
 
109
114
  # Drop multiindexes and record for later
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