xeofs 2.2.5__tar.gz → 2.2.6__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.2.5 → xeofs-2.2.6}/PKG-INFO +1 -1
  2. {xeofs-2.2.5 → xeofs-2.2.6}/pyproject.toml +1 -1
  3. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/_base_model.py +10 -3
  4. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/eof.py +3 -3
  5. {xeofs-2.2.5 → xeofs-2.2.6}/LICENSE +0 -0
  6. {xeofs-2.2.5 → xeofs-2.2.6}/README.md +0 -0
  7. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/__init__.py +0 -0
  8. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/_version.py +0 -0
  9. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/data_container/__init__.py +0 -0
  10. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/data_container/data_container.py +0 -0
  11. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/__init__.py +0 -0
  12. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/_base_cross_model.py +0 -0
  13. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/cca.py +0 -0
  14. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/decomposer.py +0 -0
  15. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/eeof.py +0 -0
  16. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/eof_rotator.py +0 -0
  17. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/gwpca.py +0 -0
  18. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/mca.py +0 -0
  19. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/mca_rotator.py +0 -0
  20. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/opa.py +0 -0
  21. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/models/rotator_factory.py +0 -0
  22. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/__init__.py +0 -0
  23. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/concatenator.py +0 -0
  24. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/dimension_renamer.py +0 -0
  25. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/list_processor.py +0 -0
  26. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/multi_index_converter.py +0 -0
  27. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/preprocessor.py +0 -0
  28. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/sanitizer.py +0 -0
  29. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/scaler.py +0 -0
  30. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/stacker.py +0 -0
  31. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/preprocessing/transformer.py +0 -0
  32. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/__init__.py +0 -0
  33. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/constants.py +0 -0
  34. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/data_types.py +0 -0
  35. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/dimension_renamer.py +0 -0
  36. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/distance_metrics.py +0 -0
  37. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/hilbert_transform.py +0 -0
  38. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/io.py +0 -0
  39. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/kernels.py +0 -0
  40. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/numba_utils.py +0 -0
  41. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/rotation.py +0 -0
  42. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/sanity_checks.py +0 -0
  43. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/statistics.py +0 -0
  44. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/utils/xarray_utils.py +0 -0
  45. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/validation/__init__.py +0 -0
  46. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/validation/_base_bootstrapper.py +0 -0
  47. {xeofs-2.2.5 → xeofs-2.2.6}/xeofs/validation/bootstrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xeofs
3
- Version: 2.2.5
3
+ Version: 2.2.6
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "xeofs"
3
- version = "2.2.5"
3
+ version = "2.2.6"
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"
@@ -283,13 +283,13 @@ class _BaseModel(ABC):
283
283
  return self.fit(data, dim, weights).transform(data, **kwargs)
284
284
 
285
285
  def inverse_transform(
286
- self, scores: DataObject, normalized: bool = True
286
+ self, scores: DataArray, normalized: bool = True
287
287
  ) -> DataObject:
288
288
  """Reconstruct the original data from transformed data.
289
289
 
290
290
  Parameters
291
291
  ----------
292
- scores: DataObject
292
+ scores: DataArray
293
293
  Transformed data to be reconstructed. This could be a subset
294
294
  of the `scores` data of a fitted model, or unseen data. Must
295
295
  have a 'mode' dimension.
@@ -303,8 +303,15 @@ class _BaseModel(ABC):
303
303
 
304
304
  """
305
305
  if normalized:
306
- scores = scores * self.data["norms"]
306
+ norms = self.data["norms"].sel(mode=scores.mode)
307
+ scores = scores * norms
307
308
  data_reconstructed = self._inverse_transform_algorithm(scores)
309
+
310
+ # Reconstructing the data using a single mode introduces a
311
+ # redundant "mode" coordinate
312
+ if "mode" in data_reconstructed.coords:
313
+ data_reconstructed = data_reconstructed.drop_vars("mode")
314
+
308
315
  return self.preprocessor.inverse_transform_data(data_reconstructed)
309
316
 
310
317
  @abstractmethod
@@ -128,12 +128,12 @@ class EOF(_BaseModel):
128
128
 
129
129
  return projections
130
130
 
131
- def _inverse_transform_algorithm(self, scores: DataObject) -> DataArray:
131
+ def _inverse_transform_algorithm(self, scores: DataArray) -> DataArray:
132
132
  """Reconstruct the original data from transformed data.
133
133
 
134
134
  Parameters
135
135
  ----------
136
- scores: DataObject
136
+ scores: DataArray
137
137
  Transformed data to be reconstructed. This could be a subset
138
138
  of the `scores` data of a fitted model, or unseen data. Must
139
139
  have a 'mode' dimension.
@@ -147,7 +147,7 @@ class EOF(_BaseModel):
147
147
  # Reconstruct the data
148
148
  comps = self.data["components"].sel(mode=scores.mode)
149
149
 
150
- reconstructed_data = xr.dot(comps.conj(), scores)
150
+ reconstructed_data = xr.dot(comps.conj(), scores, dims="mode")
151
151
  reconstructed_data.name = "reconstructed_data"
152
152
 
153
153
  # Enforce real output
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