Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds return value schemas for child processes #215

Merged
merged 6 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- New processes in proposal state
- `is_infinite`
- `nan`
- Added return value details (property `returns`) for the schemas with the subtype `process-graph`. [API#350](https://github.com/Open-EO/openeo-api/issues/350)
- `apply_neighborhood`: Clarify behavior for data cubes returned by the child processes and for that add the exception `DataCubePropertiesImmutable`.

### Changed
- Added `proposals` folder for experimental processes. Experimental processes are not covered by the CHANGELOG and MAY include breaking changes! [#196](https://github.com/Open-EO/openeo-processes/issues/196), [#207](https://github.com/Open-EO/openeo-processes/issues/207), [PSC#8](https://github.com/Open-EO/PSC/issues/8)
Expand Down
10 changes: 8 additions & 2 deletions aggregate_spatial.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the vector data cube.",
"schema": {
"description": "Any data type."
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
},
{
Expand All @@ -72,7 +78,7 @@
}
],
"returns": {
"description": "A vector data cube with the computed results and restricted to the bounds of the geometries.\n\nThe computed value is stored in dimension with the name that was specified in the parameter `target_dimension`.\n\nThe computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see ``is_valid()``) for each geometry. These values are stored as new dimension with a dimension name derived from `target_dimension` by adding the suffix `_meta`. The new dimension has the dimension labels `total_count` and `valid_count`.",
"description": "A vector data cube with the computed results and restricted to the bounds of the geometries.\n\nThe computed value is used for the dimension with the name that was specified in the parameter `target_dimension`.\n\nThe computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see ``is_valid()``) for each geometry. These values are added as new dimension with a dimension name derived from `target_dimension` by adding the suffix `_meta`. The new dimension has the dimension labels `total_count` and `valid_count`.",
"schema": {
"type": "object",
"subtype": "vector-cube"
Expand Down
10 changes: 8 additions & 2 deletions aggregate_temporal.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand Down Expand Up @@ -157,7 +163,7 @@
}
],
"returns": {
"description": "A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension.",
"description": "A new data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension.",
"schema": {
"type": "object",
"subtype": "raster-cube"
Expand Down
10 changes: 8 additions & 2 deletions aggregate_temporal_period.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand All @@ -88,7 +94,7 @@
}
],
"returns": {
"description": "A data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension. The specified temporal dimension has the following dimension labels (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `dekad`: `YYYY-00` - `YYYY-36`\n* `month`: `YYYY-01` - `YYYY-12`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).\n* `year`: `YYYY`\n* `decade`: `YYY0`\n* `decade-ad`: `YYY1`",
"description": "A new data cube with the same dimensions. The dimension properties (name, type, labels, reference system and resolution) remain unchanged, except for the resolution and dimension labels of the given temporal dimension. The specified temporal dimension has the following dimension labels (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `dekad`: `YYYY-00` - `YYYY-36`\n* `month`: `YYYY-01` - `YYYY-12`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).\n* `year`: `YYYY`\n* `decade`: `YYY0`\n* `decade-ad`: `YYY1`",
"schema": {
"type": "object",
"subtype": "raster-cube"
Expand Down
8 changes: 7 additions & 1 deletion apply.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion apply_dimension.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand Down
12 changes: 11 additions & 1 deletion apply_neighborhood.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The data cube with the newly computed values and the same dimensions. The dimension properties (name, type, labels, reference system and resolution) must remain unchanged, otherwise a `DataCubePropertiesImmutable` exception will be thrown.",
"schema": {
"type": "object",
"subtype": "raster-cube"
}
}
}
},
{
Expand Down Expand Up @@ -214,6 +221,9 @@
"exceptions": {
"DimensionNotAvailable": {
"message": "A dimension with the specified name does not exist."
},
"DataCubePropertiesImmutable": {
"message": "The dimension properties (name, type, labels, reference system and resolution) must remain unchanged."
}
}
}
8 changes: 7 additions & 1 deletion array_apply.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new array.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion array_contains.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
],
"returns": {
"description": "Returns `true` if the list contains the value, false` otherwise.",
"description": "`true` if the list contains the value, false` otherwise.",
"schema": {
"type": "boolean"
}
Expand Down
2 changes: 1 addition & 1 deletion array_element.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "array_element",
"summary": "Get an element from an array",
"description": "Returns the element with the specified index or label from the array.\n\nEither the parameter `index` or `label` must be specified, otherwise the `ArrayElementParameterMissing` exception is thrown. If both parameters are set the `ArrayElementParameterConflict` exception is thrown.",
"description": "Gives the element with the specified index or label from the array.\n\nEither the parameter `index` or `label` must be specified, otherwise the `ArrayElementParameterMissing` exception is thrown. If both parameters are set the `ArrayElementParameterConflict` exception is thrown.",
"categories": [
"arrays",
"reducer"
Expand Down
8 changes: 7 additions & 1 deletion array_filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "`true` if the value should be kept in the array, otherwise `false`.",
"schema": {
"type": "boolean"
}
}
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion array_find.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}
],
"returns": {
"description": "Returns the index of the first element with the specified value. If no element was found, `null` is returned.",
"description": "The index of the first element with the specified value. If no element was found, `null` is a.",
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
"schema": [
{
"type": "null"
Expand Down
2 changes: 1 addition & 1 deletion array_labels.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "array_labels",
"summary": "Get the labels for an array",
"description": "Returns all labels for a labeled array in the data cube. The labels have the same order as in the array.",
"description": "Gives all labels for a labeled array in the data cube. The labels have the same order as in the array.",
"categories": [
"arrays"
],
Expand Down
8 changes: 7 additions & 1 deletion count.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "`true` if the element should increase the counter, otherwise `false`.",
"schema": {
"type": "boolean"
}
}
},
{
"title": "All elements",
Expand Down
2 changes: 1 addition & 1 deletion dimension_labels.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "dimension_labels",
"summary": "Get the dimension labels",
"description": "Returns all labels for a dimension in the data cube. The labels have the same order as in the data cube.",
"description": "Gives all labels for a dimension in the data cube. The labels have the same order as in the data cube.",
"categories": [
"cubes"
],
Expand Down
2 changes: 1 addition & 1 deletion eq.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
],
"returns": {
"description": "Returns `true` if `x` is equal to `y`, `null` if any operand is `null`, otherwise `false`.",
"description": "`true` if `x` is equal to `y`, `null` if any operand is `null`, otherwise `false`.",
"schema": {
"type": [
"boolean",
Expand Down
2 changes: 1 addition & 1 deletion examples/array_contains_nodata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"returns": {
"description": "Returns `true` if the list contains a no-data value, false` otherwise.",
"description": "`true` if the list contains a no-data value, false` otherwise.",
"schema": {
"type": "boolean"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/array_find_nodata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"returns": {
"description": "Returns the index of the first element with a no-data value. If only data values are available, `null` is returned.",
"description": "The index of the first element with a no-data value. If only data values are available, `null` is returned.",
"schema": [
{
"type": "null"
Expand Down
8 changes: 7 additions & 1 deletion load_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,13 @@
"description": "Any data type."
}
}
]
],
"returns": {
"description": "`true` if the data should be loaded into the data cube, otherwise `false`.",
"schema": {
"type": "boolean"
}
}
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion merge_cubes.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the merged data cube.",
"schema": {
"description": "Any data type."
}
}
},
"default": null,
"optional": true
Expand Down
8 changes: 7 additions & 1 deletion meta/subtype-schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@
"description": "Any data type."
}
}
]
],
"returns": {
"description": "`true` if the data should be used, otherwise `false`.",
"schema": {
"type": "boolean"
}
}
}
},
"output-format": {
Expand Down
2 changes: 1 addition & 1 deletion neq.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}
],
"returns": {
"description": "Returns `true` if `x` is *not* equal to `y`, `null` if any operand is `null`, otherwise `false`.",
"description": "`true` if `x` is *not* equal to `y`, `null` if any operand is `null`, otherwise `false`.",
"schema": {
"type": [
"boolean",
Expand Down
10 changes: 8 additions & 2 deletions proposals/aggregate_spatial_binary.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the vector data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand All @@ -77,7 +83,7 @@
}
],
"returns": {
"description": "A vector data cube with the computed results and restricted to the bounds of the geometries.\n\nThe computed value is stored in dimension with the name that was specified in the parameter `target_dimension`.\n\nThe computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see ``is_valid()``) for each geometry. These values are stored as new dimension with a dimension name derived from `target_dimension` by adding the suffix `_meta`. The new dimension has the dimension labels `total_count` and `valid_count`.",
"description": "A vector data cube with the computed results and restricted to the bounds of the geometries.\n\nThe computed value is used for the dimension with the name that was specified in the parameter `target_dimension`.\n\nThe computation also stores information about the total count of pixels (valid + invalid pixels) and the number of valid pixels (see ``is_valid()``) for each geometry. These values are added as new dimension with a dimension name derived from `target_dimension` by adding the suffix `_meta`. The new dimension has the dimension labels `total_count` and `valid_count`.",
"schema": {
"type": "object",
"subtype": "vector-cube"
Expand Down
8 changes: 7 additions & 1 deletion proposals/aggregate_spatial_window.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion proposals/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
],
"returns": {
"description": "Returns the data as passed to the `data` parameter.",
"description": "The data as passed to the `data` parameter without any modification.",
"schema": {
"description": "Any data type is allowed."
}
Expand Down
10 changes: 8 additions & 2 deletions proposals/filter_labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"parameters": [
{
"name": "value",
"description": "A single dimension label to compare against. The data type of the parameter depends on the dimension labels stored for the dimension.",
"description": "A single dimension label to compare against. The data type of the parameter depends on the dimension labels set for the dimension.",
"schema": [
{
"type": "number"
Expand All @@ -44,7 +44,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "`true` if the dimension label should be kept in the data cube, otherwise `false`.",
"schema": {
"type": "boolean"
}
}
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion proposals/reduce_dimension_binary.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@
"optional": true,
"default": null
}
]
],
"returns": {
"description": "The value to be set in the new data cube.",
"schema": {
"description": "Any data type."
}
}
}
},
{
Expand Down
Loading