Skip to content

Commit

Permalink
Fix: Apply dim exceptions (#218)
Browse files Browse the repository at this point in the history
* Fix: dimension names wrong if dimension is only 1 long, crs not being written in edge case.

* Bump Version, add joblib dependency

* remove joblib dep

* Fix: test cases

---------

Co-authored-by: Gerald Walter Irsiegler <gerald@Irsiegler-P14s>
  • Loading branch information
GeraldIr and Gerald Walter Irsiegler authored Jan 22, 2024
1 parent ac50509 commit ca3226a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions openeo_processes_dask/process_implementations/cubes/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ def apply_dimension(
{dimension: target_dimension}
)

if len(data[dimension]) == len(reordered_result[target_dimension]):
reordered_result.rio.write_crs(data.rio.crs, inplace=True)
if len(reordered_result[target_dimension]) == 1:
reordered_result[target_dimension] = ["0"]

if data.rio.crs is not None:
try:
reordered_result.rio.write_crs(data.rio.crs, inplace=True)
except ValueError:
pass

if is_new_dim_added:
reordered_result.openeo.add_dim_type(name=target_dimension, type="other")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openeo-processes-dask"
version = "2023.11.6"
version = "2024.1.1"
description = "Python implementations of many OpenEO processes, dask-friendly by default."
authors = ["Lukas Weidenholzer <[email protected]>", "Sean Hoyal <[email protected]>", "Valentina Hutter <[email protected]>"]
maintainers = ["EODC Staff <[email protected]>"]
Expand Down

0 comments on commit ca3226a

Please sign in to comment.