From ad8a2f3551fe9d69c1689e310bf5307e20d86113 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 8 Dec 2023 11:40:09 +0100 Subject: [PATCH 1/8] Math functions: Clarified value ranges and NaN (#476) * divide, ln, log, mod: Clarified behavior for 0 input / infinity results * Trigonometric functions: Clarified that NaN is returned outside of their defined ranges and the output value range for some processes * Clarified for various mathematical functions the defined input and output ranges. Mention that `NaN` is returned outside of the defined input range where possible. * Remove NaN --- CHANGELOG.md | 3 +++ absolute.json | 4 ++-- arccos.json | 15 +++++++++------ arcosh.json | 14 ++++++++------ arcsin.json | 12 +++++++----- arctan.json | 4 ++-- arsinh.json | 6 +++--- artanh.json | 17 ++++++++++++----- cos.json | 8 +++++--- cosh.json | 11 ++++++----- divide.json | 4 ++-- exp.json | 7 ++++--- ln.json | 9 +++++---- log.json | 9 +++++---- mod.json | 4 ++-- sgn.json | 8 +++++++- sin.json | 8 +++++--- sinh.json | 8 ++++---- tan.json | 11 ++++++++--- tanh.json | 12 +++++++----- 20 files changed, 106 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2a4f1d7..f70afe7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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. +- `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. - `filter_bbox`, `load_collection`, `load_stac`: Clarified that the bounding box is reprojected to the CRS of the spatial data cube dimensions if required. - `filter_spatial`: Clarified that masking is applied using the given geometries. [#469](https://github.com/Open-EO/openeo-processes/issues/469) +- `mod`: Clarified behavior for y = 0 - `sqrt`: Clarified that NaN is returned for negative numbers. ## [2.0.0-rc.1] - 2023-05-25 diff --git a/absolute.json b/absolute.json index 3b6e91dc..c6a3713d 100644 --- a/absolute.json +++ b/absolute.json @@ -1,7 +1,7 @@ { "id": "absolute", "summary": "Absolute value", - "description": "Computes the absolute value of a real number `x`, which is the \"unsigned\" portion of x and often denoted as *|x|*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the absolute value of a real number `x`, which is the \"unsigned\" portion of `x` and often denoted as *|x|*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math" ], @@ -95,4 +95,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/arccos.json b/arccos.json index 5ffbce35..4cd498a7 100644 --- a/arccos.json +++ b/arccos.json @@ -1,29 +1,32 @@ { "id": "arccos", "summary": "Inverse cosine", - "description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "A number.", + "description": "A number in the range *[-1, 1]*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": -1, + "maximum": 1 } } ], "returns": { - "description": "The computed angle in radians.", + "description": "The computed angle in radians in the range *[0, π]*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": 0 } }, "examples": [ @@ -41,4 +44,4 @@ "title": "Inverse cosine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/arcosh.json b/arcosh.json index 6ed581fe..820b8cd4 100644 --- a/arcosh.json +++ b/arcosh.json @@ -1,29 +1,31 @@ { "id": "arcosh", "summary": "Inverse hyperbolic cosine", - "description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "A number.", + "description": "A number in the range *[1, +∞)*.", "schema": { "type": [ "number", "null" ] - } + }, + "minimum": 1 } ], "returns": { - "description": "The computed angle in radians.", + "description": "The computed hyperbolic angle in radians in the range *[0, +∞)*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": 0 } }, "examples": [ @@ -41,4 +43,4 @@ "title": "Inverse hyperbolic cosine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/arcsin.json b/arcsin.json index e37eb2d3..2c772a00 100644 --- a/arcsin.json +++ b/arcsin.json @@ -1,24 +1,26 @@ { "id": "arcsin", "summary": "Inverse sine", - "description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values < -1 and > 1.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "A number.", + "description": "A number in the range *[-1, 1]*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": -1, + "maximum": 1 } } ], "returns": { - "description": "The computed angle in radians.", + "description": "The computed angle in radians in the range *[-π/2, π/2]*.", "schema": { "type": [ "number", @@ -41,4 +43,4 @@ "title": "Inverse sine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/arctan.json b/arctan.json index dc8d5a68..9461eba3 100644 --- a/arctan.json +++ b/arctan.json @@ -18,7 +18,7 @@ } ], "returns": { - "description": "The computed angle in radians.", + "description": "The computed angle in radians in the range *(−π/2, π/2)*.", "schema": { "type": [ "number", @@ -41,4 +41,4 @@ "title": "Inverse tangent explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/arsinh.json b/arsinh.json index 37384dcd..2b7942dd 100644 --- a/arsinh.json +++ b/arsinh.json @@ -1,7 +1,7 @@ { "id": "arsinh", "summary": "Inverse hyperbolic sine", - "description": "Computes the inverse hyperbolic sine of `x`. It is the inverse function of the hyperbolic sine so that *`arsinh(sinh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the inverse hyperbolic sine of `x`. It is the inverse function of the hyperbolic sine so that *`arsinh(sinh(x)) = x`*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math > trigonometric" ], @@ -18,7 +18,7 @@ } ], "returns": { - "description": "The computed angle in radians.", + "description": "The computed hyperbolic angle in radians.", "schema": { "type": [ "number", @@ -41,4 +41,4 @@ "title": "Inverse hyperbolic sine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/artanh.json b/artanh.json index 926b48ea..6308290d 100644 --- a/artanh.json +++ b/artanh.json @@ -1,24 +1,26 @@ { "id": "artanh", "summary": "Inverse hyperbolic tangent", - "description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values outside of the allowed range. The computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, `x` = 1 results in +infinity and `x` = 0 results in -infinity. Otherwise, an exception is thrown.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "A number.", + "description": "A number in the range *(-1, 1)*.", "schema": { "type": [ "number", "null" - ] + ], + "minimumExclusive": -1, + "maximumExclusive": 1 } } ], "returns": { - "description": "The computed angle in radians.", + "description": "The computed hyperbolic angle in radians.", "schema": { "type": [ "number", @@ -39,6 +41,11 @@ "rel": "about", "href": "http://mathworld.wolfram.com/InverseHyperbolicTangent.html", "title": "Inverse hyperbolic tangent explained by Wolfram MathWorld" + }, + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/cos.json b/cos.json index 6e6e4143..0d6229a8 100644 --- a/cos.json +++ b/cos.json @@ -18,12 +18,14 @@ } ], "returns": { - "description": "The computed cosine of `x`.", + "description": "The computed cosine in the range *[-1, 1]*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": -1, + "maximum": 1 } }, "examples": [ @@ -41,4 +43,4 @@ "title": "Cosine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/cosh.json b/cosh.json index 975958a4..8b56a222 100644 --- a/cosh.json +++ b/cosh.json @@ -1,14 +1,14 @@ { "id": "cosh", "summary": "Hyperbolic cosine", - "description": "Computes the hyperbolic cosine of `x`.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the hyperbolic cosine of `x`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "An angle in radians.", + "description": "An hyperbolic angle in radians.", "schema": { "type": [ "number", @@ -18,12 +18,13 @@ } ], "returns": { - "description": "The computed hyperbolic cosine of `x`.", + "description": "The computed hyperbolic cosine in the range *[1, +∞)*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": 1 } }, "examples": [ @@ -41,4 +42,4 @@ "title": "Hyperbolic cosine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/divide.json b/divide.json index 5dd664f1..0c6c254a 100644 --- a/divide.json +++ b/divide.json @@ -1,7 +1,7 @@ { "id": "divide", "summary": "Division of two numbers", - "description": "Divides argument `x` by the argument `y` (*`x / y`*) and returns the computed result.\n\nNo-data values are taken into account so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, a division by zero results in ±infinity if the processing environment supports it. Otherwise, a `DivisionByZero` exception must the thrown.", + "description": "Divides argument `x` by the argument `y` (*`x / y`*) and returns the computed result.\n\nNo-data values are taken into account so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. A division by zero results in:\n\n- +infinity for `x` > 0,\n- -infinity for `x` < 0,\n- `NaN` for `x` = 0,\n- or otherwise, throws a `DivisionByZero` exception if the other options are not supported by the processing environment.", "categories": [ "math" ], @@ -76,4 +76,4 @@ "title": "IEEE Standard 754-2019 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/exp.json b/exp.json index 5a5e3283..2d551390 100644 --- a/exp.json +++ b/exp.json @@ -18,12 +18,13 @@ } ], "returns": { - "description": "The computed value for *e* raised to the power of `p`.", + "description": "The computed value for *e* raised to the power of `p`. Value is in the range of *(0, +∞)*", "schema": { "type": [ "number", "null" - ] + ], + "minimumExclusive": 0 } }, "examples": [ @@ -65,4 +66,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/ln.json b/ln.json index e073c7a2..1663771b 100644 --- a/ln.json +++ b/ln.json @@ -1,19 +1,20 @@ { "id": "ln", "summary": "Natural logarithm", - "description": "The natural logarithm is the logarithm to the base *e* of the number `x`, which equals to using the *log* process with the base set to *e*. The natural logarithm is the inverse function of taking *e* to the power x.\n\nThe no-data value `null` is passed through.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`ln(0)`* results in ±infinity if the processing environment supports it or otherwise an exception is thrown.", + "description": "The natural logarithm is the logarithm to the base *e* of the number `x`, which equals to using the *log* process with the base set to *e*. The natural logarithm is the inverse function of taking *e* to the power x.\n\nThe no-data value `null` is passed through.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`ln(0)`* results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > exponential & logarithmic" ], "parameters": [ { "name": "x", - "description": "A number to compute the natural logarithm for.", + "description": "A number to compute the natural logarithm for in the range *[0, +∞)*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": 0 } } ], @@ -64,4 +65,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/log.json b/log.json index 89500837..67a19ba2 100644 --- a/log.json +++ b/log.json @@ -1,19 +1,20 @@ { "id": "log", "summary": "Logarithm to a base", - "description": "Logarithm to the base `base` of the number `x` is defined to be the inverse function of taking b to the power of x.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, `log(0, 2)` results in ±infinity if the processing environment supports it or otherwise an exception is thrown.", + "description": "Logarithm to the base `base` of the number `x` is defined to be the inverse function of taking b to the power of x.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, having `x` set to `0` with any base results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > exponential & logarithmic" ], "parameters": [ { "name": "x", - "description": "A number to compute the logarithm for.", + "description": "A number to compute the logarithm for in the range *[0, +∞)*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": 0 } }, { @@ -78,4 +79,4 @@ "title": "IEEE Standard 754-2019 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/mod.json b/mod.json index ca709386..0c8a6ea9 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "id": "mod", "summary": "Modulo", - "description": "Remainder after a division of `x` by `y` for both integers and floating-point numbers.\n\nThe result of a modulo operation has the sign of the divisor. The handling regarding the sign of the result [differs between programming languages](https://en.wikipedia.org/wiki/Modulo_operation#In_programming_languages) and needs careful consideration to avoid unexpected results.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`. A modulo by zero results in ±infinity if the processing environment supports it. Otherwise, a `DivisionByZero` exception must the thrown.", + "description": "Remainder after a division of `x` by `y` for both integers and floating-point numbers.\n\nThe result of a modulo operation has the sign of the divisor. The handling regarding the sign of the result [differs between programming languages](https://en.wikipedia.org/wiki/Modulo_operation#In_programming_languages) and needs careful consideration to avoid unexpected results.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`. If `y` is set to 0 this results in:\n\n- +infinity for `x` > 0,\n- -infinity for `x` < 0,\n- `NaN` for `x` = 0,\n- or otherwise, throws a `DivisionByZero` exception if the other options are not supported by the processing environment.", "categories": [ "math" ], @@ -92,4 +92,4 @@ "title": "Modulo explained by Wikipedia" } ] -} \ No newline at end of file +} diff --git a/sgn.json b/sgn.json index f59afdc4..ecdbd9d1 100644 --- a/sgn.json +++ b/sgn.json @@ -23,6 +23,12 @@ "type": [ "number", "null" + ], + "enum": [ + -1, + 0, + 1, + null ] } }, @@ -104,4 +110,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/sin.json b/sin.json index 06c45cc4..15285979 100644 --- a/sin.json +++ b/sin.json @@ -18,12 +18,14 @@ } ], "returns": { - "description": "The computed sine of `x`.", + "description": "The computed sine in the range *[-1, 1]*.", "schema": { "type": [ "number", "null" - ] + ], + "minimum": -1, + "maximum": 1 } }, "examples": [ @@ -41,4 +43,4 @@ "title": "Sine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/sinh.json b/sinh.json index c505b3a3..6eced19c 100644 --- a/sinh.json +++ b/sinh.json @@ -1,14 +1,14 @@ { "id": "sinh", "summary": "Hyperbolic sine", - "description": "Computes the hyperbolic sine of `x`.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the hyperbolic sine of `x`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "An angle in radians.", + "description": "An hyperbolic angle in radians.", "schema": { "type": [ "number", @@ -18,7 +18,7 @@ } ], "returns": { - "description": "The computed hyperbolic sine of `x`.", + "description": "The computed hyperbolic sine.", "schema": { "type": [ "number", @@ -41,4 +41,4 @@ "title": "Hyperbolic sine explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/tan.json b/tan.json index c3952efa..6e927ffc 100644 --- a/tan.json +++ b/tan.json @@ -1,7 +1,7 @@ { "id": "tan", "summary": "Tangent", - "description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`tan(pi()/2 + multipliy(pi(), n))`* with `n` being any integer results in ±infinity. -infinity for negative values passed to `tan`, +infinity otherwise. If the processing environment does not supports it, an exception is thrown.", "categories": [ "math > trigonometric" ], @@ -18,7 +18,7 @@ } ], "returns": { - "description": "The computed tangent of `x`.", + "description": "The computed tangent.", "schema": { "type": [ "number", @@ -39,6 +39,11 @@ "rel": "about", "href": "http://mathworld.wolfram.com/Tangent.html", "title": "Tangent explained by Wolfram MathWorld" + }, + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/tanh.json b/tanh.json index 203f581e..a38462c9 100644 --- a/tanh.json +++ b/tanh.json @@ -1,14 +1,14 @@ { "id": "tanh", "summary": "Hyperbolic tangent", - "description": "Computes the hyperbolic tangent of `x`. The tangent is defined to be the hyperbolic sine of x divided by the hyperbolic cosine of x.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the hyperbolic tangent of `x`. The tangent is defined to be the hyperbolic sine of x divided by the hyperbolic cosine of x.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math > trigonometric" ], "parameters": [ { "name": "x", - "description": "An angle in radians.", + "description": "An hyperbolic angle in radians.", "schema": { "type": [ "number", @@ -18,12 +18,14 @@ } ], "returns": { - "description": "The computed hyperbolic tangent of `x`.", + "description": "The computed hyperbolic tangent in the range *(-1, 1)*.", "schema": { "type": [ "number", "null" - ] + ], + "minimumExclusive": -1, + "maximumExclusive": 1 } }, "examples": [ @@ -41,4 +43,4 @@ "title": "Hyperbolic tangent explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} From 427421595bc4b052c541de90dfdd995c44f54b30 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 22 Dec 2023 17:07:27 +0100 Subject: [PATCH 2/8] Added uniqueness contraints and clarified DimensionNotAvailable exception in temporal aggregations --- CHANGELOG.md | 2 ++ aggregate_temporal.json | 5 +++-- aggregate_temporal_period.json | 4 ++-- proposals/array_create_labeled.json | 3 ++- proposals/flatten_dimensions.json | 1 + proposals/predict_curve.json | 1 + proposals/unflatten_dimension.json | 1 + rename_labels.json | 2 ++ 8 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f70afe7b..60a5aa22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/aggregate_temporal.json b/aggregate_temporal.json index ad1d560b..2c66e0f2 100644 --- a/aggregate_temporal.json +++ b/aggregate_temporal.json @@ -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", @@ -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", @@ -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." diff --git a/aggregate_temporal_period.json b/aggregate_temporal_period.json index bdaea43e..ce6d4be5 100644 --- a/aggregate_temporal_period.json +++ b/aggregate_temporal_period.json @@ -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", @@ -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." diff --git a/proposals/array_create_labeled.json b/proposals/array_create_labeled.json index 8b5d2034..f83d6559 100644 --- a/proposals/array_create_labeled.json +++ b/proposals/array_create_labeled.json @@ -19,6 +19,7 @@ "description": "An array of labels to be used.", "schema": { "type": "array", + "uniqueItems": true, "items": { "type": [ "number", @@ -43,4 +44,4 @@ "message": "The number of values in the parameters `data` and `labels` don't match." } } -} \ No newline at end of file +} diff --git a/proposals/flatten_dimensions.json b/proposals/flatten_dimensions.json index da3647ab..1c02bf39 100644 --- a/proposals/flatten_dimensions.json +++ b/proposals/flatten_dimensions.json @@ -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" } diff --git a/proposals/predict_curve.json b/proposals/predict_curve.json index 479b7fec..ef3e9596 100644 --- a/proposals/predict_curve.json +++ b/proposals/predict_curve.json @@ -68,6 +68,7 @@ }, { "type": "array", + "uniqueItems": true, "items": { "anyOf": [ { diff --git a/proposals/unflatten_dimension.json b/proposals/unflatten_dimension.json index 990e7469..a5a4bb6d 100644 --- a/proposals/unflatten_dimension.json +++ b/proposals/unflatten_dimension.json @@ -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" diff --git a/rename_labels.json b/rename_labels.json index 2042737d..de4f07da 100644 --- a/rename_labels.json +++ b/rename_labels.json @@ -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", @@ -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", From d5d0a1896ed64573529a0cc3225e3c3e682c4d46 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 22 Dec 2023 19:26:29 +0100 Subject: [PATCH 3/8] Remove unused exception from aggregate_temporal_period, clarified week definition --- CHANGELOG.md | 2 ++ aggregate_temporal_period.json | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a5aa22..9a301787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - 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. +- `aggregate_temporal_period`: Removed unused exception `DistinctDimensionLabelsRequired` +- `aggregate_temporal_period`: Clarified that the definition of weeks follows ISO 8601 - `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. diff --git a/aggregate_temporal_period.json b/aggregate_temporal_period.json index ce6d4be5..446afa8d 100644 --- a/aggregate_temporal_period.json +++ b/aggregate_temporal_period.json @@ -23,7 +23,7 @@ }, { "name": "period", - "description": "The time intervals to aggregate. The following pre-defined values are available:\n\n* `hour`: Hour of the day\n* `day`: Day of the year\n* `week`: Week of the year\n* `dekad`: Ten day periods, counted per year with three periods per month (day 1 - 10, 11 - 20 and 21 - end of month). The third dekad of the month can range from 8 to 11 days. For example, the third dekad of a year spans from January 21 till January 31 (11 days), the fourth dekad spans from February 1 till February 10 (10 days) and the sixth dekad spans from February 21 till February 28 or February 29 in a leap year (8 or 9 days respectively).\n* `month`: Month of the year\n* `season`: Three month periods of the calendar seasons (December - February, March - May, June - August, September - November).\n* `tropical-season`: Six month periods of the tropical seasons (November - April, May - October).\n* `year`: Proleptic years\n* `decade`: Ten year periods ([0-to-9 decade](https://en.wikipedia.org/wiki/Decade#0-to-9_decade)), from a year ending in a 0 to the next year ending in a 9.\n* `decade-ad`: Ten year periods ([1-to-0 decade](https://en.wikipedia.org/wiki/Decade#1-to-0_decade)) better aligned with the anno Domini (AD) calendar era, from a year ending in a 1 to the next year ending in a 0.", + "description": "The time intervals to aggregate. The following pre-defined values are available:\n\n* `hour`: Hour of the day\n* `day`: Day of the year\n* `week`: Week of the year as defined in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Week_dates)\n* `dekad`: Ten day periods, counted per year with three periods per month (day 1 - 10, 11 - 20 and 21 - end of month). The third dekad of the month can range from 8 to 11 days. For example, the third dekad of a year spans from January 21 till January 31 (11 days), the fourth dekad spans from February 1 till February 10 (10 days) and the sixth dekad spans from February 21 till February 28 or February 29 in a leap year (8 or 9 days respectively).\n* `month`: Month of the year\n* `season`: Three month periods of the calendar seasons (December - February, March - May, June - August, September - November).\n* `tropical-season`: Six month periods of the tropical seasons (November - April, May - October).\n* `year`: Proleptic years\n* `decade`: Ten year periods ([0-to-9 decade](https://en.wikipedia.org/wiki/Decade#0-to-9_decade)), from a year ending in a 0 to the next year ending in a 9.\n* `decade-ad`: Ten year periods ([1-to-0 decade](https://en.wikipedia.org/wiki/Decade#1-to-0_decade)) better aligned with the anno Domini (AD) calendar era, from a year ending in a 1 to the next year ending in a 0.", "schema": { "type": "string", "enum": [ @@ -116,9 +116,6 @@ }, "DimensionNotAvailable": { "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." } }, "links": [ From 47b45d4fe65ed7a3dc82d879a884e7736842ef85 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 23 Jan 2024 17:44:44 +0100 Subject: [PATCH 4/8] Renamed `create_data_cube` to `create_cube`. #68 --- CHANGELOG.md | 1 + create_data_cube.json => create_cube.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename create_data_cube.json => create_cube.json (95%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a301787..d870ae83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `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) +- Renamed `create_data_cube` to `create_cube`. [#68](https://github.com/Open-EO/openeo-processes/issues/68) ### Fixed diff --git a/create_data_cube.json b/create_cube.json similarity index 95% rename from create_data_cube.json rename to create_cube.json index 55f0aede..0f8c7ca2 100644 --- a/create_data_cube.json +++ b/create_cube.json @@ -1,5 +1,5 @@ { - "id": "create_data_cube", + "id": "create_cube", "summary": "Create an empty data cube", "description": "Creates a new data cube without dimensions. Dimensions can be added with ``add_dimension()``.", "categories": [ From 9363471d52fe1c80cfcb8a977ea2a3f53b558750 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 26 Jul 2024 19:51:42 +0200 Subject: [PATCH 5/8] Update docgen --- dev/docs.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/docs.html b/dev/docs.html index 04b1c192..0a7d005e 100644 --- a/dev/docs.html +++ b/dev/docs.html @@ -5,7 +5,7 @@ openEO API Processes - +