Extend WebAPI to derive time series and statistics for datasets with multiple non-spatial dimensions #1213
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1213 +/- ##
==========================================
+ Coverage 89.53% 89.58% +0.05%
==========================================
Files 280 280
Lines 21655 21686 +31
==========================================
+ Hits 19389 19428 +39
+ Misses 2266 2258 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
forman
approved these changes
May 15, 2026
Comment on lines
+87
to
+92
| non_spatial_dimensions = get_non_spatial_dimensions( | ||
| self.ctx, self.request, datasetId, varName | ||
| ) | ||
| non_spatial_dimensions = { | ||
| k: v for k, v in non_spatial_dimensions.items() if k != "time" | ||
| } |
Member
There was a problem hiding this comment.
You could also enhance get_non_spatial_dimensions() by an opt. keyword argument excluded_dims: Iterable[str] | None = None to `. So the lines above would read:
Suggested change
| non_spatial_dimensions = get_non_spatial_dimensions( | |
| self.ctx, self.request, datasetId, varName | |
| ) | |
| non_spatial_dimensions = { | |
| k: v for k, v in non_spatial_dimensions.items() if k != "time" | |
| } | |
| non_spatial_dimensions = get_non_spatial_dimensions( | |
| self.ctx, self.request, datasetId, varName, excluded_dims=["time"], | |
| ) |
| if value is not None: | ||
| dimensions[str(dim)] = value | ||
|
|
||
| labels = get_non_spatial_labels(ds, variable, labels=dimensions, logger=_logger, ignore=["time"]) |
Member
There was a problem hiding this comment.
Oh, but it seems "time" is already excluded here!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends
webapito support deriving statistics and time series for variables that have more dimensions than justtime,lat, andlon.depth) when computing statistics and time series. Example request:timelabel. Now allnon_spatial_dimensionsare handled in the same way. If no explicit value is provided for a dimension, a value is selected automatically viaget_non_spatial_labels()-xcube.core.tile.get_non_spatial_labelschanged to a public function to support the default-value selection logicChecklist:
Add docstrings and API docs for any new/modified user-facing classes and functionsNew/modified features documented indocs/source/*CHANGES.md