Skip to content

Commit 92e4077

Browse files
committed
Clarify NaN in comparisons, clarify character encoding issues
1 parent a3710ad commit 92e4077

File tree

12 files changed

+75
-17
lines changed

12 files changed

+75
-17
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Changed
1010

11-
- Clarified for various mathematical functions the defined input and output ranges. Mention that `NaN` is returned outside of the defined input range where possible.
12-
- Clarified for various processes the handling of no-data values and null, see also the [implementation guide](meta/implementation.md). [#480](https://github.com/Open-EO/openeo-processes/issues/480)
11+
- Clarified for various mathematical functions the defined input and output ranges.
12+
Mention that `NaN` is returned outside of the defined input range where possible.
13+
- Clarified for several comparison processes how `NaN` values have to be handled.
14+
- Clarified for various processes the handling of no-data values and `null`, see also the [implementation guide](meta/implementation.md#no-data-value). [#480](https://github.com/Open-EO/openeo-processes/issues/480)
15+
- Added a [section about character encodings to the implementation guide](meta/implementation.md#character-encoding).
16+
Removed any character encoding related wording from the process specifications itself.
1317
- Added a uniqueness contraint to various array-typed parameters (e.g. lists of dimension names or labels)
1418
- `array_interpolate_linear`: Apply interpolation to NaN and no-data values.
1519
- `clip`: Throw an exception if min > max. [#472](https://github.com/Open-EO/openeo-processes/issues/472)

eq.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "eq",
33
"summary": "Equal to comparison",
4-
"description": "Compares whether `x` is strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
4+
"description": "Compares whether `x` is strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
55
"categories": [
66
"texts",
77
"comparison"
@@ -146,5 +146,12 @@
146146
},
147147
"returns": false
148148
}
149+
],
150+
"links": [
151+
{
152+
"rel": "about",
153+
"href": "https://ieeexplore.ieee.org/document/4610935",
154+
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
155+
}
149156
]
150157
}

gt.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "gt",
33
"summary": "Greater than comparison",
4-
"description": "Compares whether `x` is strictly greater than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
4+
"description": "Compares whether `x` is strictly greater than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If any operand is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
55
"categories": [
66
"comparison"
77
],
@@ -90,5 +90,12 @@
9090
},
9191
"returns": false
9292
}
93+
],
94+
"links": [
95+
{
96+
"rel": "about",
97+
"href": "https://ieeexplore.ieee.org/document/4610935",
98+
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
99+
}
93100
]
94101
}

gte.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "gte",
33
"summary": "Greater than or equal to comparison",
4-
"description": "Compares whether `x` is greater than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
4+
"description": "Compares whether `x` is greater than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If the operands are not equal (see process ``eq()``) and any of them is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
55
"categories": [
66
"comparison"
77
],
@@ -84,6 +84,13 @@
8484
"returns": false
8585
}
8686
],
87+
"links": [
88+
{
89+
"rel": "about",
90+
"href": "https://ieeexplore.ieee.org/document/4610935",
91+
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
92+
}
93+
],
8794
"process_graph": {
8895
"eq": {
8996
"process_id": "eq",

lt.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "lt",
33
"summary": "Less than comparison",
4-
"description": "Compares whether `x` is strictly less than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
4+
"description": "Compares whether `x` is strictly less than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If any operand is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
55
"categories": [
66
"comparison"
77
],
@@ -90,5 +90,12 @@
9090
},
9191
"returns": false
9292
}
93+
],
94+
"links": [
95+
{
96+
"rel": "about",
97+
"href": "https://ieeexplore.ieee.org/document/4610935",
98+
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
99+
}
93100
]
94101
}

