Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Better handling of "cube math" like `cube1 / cube2`

Abierto
#748 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@soxofaan ya está trabajando en esto.

Desde el 10/3/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

api compliancy bug feature request technical debt usability

The python client has since long a compelling "band math" feature, e.g.:

red = s2cube.band("B04")
nir = s2cube.band("B08")
ndvi = (nir - red) / (nir + red)

which is translated to a reduce_dimension along band dimension with the appropriate reducer.

User however also naively try to use these kind of math expressions without using the .band() method, e.g.:

cube3 = cube1 / cube2

Which kind of works: it will produce a merge_cubes operation with an overlap resolver set to "divide" in this case.
As discussed in https://github.com/Open-EO/openeo-processes/issues/280 this is unfortunately a dangerous approach because it will give unexpected results in situations without 100% overlap

Alternative approach: use merge_cubes without overlap resolver to "stack" bands of both cubes in a single cube and do apply_dimension to combine the bands as desired to a new cube. This would involve quite a bit more steps, but will result in more correct calculation:

  • before merge: rename bands to ensure 0 overlap. Also: if there are no bands yet: make sure there are
  • merge_cubes explicitly without overlap resolver to make sure bands are stacked
  • use apply_dimension (or maybe reduce_dimension in some cases) to implement the desired operation
  • remame bands again to what the user expects

Quite vital to get this working is that band name handling is correct and in line with how it works backend-side. This might be a bit challenging with load_stac use cases where band detection can be a bit fuzzy.

other related issues:

Lenguaje dominante
Python
Estrellas
219
Forks
56
Merge medio
2 d 21 h
PR fusionados (30 d)
9

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Open-EO/openeo-python-client

Todos los issues de Open-EO/openeo-python-client

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.