Skip to content

Pretty _repr_html_ of cube dimension metadata - #955

Merged
soxofaan merged 15 commits into
masterfrom
issue827-cube-metadata-viz
Oct 29, 2026
Merged

soxofaan merged 15 commits into
masterfrom
issue827-cube-metadata-viz

Conversation

@soxofaan

@soxofaan soxofaan commented Oct 9, 2026

Copy link
Copy Markdown
Member

for #827

@soxofaan
soxofaan force-pushed the issue827-cube-metadata-viz branch from c24bb72 to fbbf322 Compare October 9, 2026 13:01
@soxofaan

soxofaan commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

Current state of the visualization (just table for now):

image

note that the temporal and spatial extents are still the unfiltered extents of the original collection, instead of the actual cube extents

@soxofaan soxofaan changed the title Rudimentary _repr_html_ of cube dimension metadata Pretty _repr_html_ of cube dimension metadata Oct 9, 2026
@soxofaan
soxofaan requested a balanced review from Copilot October 9, 2026 21:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Temporal extent handling and HTML rendering contain runtime failures for supported metadata and open-ended intervals.

7 open findings
What changed in this PR

Adds richer Jupyter rendering for cube metadata, addressing #827, while tracking temporal extents through filtering operations.

Changes:

  • Adds HTML dimension tables to raster and vector cube representations.
  • Introduces temporal interval intersection and extent markers.
  • Adds rendering tests and a changelog entry.
File Description
CHANGELOG.md Documents the Jupyter representation.
openeo/​dates.py Adds datetime migration note.
openeo/​metadata/​__init__.py Adds rendering and temporal filtering.
openeo/​metadata/​_extents.py Defines special extent markers.
openeo/​metadata/​_jupyter.py Renders dimension metadata tables.
openeo/​rest/​_datacube.py Names process-graph HTML output.
openeo/​rest/​datacube.py Combines metadata and graph rendering.
openeo/​rest/​vectorcube.py Adds metadata rendering to vector cubes.
openeo/​util.py Adds datetime migration notes.
openeo/​utils/​datetime.py Implements datetime intervals.
tests/​metadata/​test_jupyter.py Tests table rendering.
tests/​metadata/​test_metadata.py Tests metadata HTML output.
tests/​rest/​datacube/​test_datacube.py Tests cube HTML composition.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread openeo/metadata/__init__.py Resolved
Comment thread openeo/metadata/_jupyter.py Resolved
Comment thread openeo/utils/datetime.py Resolved
Comment thread openeo/utils/datetime.py Resolved
Comment thread openeo/metadata/__init__.py Resolved
Comment thread openeo/metadata/_extents.py Resolved
Comment thread openeo/rest/vectorcube.py Resolved
@soxofaan
soxofaan force-pushed the issue827-cube-metadata-viz branch from 54f4316 to 9b9f13f Compare October 12, 2026 10:19
@soxofaan
soxofaan requested a balanced review from Copilot October 12, 2026 10:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread openeo/utils/datetime.py Resolved
Comment thread openeo/metadata/__init__.py Resolved
@soxofaan
soxofaan force-pushed the issue827-cube-metadata-viz branch 2 times, most recently from 281ce2b to a2ab17a Compare October 12, 2026 13:16
@soxofaan
soxofaan requested a balanced review from Copilot October 12, 2026 13:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Half-open temporal filters can currently produce a non-empty metadata extent when the query contains no matching instants.

5 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread openeo/metadata/__init__.py Resolved
Comment thread openeo/metadata/__init__.py Resolved
Comment thread openeo/utils/datetime.py Resolved
Comment thread openeo/utils/datetime.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Dynamic temporal bounds can raise errors, and successive filters lose exclusive-end semantics.

1 open finding
5 resolved since last review

🧠 Review effort: Balanced

Comment thread openeo/metadata/__init__.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Successive temporal filters lose end-exclusive semantics and can produce an incorrect non-empty extent.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced

Comment thread openeo/metadata/__init__.py Resolved
soxofaan added a commit that referenced this pull request Oct 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Public metadata API changes and cross-cutting extent propagation need final maintainer validation beyond the notebook-rendering feature.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@soxofaan

Copy link
Copy Markdown
Member Author

