Skip to content

Commit

Permalink
Added uniqueness contraints and clarified DimensionNotAvailable excep…
Browse files Browse the repository at this point in the history
…tion in temporal aggregations
  • Loading branch information
m-mohr committed Dec 22, 2023
1 parent ad8a2f3 commit 4274215
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- `clip`: Throw an exception if min > max [#472](https://github.com/Open-EO/openeo-processes/issues/472)
- Added a uniqueness contraint to various array-typed parameters (e.g. lists of dimension names or labels)

### Fixed

- Clarified for various mathematical functions the defined input and output ranges. Mention that `NaN` is returned outside of the defined input range where possible.
- `aggregate_temporal` and `aggregate_temporal_period`: Clarified that the process throws a `DimensionNotAvailable` exception when no temporal dimension exists.
- `divide`: Clarified behavior for division by 0
- `between`: Clarify that `null` is passed through.
- `eq` and `neq`: Explicitly set the minimum value for the `delta` parameter.
Expand Down
5 changes: 3 additions & 2 deletions aggregate_temporal.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
"description": "Distinct labels for the intervals, which can contain dates and/or times. Is only required to be specified if the values for the start of the temporal intervals are not distinct and thus the default labels would not be unique. The number of labels and the number of groups need to be equal.",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": [
"number",
Expand All @@ -140,7 +141,7 @@
},
{
"name": "dimension",
"description": "The name of the temporal dimension for aggregation. All data along the dimension is passed through the specified reducer. If the dimension is not set or set to `null`, the data cube is expected to only have one temporal dimension. Fails with a `TooManyDimensions` exception if it has more dimensions. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist.",
"description": "The name of the temporal dimension for aggregation. All data along the dimension is passed through the specified reducer. If the dimension is not set or set to `null`, the data cube is expected to only have one temporal dimension. Fails with a `TooManyDimensions` exception if it has more dimensions. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist or no temporal dimension is available.",
"schema": {
"type": [
"string",
Expand Down Expand Up @@ -228,7 +229,7 @@
"message": "The data cube contains multiple temporal dimensions. The parameter `dimension` must be specified."
},
"DimensionNotAvailable": {
"message": "A dimension with the specified name does not exist."
"message": "A dimension with the specified name does not exist or no temporal dimension is available."
},
"DistinctDimensionLabelsRequired": {
"message": "The dimension labels have duplicate values. Distinct labels must be specified."
Expand Down
4 changes: 2 additions & 2 deletions aggregate_temporal_period.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
},
{
"name": "dimension",
"description": "The name of the temporal dimension for aggregation. All data along the dimension is passed through the specified reducer. If the dimension is not set or set to `null`, the source data cube is expected to only have one temporal dimension. Fails with a `TooManyDimensions` exception if it has more dimensions. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist.",
"description": "The name of the temporal dimension for aggregation. All data along the dimension is passed through the specified reducer. If the dimension is not set or set to `null`, the source data cube is expected to only have one temporal dimension. Fails with a `TooManyDimensions` exception if it has more dimensions. Fails with a `DimensionNotAvailable` exception if the specified dimension does not exist or no temporal dimension is available.",
"schema": {
"type": [
"string",
Expand Down Expand Up @@ -115,7 +115,7 @@
"message": "The data cube contains multiple temporal dimensions. The parameter `dimension` must be specified."
},
"DimensionNotAvailable": {
"message": "A dimension with the specified name does not exist."
"message": "A dimension with the specified name does not exist or no temporal dimension is available."
},
"DistinctDimensionLabelsRequired": {
"message": "The dimension labels have duplicate values. Distinct labels must be specified."
Expand Down
3 changes: 2 additions & 1 deletion proposals/array_create_labeled.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"description": "An array of labels to be used.",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": [
"number",
Expand All @@ -43,4 +44,4 @@
"message": "The number of values in the parameters `data` and `labels` don't match."
}
}
}
}
1 change: 1 addition & 0 deletions proposals/flatten_dimensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"description": "The names of the dimension to combine. The order of the array defines the order in which the dimension labels and values are combined (see the example in the process description). Fails with a `DimensionNotAvailable` exception if at least one of the specified dimensions does not exist.",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
Expand Down
1 change: 1 addition & 0 deletions proposals/predict_curve.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
},
{
"type": "array",
"uniqueItems": true,
"items": {
"anyOf": [
{
Expand Down
1 change: 1 addition & 0 deletions proposals/unflatten_dimension.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"description": "The names of the new target dimensions. New dimensions will be created with the given names and type `other` (see ``add_dimension()``). Fails with a `TargetDimensionExists` exception if any of the dimensions exists.\n\nThe order of the array defines the order in which the dimensions and dimension labels are added to the data cube (see the example in the process description).",
"schema": {
"type": "array",
"uniqueItems": true,
"minItems": 2,
"items": {
"type": "string"
Expand Down
2 changes: 2 additions & 0 deletions rename_labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"description": "The new names for the labels.\n\nIf a target dimension label already exists in the data cube, a `LabelExists` exception is thrown.",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": [
"number",
Expand All @@ -39,6 +40,7 @@
"description": "The original names of the labels to be renamed to corresponding array elements in the parameter `target`. It is allowed to only specify a subset of labels to rename, as long as the `target` and `source` parameter have the same length. The order of the labels doesn't need to match the order of the dimension labels in the data cube. By default, the array is empty so that the dimension labels in the data cube are expected to be enumerated.\n\nIf the dimension labels are not enumerated and the given array is empty, the `LabelsNotEnumerated` exception is thrown. If one of the source dimension labels doesn't exist, the `LabelNotAvailable` exception is thrown.",
"schema": {
"type": "array",
"uniqueItems": true,
"items": {
"type": [
"number",
Expand Down

0 comments on commit 4274215

Please sign in to comment.