Skip to content

Pretty _repr_html_ of cube dimension metadata - #955

Draft
soxofaan wants to merge 11 commits into
masterfrom
issue827-cube-metadata-viz
Draft

soxofaan wants to merge 11 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

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 Outdated
Comment thread openeo/metadata/_jupyter.py
Comment thread openeo/utils/datetime.py Outdated
Comment thread openeo/utils/datetime.py
Comment thread openeo/metadata/__init__.py
Comment thread openeo/metadata/_extents.py Outdated
Comment thread openeo/rest/vectorcube.py
@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

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 Outdated
Comment thread openeo/metadata/__init__.py
@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

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 Outdated
Comment thread openeo/metadata/__init__.py Outdated
Comment thread openeo/utils/datetime.py
Comment thread openeo/utils/datetime.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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 Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The rendering and temporal metadata behavior are consistently implemented and covered by focused tests.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@soxofaan
soxofaan force-pushed the issue827-cube-metadata-viz branch from 48dac2c to 5d6157c Compare October 13, 2026 07:40
@soxofaan soxofaan self-assigned this Oct 13, 2026
soxofaan added a commit that referenced this pull request Oct 15, 2026
soxofaan added a commit that referenced this pull request Oct 15, 2026
(re)group test functions in relevant test classes
for better overview and easier future evolution

refs #949 #827 #955
@soxofaan
soxofaan marked this pull request as draft October 15, 2026 13:53
@soxofaan
soxofaan requested a balanced review from Copilot October 16, 2026 12:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Supported unnamed STAC bands cause the new notebook renderer to raise TypeError.

1 open finding

🧠 Review effort: Balanced

Comment thread openeo/metadata/_jupyter.py Outdated
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
@soxofaan
soxofaan force-pushed the issue827-cube-metadata-viz branch from 2c9608e to 1cb1141 Compare October 16, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Spatial metadata propagation has correctness regressions, and existing REST test expectations remain incompatible with the new representation.

5 open findings
1 resolved since last review

🧠 Review effort: Balanced

def spatial_dimensions(self) -> SpatialDimensionsXY:
if not self.has_spatial_dimensions():
raise MetadataException("No spatial dimensions")
return self._spatial_dimensions
Comment on lines +151 to +152
if isinstance(extent, dict) and {"west", "east", "south", "north"}.issubset(extent):
bbox = BBoxDict.from_dict(extent)
bbox_crs = bbox.get("crs", SpatialDimension.DEFAULT_CRS)
if bbox_crs == self.x.crs and bbox_crs == self.y.crs:
# No reprojection needed
extent_x = bbox["west"], bbox["east"]

def filter_bbox(self, extent: Any) -> CubeMetadata:
if self._dimensions and isinstance(self._spatial_dimensions, SpatialDimensionsXY):
spatial_dimensions: SpatialDimensionsXY = self._spatial_dimensions.filter_bbox(extent=extent)
Comment thread openeo/rest/datacube.py
Comment on lines +516 to +517
if metadata and spatial_extent:
metadata = metadata.filter_bbox(extent=spatial_extent)

This branch has not been deployed

No deployments
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.

2 participants