Open-EO / Open-EO/openeo-python-client

Prevent "band math" like attempts with `filter_bands`

Open
#239 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

usability v1.0.0
Dominant language
Python
Stars
217
Forks
56
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Spin-off from https://github.com/Open-EO/openeo-python-client/issues/76#issuecomment-923896434 :

User might mistakenly use filter_bands() instead of bands() to do band math: e.g.

green = cube.filter_bands("green")
nir = cube.filter_bands("nir")
ndwi = (green - nir) / (green + nir)

This will currently be translated to 3 merge_cubes operations with an overlap resolver (one for each of the three math operators). Not only is this very inefficient, it will also give unexpected results.

We should raise error or warning if we detect this (doing math operation on filter_bands result)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with issue #239 and trace how filter_bands() results are represented and how arithmetic operators produce merge_cubes operations. Decide, with maintainers, whether the behavior should raise an error or warning, then verify that band-math attempts are detected without affecting valid operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.