Skip to content
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

Merged
merged 7 commits into from
Aug 1, 2023
Merged

fix: add more robust version of ndvi #147

merged 7 commits into from
Aug 1, 2023

Conversation

LukeWeidenwalker
Copy link
Contributor

@LukeWeidenwalker LukeWeidenwalker commented Jul 28, 2023

closes #126

@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #147 (9bae349) into main (d60a286) will increase coverage by 2.99%.
The diff coverage is 100.00%.

@@            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     
Files Changed Coverage Δ
...neo_processes_dask/process_implementations/math.py 59.86% <ø> (+10.96%) ⬆️
...ses_dask/process_implementations/cubes/__init__.py 100.00% <100.00%> (ø)
...sses_dask/process_implementations/cubes/indices.py 100.00% <100.00%> (ø)
...ocesses_dask/process_implementations/exceptions.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@LukeWeidenwalker
Copy link
Contributor Author

@clausmichele could use a review from you on this if you have time! :)

@LukeWeidenwalker
Copy link
Contributor Author

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)
Copy link
Collaborator

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.

Copy link
Contributor Author

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! :)

@ValentinaHutter
Copy link
Collaborator

LGTM! just some minor comments - maybe also add a test to check if the target_band label is set correctly in the band_dim.

LukeWeidenwalker and others added 4 commits August 1, 2023 11:52
Co-authored-by: ValentinaHutter <85164505+ValentinaHutter@users.noreply.github.com>
@LukeWeidenwalker LukeWeidenwalker merged commit dfee6f6 into main Aug 1, 2023
5 checks passed
@LukeWeidenwalker LukeWeidenwalker deleted the fix-ndvi branch August 1, 2023 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NDVI process bugs
2 participants