Skip to content

Commit

Permalink
fix: crs being lost on fit_curve (#156)
Browse files Browse the repository at this point in the history
fix crs being lost on fit_curve
  • Loading branch information
LukeWeidenwalker authored Aug 28, 2023
1 parent c144653 commit 406c306
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def _wrap(*args, **kwargs):
)

fit_result.attrs = data.attrs
fit_result = fit_result.rio.write_crs(rechunked_data.rio.crs)

return fit_result

Expand Down
2 changes: 2 additions & 0 deletions tests/test_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def fitFunction(x, parameters):
)
assert len(result.param) == 3
assert isinstance(result.data, dask.array.Array)
assert result.rio.crs == origin_cube.rio.crs

assert len(result.coords["bands"]) == len(origin_cube.coords["bands"])
assert len(result.coords["x"]) == len(origin_cube.coords["x"])
Expand All @@ -92,3 +93,4 @@ def fitFunction(x, parameters):

assert len(predictions.coords[origin_cube.openeo.temporal_dims[0]]) == len(labels)
assert "param" not in predictions.dims
assert result.rio.crs == predictions.rio.crs

0 comments on commit 406c306

Please sign in to comment.