From 091263c75b0096c245661260046231c1f882c8b5 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 31 Mar 2023 14:00:23 +0200 Subject: [PATCH] Updates according to recent discussions #331 --- CHANGELOG.md | 13 +++-- aggregate_temporal.json | 22 +++---- climatological_normal.json | 11 ++-- filter_temporal.json | 13 ++--- load_collection.json | 13 ++--- meta/subtype-schemas.json | 15 ++--- order.json | 5 -- proposals/date_between.json | 111 ++++++++++++++++++++++++++++++++++++ proposals/load_stac.json | 13 ++--- sort.json | 10 ---- 10 files changed, 150 insertions(+), 76 deletions(-) create mode 100644 proposals/date_between.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ab146df..d1e2d116 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - New processes in proposal state: + - `date_between` - `date_difference` - `filter_vector` - `flatten_dimensions` @@ -37,12 +38,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow `null` as default value for units. - Input and Output for the `process` can either be data cubes or arrays (if one-dimensional). [#387](https://github.com/Open-EO/openeo-processes/issues/387) - `run_udf`: Allow all data types instead of just objects in the `context` parameter. [#376](https://github.com/Open-EO/openeo-processes/issues/376) -- `load_collection` and `load_result`: - - Require at least one band if not set to `null`. [#372](https://github.com/Open-EO/openeo-processes/issues/372) +- `load_collection` and `load_result`/`load_stac`: + - Require at least one band "if not set to `null`. [#372](https://github.com/Open-EO/openeo-processes/issues/372) - Added a `NoDataAvailable` exception -- `aggregate_temporal`, `filter_temporal`, `load_collection` and `load_result`: +- `aggregate_temporal`, `filter_temporal`, `load_collection` and `load_result`/`load_stac`: - The temporal intervals must always be non-empty, i.e. the second instance in time must be after the first instance in time. [#331](https://github.com/Open-EO/openeo-processes/issues/331) - - `24` as the hour is not allowed anymore. + - `24` as the hour is not allowed anymore. [#331](https://github.com/Open-EO/openeo-processes/issues/331) - `inspect`: The parameter `message` has been moved to be the second argument. [#369](https://github.com/Open-EO/openeo-processes/issues/369) - `mask` and `merge_cubes`: The spatial dimensions `x` and `y` can now be resampled implicitly instead of throwing an error. [#402](https://github.com/Open-EO/openeo-processes/issues/402) - `save_result`: Added a more concrete `DataCubeEmpty` exception. @@ -54,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated the processes based on the subtypes `raster-cube` or `vector-cube` to work with the subtype `datacube` instead. [#68](https://github.com/Open-EO/openeo-processes/issues/68) - `sort` and `order`: The ordering of ties is not defined anymore. [#409](https://github.com/Open-EO/openeo-processes/issues/409) - `quantiles`: Parameter `probabilities` provided as array must be in ascending order. [#297](https://github.com/Open-EO/openeo-processes/pull/297) +- `climatological_normal`: The `climatology_period` parameter accepts an array of integers instead of strings. [#331](https://github.com/Open-EO/openeo-processes/issues/331) ### Deprecated @@ -62,7 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - The `examples` folder has been migrated to the [openEO Community Examples](https://github.com/Open-EO/openeo-community-examples/tree/main/processes) repository. -- `between`: Support for temporal comparison. +- `between`: Support for temporal comparison. Use `date_between` instead. [#331](https://github.com/Open-EO/openeo-processes/issues/331) - Deprecated `GeometryCollections` are not supported any longer. [#389](https://github.com/Open-EO/openeo-processes/issues/389) - Deprecated PROJ definitions for the CRS are not supported any longer. - `load_result`: @@ -72,6 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The comparison processes `eq`, `neq`, `lt`, `lte`, `gt`, `gte` and `array_contains`: - Removed support for temporal comparison. Instead explicitly use `date_difference`. - Removed support for the input data types array and object. [#208](https://github.com/Open-EO/openeo-processes/issues/208) +- `sort` and `order`: Removed support for time-only values. [#331](https://github.com/Open-EO/openeo-processes/issues/331) ### Fixed diff --git a/aggregate_temporal.json b/aggregate_temporal.json index 8a4d4aaa..4f83cd44 100644 --- a/aggregate_temporal.json +++ b/aggregate_temporal.json @@ -22,7 +22,7 @@ }, { "name": "intervals", - "description": "Left-closed temporal intervals, which are allowed to overlap. Each temporal interval in the array has exactly two elements:\n\n1. The first element is the start of the temporal interval. The specified time instant is **included** in the interval.\n2. The second element is the end of the temporal interval. The specified time instant is **excluded** from the interval.\n\nThe second element must always be greater/later than the first element. Otherwise, a `TemporalExtentEmpty` exception is thrown.\n\nThe specified temporal strings follow [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html).", + "description": "Left-closed temporal intervals, which are allowed to overlap. Each temporal interval in the array has exactly two elements:\n\n1. The first element is the start of the temporal interval. The specified time instant is **included** in the interval.\n2. The second element is the end of the temporal interval. The specified time instant is **excluded** from the interval.\n\nThe second element must always be greater/later than the first element, except for times. Otherwise, a `TemporalExtentEmpty` exception is thrown.\n\nThe specified temporal strings follow [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html).", "schema": { "type": "array", "subtype": "temporal-intervals", @@ -38,24 +38,20 @@ { "type": "string", "format": "date-time", - "subtype": "date-time" + "subtype": "date-time", + "description": "Date and time with a timezone." }, { "type": "string", "format": "date", - "subtype": "date" + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." }, { "type": "string", - "format": "time", - "subtype": "time" - }, - { - "type": "string", - "subtype": "year", - "minLength": 4, - "maxLength": 4, - "pattern": "^\\d{4}$" + "subtype": "time", + "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "description": "Time only, formatted as HH:MM:SS. The time zone is UTC." }, { "type": "null" @@ -85,7 +81,7 @@ ], [ "12:00:00Z", - null + "00:00:00Z" ] ] ] diff --git a/climatological_normal.json b/climatological_normal.json index 49381500..fa3441b6 100644 --- a/climatological_normal.json +++ b/climatological_normal.json @@ -43,16 +43,13 @@ "minItems": 2, "maxItems": 2, "items": { - "type": "string", - "subtype": "year", - "minLength": 4, - "maxLength": 4, - "pattern": "^\\d{4}$" + "type": "integer", + "subtype": "year" } }, "default": [ - "1981", - "2010" + 1981, + 2010 ], "optional": true } diff --git a/filter_temporal.json b/filter_temporal.json index 08cf2586..63380d48 100644 --- a/filter_temporal.json +++ b/filter_temporal.json @@ -33,19 +33,14 @@ { "type": "string", "format": "date-time", - "subtype": "date-time" + "subtype": "date-time", + "description": "Date and time with a timezone." }, { "type": "string", "format": "date", - "subtype": "date" - }, - { - "type": "string", - "subtype": "year", - "minLength": 4, - "maxLength": 4, - "pattern": "^\\d{4}$" + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." }, { "type": "null" diff --git a/load_collection.json b/load_collection.json index e7e23a6d..ecc16c5d 100644 --- a/load_collection.json +++ b/load_collection.json @@ -125,19 +125,14 @@ { "type": "string", "format": "date-time", - "subtype": "date-time" + "subtype": "date-time", + "description": "Date and time with a timezone." }, { "type": "string", "format": "date", - "subtype": "date" - }, - { - "type": "string", - "subtype": "year", - "minLength": 4, - "maxLength": 4, - "pattern": "^\\d{4}$" + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." }, { "type": "null" diff --git a/meta/subtype-schemas.json b/meta/subtype-schemas.json index 7c5493b6..9bf9191d 100644 --- a/meta/subtype-schemas.json +++ b/meta/subtype-schemas.json @@ -120,7 +120,7 @@ "subtype": "date", "format": "date", "title": "Date only", - "description": "Date only representation, as defined for `full-date` by [RFC 3339 in section 5.6](https://www.rfc-editor.org/rfc/rfc3339.html#section-5.6). The time zone is UTC." + "description": "Date only representation, as defined for `full-date` by [RFC 3339 in section 5.6](https://www.rfc-editor.org/rfc/rfc3339.html#section-5.6). The time zone is UTC. Missing time components are all 0." }, "date-time": { "type": "string", @@ -282,7 +282,7 @@ "type": "array", "subtype": "temporal-interval", "title": "Single temporal interval", - "description": "Left-closed temporal interval, represented as two-element array with the following elements:\n\n1. The first element is the start of the temporal interval. The specified time instant is **included** in the interval.\n2. The second element is the end of the temporal interval. The specified time instant is **excluded** from the interval.\n\nThe specified temporal strings follow [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html). `null` can be used to specify unbounded intervals.", + "description": "Left-closed temporal interval, represented as two-element array with the following elements:\n\n1. The first element is the start of the temporal interval. The specified time instant is **included** in the interval.\n2. The second element is the end of the temporal interval. The specified time instant is **excluded** from the interval.\n\nThe second element must always be greater/later than the first element. Otherwise, an exception is thrown.\n\nThe specified temporal strings follow [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html). Also supports unbounded intervals by setting one of the boundaries to `null`, but never both.", "uniqueItems": true, "minItems": 2, "maxItems": 2, @@ -370,9 +370,9 @@ "time": { "type": "string", "subtype": "time", - "format": "time", + "pattern": "^\\d{2}:\\d{2}:\\d{2}$", "title": "Time only", - "description": "Time only representation, as defined for `full-time` by [RFC 3339 in section 5.6](https://www.rfc-editor.org/rfc/rfc3339.html#section-5.6)." + "description": "Time only representation, as defined for `partial-time` by [RFC 3339 in section 5.6](https://www.rfc-editor.org/rfc/rfc3339.html#section-5.6). The time zone is UTC." }, "udf-code": { "type": "string", @@ -414,13 +414,10 @@ "description": "Specifies details about cartographic projections as WKT2 string. Refers to the latest WKT2 version (currently [WKT2:2018](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html) / ISO 19162:2018) unless otherwise stated by the process." }, "year": { - "type": "string", + "type": "integer", "subtype": "year", - "minLength": 4, - "maxLength": 4, - "pattern": "^\\d{4}$", "title": "Year only", - "description": "Year representation, as defined for `date-fullyear` by [RFC 3339 in section 5.6](https://www.rfc-editor.org/rfc/rfc3339.html#section-5.6)." + "description": "Year as integer." } } } diff --git a/order.json b/order.json index 871c4fea..93866f4c 100644 --- a/order.json +++ b/order.json @@ -29,11 +29,6 @@ "type": "string", "format": "date", "subtype": "date" - }, - { - "type": "string", - "format": "time", - "subtype": "time" } ] } diff --git a/proposals/date_between.json b/proposals/date_between.json new file mode 100644 index 00000000..1f3bffc2 --- /dev/null +++ b/proposals/date_between.json @@ -0,0 +1,111 @@ +{ + "id": "date_between", + "summary": "Between comparison for dates and times", + "description": "By default, this process checks whether `x` is later than or equal to `min` and before or equal to `max`.\n\nIf `exclude_max` is set to `true` the upper bound is excluded so that the process checks whether `x` is later than or equal to `min` and before `max`.\n\nLower and upper bounds are not allowed to be swapped. So `min` MUST be before or equal to `max` or otherwise the process always returns `false`.", + "categories": [ + "comparison", + "date & time" + ], + "parameters": [ + { + "name": "x", + "description": "The value to check.", + "schema": [ + { + "type": "string", + "format": "date-time", + "subtype": "date-time", + "description": "Date and time with a timezone." + }, + { + "type": "string", + "format": "date", + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." + }, + { + "type": "string", + "subtype": "time", + "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "description": "Time only, formatted as HH:MM:SS. The time zone is UTC." + } + ] + }, + { + "name": "min", + "description": "Lower boundary (inclusive) to check against.", + "schema": [ + { + "type": "string", + "format": "date-time", + "subtype": "date-time", + "description": "Date and time with a timezone." + }, + { + "type": "string", + "format": "date", + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." + }, + { + "type": "string", + "subtype": "time", + "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "description": "Time only, formatted as HH:MM:SS. The time zone is UTC." + } + ] + }, + { + "name": "max", + "description": "Upper boundary (inclusive) to check against.", + "schema": [ + { + "type": "string", + "format": "date-time", + "subtype": "date-time", + "description": "Date and time with a timezone." + }, + { + "type": "string", + "format": "date", + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." + }, + { + "type": "string", + "subtype": "time", + "pattern": "^\\d{2}:\\d{2}:\\d{2}$", + "description": "Time only, formatted as HH:MM:SS. The time zone is UTC." + } + ] + }, + { + "name": "exclude_max", + "description": "Exclude the upper boundary `max` if set to `true`. Defaults to `false`.", + "schema": { + "type": "boolean" + }, + "default": false, + "optional": true + } + ], + "returns": { + "description": "`true` if `x` is between the specified bounds, otherwise `false`.", + "schema": { + "type": [ + "boolean", + "null" + ] + } + }, + "examples": [ + { + "arguments": { + "x": "2020-01-01", + "min": "2021-01-01", + "max": "2022-01-01" + }, + "returns": false + } + ] +} diff --git a/proposals/load_stac.json b/proposals/load_stac.json index e8e3841c..1e348384 100644 --- a/proposals/load_stac.json +++ b/proposals/load_stac.json @@ -129,19 +129,14 @@ { "type": "string", "format": "date-time", - "subtype": "date-time" + "subtype": "date-time", + "description": "Date and time with a timezone." }, { "type": "string", "format": "date", - "subtype": "date" - }, - { - "type": "string", - "subtype": "year", - "minLength": 4, - "maxLength": 4, - "pattern": "^\\d{4}$" + "subtype": "date", + "description": "Date only, formatted as YYYY-MM-DD. The time zone is UTC. Missing time components are all 0." }, { "type": "null" diff --git a/sort.json b/sort.json index 27586250..422f8d53 100644 --- a/sort.json +++ b/sort.json @@ -29,11 +29,6 @@ "type": "string", "format": "date", "subtype": "date" - }, - { - "type": "string", - "format": "time", - "subtype": "time" } ] } @@ -82,11 +77,6 @@ "type": "string", "format": "date", "subtype": "date" - }, - { - "type": "string", - "format": "time", - "subtype": "time" } ] }