-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add more robust version of ndvi #147
Conversation
Codecov Report
@@ Coverage Diff @@
## main #147 +/- ##
==========================================
+ Coverage 75.81% 78.80% +2.99%
==========================================
Files 26 27 +1
Lines 1170 1175 +5
==========================================
+ Hits 887 926 +39
+ Misses 283 249 -34
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@clausmichele could use a review from you on this if you have time! :) |
Or @ValentinaHutter now that she's back! :) |
if target_band is not None: | ||
if target_band in data.coords: | ||
raise BandExists("A band with the specified target name exists.") | ||
nd = nd.assign_coords(bands=target_band).expand_dims(target_band) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this only works if band_dim is actually called "bands".
See https://processes.openeo.org/#ndvi under
Return Value:
target_band is a string: The data cube keeps the same dimensions. The dimension properties remain unchanged, but the number of dimension labels for the dimension of type bands increases by one. The additional label is named as specified in target_band.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch, have updated this to work slightly differently! :)
LGTM! just some minor comments - maybe also add a test to check if the target_band label is set correctly in the band_dim. |
Co-authored-by: ValentinaHutter <85164505+ValentinaHutter@users.noreply.github.com>
closes #126