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

merge_cubes: merge metadata even without band_dimensions

Open
#783 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug low hanging fruit
Dominant language
Python
Stars
217
Forks
56
Avg merge
1d 22h
Merged PRs (30d)
2

Description

related code:
https://github.com/Open-EO/openeo-python-client/blob/77c3e87e44a199949306d230339a92863c96de40/openeo/rest/datacube.py#L2210-L2224

Currently if one or both of the cubes have missing band data the resulting metadata is set to None.
Suggested approaches:

  1. cube1 has bands and cube2 has bands -> current implementation
  2. cube1 has bands but cube2 has no bands -> take over bands of cube1 (cube2 will be merged with overlap on all bands)
  3. cube1 has no bands but cube 2 has bands -> See step 2 I think
  4. both have no bands -> use metadata from first cube

If one of both cubes has none as metadata I think it is still safer to put the result to none as well

In a better scenario the extents of all dimensions are merged but that might be the scope of a separate issue rather than include it in this one.

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 in openeo/rest/datacube.py at lines 2210-2224 and inspect the merge_cubes entry point. Trace how band_dimensions and metadata are handled for each of the four band-availability cases, while preserving None metadata when either input has None metadata. Done means the resulting metadata follows the stated cases without attempting the separate extent-merging scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.