I think this PR is ready as MVP for #827 (did enough of iterating together with copilot)
but I'm going to wait to merge because of CDSE/Terrascope code freeze at the moment (client side metadata handling leaks through in openeo-python-driver and openeo-geopyspark-driver)

@soxofaan

Copy link
Copy Markdown
Member Author

screenshot of current state:
image

  • temporal dimension metadata is now more in line with specified temporal extent
  • spatial dimension metadata is marked as "non concrete" because given spatial extent is given in EPSG:4326, while original collection dimension metadata is in Auto42001, and current MVP does not yet implement simulation of how a backend would handle that (note for example that pyproj is not a required dep in client, so we need this fallback anyway)

Comment thread openeo/metadata/_extents.py Resolved
@soxofaan

Copy link
Copy Markdown
Member Author

@copilot can you collect and make an overview of all the "TODO" comments added/updated or handled in this PR?

Copilot AI commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@copilot can you collect and make an overview of all the "TODO" comments added/updated or handled in this PR?

I reviewed the PR diff and grouped its TODOs below.

Outstanding TODOs added/clarified by this work

  • openeo/metadata/__init__.py: make spatial axis required instead of inferring it from the dimension name (currently kept optional for compatibility); normalize concrete spatial extents to NumericalInterval; consider exposing crs as reference_system; support more bbox inputs/geometries; validate/normalize temporal extents without breaking the driver-facing API.
  • Spatial filtering/resampling: implement antimeridian-crossing handling and CRS reprojection. In particular, SpatialDimensionsXY.filter_bbox currently falls back to non-concrete extents for mismatched CRSs, and resample_spatial / resample_cube_spatial retain bounds without reprojection when the CRS changes. This is why the screenshot shows non-concrete x/y extents for an EPSG:4326 filter on Auto42001 metadata.
  • Parameterized values: consider replacing the sentinel singleton with a class and moving it to a reusable location.
  • tests/metadata/test_metadata.py: add proper antimeridian detection/handling coverage.

TODOs removed/handled

  • The previous TODO to support spatial-dimension handling in CubeMetadata was addressed by adding x/y metadata and bbox filtering.
  • The old STAC-alignment TODO about supporting an x/y axis was addressed by adding SpatialDimension.axis; a follow-up TODO remains to require it rather than guess.
  • The old note about blindly selecting the last band/temporal dimension was removed. Multiple dimensions now trigger a warning and the first is selected; user-selectable choice is still not implemented.

Moved rather than new work

  • The #738 real-STAC-request-mocking TODO and the collection/item asset-handling TODOs appear relocated with test reorganization, not completed by this PR.
  • The #465 date-utility-location TODO appears in date utility code and is unrelated to the metadata behavior.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the richer Jupyter displays and metadata extent-handling changes.

No open issues 🎉

Review effort: Balanced

Comment thread openeo/metadata/_jupyter.py Resolved
@soxofaan

Copy link
Copy Markdown
Member Author

iterated some more after reviewing with fresh mind after code freeze

illustration of current state:

image

improved since previous screenshot:

  • _NonConcreteExtent now has a reason, to make it easier to trace back where the non-concreteness comes from
  • with the COPERNICUS_30 example: spatial_extent is in same CRS as original dimension metadata, so extent of result cube is here concrete
  • temporal extent of the COPERNICUS_30 cube is outside the temporal extent of the collection, giving "empty" result: shown as _EmptyExtent

@soxofaan

Copy link
Copy Markdown
Member Author

wanting to merge this PR, but maybe best to first create a release of current master

Trying to keep all this into account:
- keep existing public API
- support for parameterized/dynamic `filter_temporal`
- handle empty temporal extent properly
- calculate real temporal intersection
- don't require metadata


refs #827, #949
(re)group test functions in relevant test classes
for better overview and easier future evolution

refs #949 #827 #955
Comment thread CHANGELOG.md Resolved
soxofaan and others added 10 commits October 29, 2026 13:45
…cubes with z dimension'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Normalize the dimension CRS (e.g. "EPSG:4326") before comparing it with
the bbox CRS, so equivalent CRS notations no longer fall back to a
non-concrete extent. Add `normalize_crs_or_passthrough` helper that
leaves unparseable CRS values untouched instead of raising.

ref #827 #955
to make user-facing occurrences more self-explanatory

ref #827 #955
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.

3 participants