lte.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "lte",
33
"summary": "Less than or equal to comparison",
4-
"description": "Compares whether `x` is less than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
4+
"description": "Compares whether `x` is less than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If the operands are not equal (see process ``eq()``) and any of them is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
55
"categories": [
66
"comparison"
77
],
@@ -84,6 +84,13 @@
8484
"returns": false
8585
}
8686
],
87+
"links": [
88+
{
89+
"rel": "about",
90+
"href": "https://ieeexplore.ieee.org/document/4610935",
91+
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
92+
}
93+
],
8794
"process_graph": {
8895
"eq": {
8996
"process_id": "eq",

meta/implementation.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ This file is meant to provide some additional implementation details for back-en
44

55
## No-data value
66

7-
A data cube shall always keep reference of the applicable no-data values.
8-
The no-data value can be chosen by the back-end implementation, e.g. depending on the data type of the data.
7+
A data cube shall always keep reference of the applicable no-data value(s).
8+
The no-data values can be chosen by the back-end implementation, e.g. depending on the data type of the data.
99
No-data values should be exposed for each pre-defined Collection in its metadata.
1010
For all data generated through openEO (e.g. through synchronous or batch jobs), the metadata and/or data
1111
shall expose the no-data values.
1212

13-
The openEO process specifications generally use `null` as a generic value to express no-data values.
13+
The openEO process specifications generally uses `null` as a generic value to express no-data values.
1414
This is primarily meant for the JSON encoding, this means:
1515
1. in the process specification (data type `null` in the schema), and
16-
2. in the process graph (if the no-data value exposed through the metadata can't be used in JSON).
16+
2. in the process graph (if the no-data value exposed through the metadata can't be used in JSON, e.g. `NaN`).
1717

1818
Back-ends may or may not use `null` as a no-data value internally.
1919

@@ -29,6 +29,18 @@ by the array processes shall be replaced with the no-data value of the data cube
2929
None of the openEO processes per se is "special" and thus all are treated the same way by default.
3030
Nevertheless, there are some cases where a special treatment can make a huge difference.
3131

32+
## Character encoding
33+
34+
String-related processes previously mentioned that strings have to be "encoded in UTF-8 by default".
35+
This was removed and we clarify the behavior here:
36+
37+
For data transfer through the API, the character encoding of strings is specified using HTTP headers.
38+
This means all strings provided in the process graph have the same encoding as specified in the HTTP headers.
39+
Back-ends can internally use any character encoding and as such may need to convert the character encoding
40+
upon receipt of the process graph.
41+
It is recommended to use a [Unicode](https://en.wikipedia.org/wiki/Unicode) character encoding such as UTF-8.
42+
In case of doubt, clients and server should assume UTF-8 as character encoding.
43+
3244
### Branching behavior
3345

3446
The `if` process (and any process that is working on some kind of condition) are usually

neq.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "neq",
33
"summary": "Not equal to comparison",
4-
"description": "Compares whether `x` is **not** strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* Strings are expected to be encoded in UTF-8 by default.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
4+
"description": "Compares whether `x` is **not** strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.",
55
"categories": [
66
"texts",
77
"comparison"
@@ -147,6 +147,13 @@
147147
"returns": true
148148
}
149149
],
150+
"links": [
151+
{
152+
"rel": "about",
153+
"href": "https://ieeexplore.ieee.org/document/4610935",
154+
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
155+
}
156+
],
150157
"process_graph": {
151158
"eq": {
152159
"process_id": "eq",

proposals/is_infinite.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "is_infinite",
33
"summary": "Value is an infinite number",
4-
"description": "Checks whether the specified value `x` is an infinite number. The definition of infinite numbers follows the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935). The special numerical value `NaN` (not a number) as defined by the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935) is not an infinite number and must return `false`.",
4+
"description": "Checks whether the specified value `x` is an infinite number. The definition of infinite numbers (and `NaN`) follows the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935). `NaN` (not a number) is not an infinite number and must return `false`.",
55
"categories": [
66
"comparison"
77
],
@@ -28,4 +28,4 @@
2828
"title": "IEEE Standard 754-2008 for Floating-Point Arithmetic"
2929
}
3030
]
31-
}
31+
}

text_begins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "text_begins",
33
"summary": "Text begins with another text",
4-
"description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.",
4+
"description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. No-data values are passed through and therefore get propagated.",
55
"categories": [
66
"texts",
77
"comparison"

0 commit comments

Comments
 (0)