diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b9a79b8..52e68ec4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks +default_language_version: + python: python3 repos: - repo: https://github.com/asottile/pyupgrade rev: v3.10.1 diff --git a/openeo_processes_dask/process_implementations/cubes/resample.py b/openeo_processes_dask/process_implementations/cubes/resample.py index 1211cd97..d6037e3f 100644 --- a/openeo_processes_dask/process_implementations/cubes/resample.py +++ b/openeo_processes_dask/process_implementations/cubes/resample.py @@ -75,11 +75,11 @@ def resample_spatial( how=projection, resolution=resolution, resampling=method ) - if "longitude" in reprojected.dims and "x" in data.dims: - reprojected = reprojected.rename({"longitude": "x"}) + if reprojected.openeo.x_dim != data.openeo.x_dim: + reprojected = reprojected.rename({reprojected.openeo.x_dim: data.openeo.x_dim}) - if "latitude" in reprojected.dims and "y" in data.dims: - reprojected = reprojected.rename({"latitude": "y"}) + if reprojected.openeo.y_dim != data.openeo.y_dim: + reprojected = reprojected.rename({reprojected.openeo.y_dim: data.openeo.y_dim}) reprojected.attrs["crs"] = data_cp.rio.crs