diff --git a/CHANGELOG.md b/CHANGELOG.md index c496a33e..f7754463 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a [section about character encodings to the implementation guide](meta/implementation.md#character-encoding). Removed any character encoding related wording from the process specifications itself. - Added a uniqueness contraint to various array-typed parameters (e.g. lists of dimension names or labels) +- `all`: For empty arrays, returns `true` instead of no-data. [#494](https://github.com/Open-EO/openeo-processes/issues/494) +- `any`: For empty arrays, returns `false` instead of no-data. [#494](https://github.com/Open-EO/openeo-processes/issues/494) - `apply_polygon`: Renamed `polygons` parameter to `geometries` for better alignment with other geometry handling processes. [#511](https://github.com/Open-EO/openeo-processes/issues/511) - `clip`: Throw an exception if min > max [#472](https://github.com/Open-EO/openeo-processes/issues/472) - `is_nan`: Return `false` instead of `true` for non-numerical data types. [#486](https://github.com/Open-EO/openeo-processes/issues/486) diff --git a/all.json b/all.json index dbf751a4..80d0ee0a 100644 --- a/all.json +++ b/all.json @@ -1,7 +1,7 @@ { "id": "all", "summary": "Are all of the values true?", - "description": "Checks if **all** of the values in `data` are true. If no value is given (i.e. the array is empty) the process returns the no-data value (or `null`).\n\nBy default all no-data values are ignored so that the process returns the no-data value (or `null`) if all values are no-data, `true` if all values are true and `false` otherwise. Setting the `ignore_nodata` flag to `false` takes no-data values into account and the array values are reduced pairwise according to the following truth table:\n\n```\n || no-data | false | true\n------- || ------- | ----- | -------\nno-data || no-data | false | no-data\nfalse || false | false | false\ntrue || no-data | false | true\n```\n\n**Remark:** The process evaluates all values from the first to the last element and stops once the outcome is unambiguous. A result is ambiguous unless a value is `false` or all values have been taken into account.", + "description": "Checks if **all** of the values in `data` are true. If no value is given (i.e. the array is empty) the process returns `true`.\n\nBy default, all no-data values are ignored so that the process returns `true` if all values are no-data or true, and `false` otherwise. Setting the `ignore_nodata` flag to `false` takes no-data values into account and the array values are reduced pairwise according to the following truth table:\n\n```\n || no-data | false | true\n------- || ------- | ----- | -------\nno-data || no-data | false | no-data\nfalse || false | false | false\ntrue || no-data | false | true\n```\n\n**Remark:** The process evaluates all values in an arbitrary order and stops once the outcome is unambiguous, i.e. when either a `false` value is encountered, or when all values have been taken into account.", "categories": [ "logic", "reducer" @@ -124,11 +124,19 @@ }, "returns": null }, + { + "arguments": { + "data": [ + null + ] + }, + "returns": true + }, { "arguments": { "data": [] }, - "returns": null + "returns": true } ] } diff --git a/any.json b/any.json index 4cdce32d..eaa9077b 100644 --- a/any.json +++ b/any.json @@ -1,7 +1,7 @@ { "id": "any", "summary": "Is at least one value true?", - "description": "Checks if **any** (i.e. at least one) value in `data` is `true`. If no value is given (i.e. the array is empty) the process returns the no-data value (or `null`).\n\nBy default all no-data values are ignored so that the process returns the no-data value (or `null`) if all values are no-data, `true` if at least one value is true and `false` otherwise. Setting the `ignore_nodata` flag to `false` takes no-data values into account and the array values are reduced pairwise according to the following truth table:\n\n```\n || no-data | false | true\n------- || ------- | ------- | ----\nno-data || no-data | no-data | true\nfalse || no-data | false | true\ntrue || true | true | true\n```\n\n**Remark:** The process evaluates all values from the first to the last element and stops once the outcome is unambiguous. A result is ambiguous unless a value is `true`.", + "description": "Checks if **any** (i.e. at least one) value in `data` is `true`. If no value is given (i.e. the array is empty) the process returns `false`.\n\nBy default all no-data values are ignored so that the process returns `true` if at least one value is true and `false` otherwise. Setting the `ignore_nodata` flag to `false` takes no-data values into account and the array values are reduced pairwise according to the following truth table:\n\n```\n || no-data | false | true\n------- || ------- | ------- | ----\nno-data || no-data | no-data | true\nfalse || no-data | false | true\ntrue || true | true | true\n```\n\n**Remark:** The process evaluates all values in an arbitrary order and stops once the outcome is unambiguous, i.e. when either a `true` value is encountered, or when all values have been taken into account.", "categories": [ "logic", "reducer" @@ -124,11 +124,19 @@ }, "returns": null }, + { + "arguments": { + "data": [ + null + ] + }, + "returns": false + }, { "arguments": { "data": [] }, - "returns": null + "returns": false } ] } diff --git a/tests/all.json5 b/tests/all.json5 index 4fa5bc0f..db4043ec 100644 --- a/tests/all.json5 +++ b/tests/all.json5 @@ -84,13 +84,13 @@ ], "ignore_nodata": false }, - "returns": {"type": "nodata"} + "returns": true }, { "arguments": { "data": [] }, - "returns": {"type": "nodata"} + "returns": true } ] } diff --git a/tests/any.json5 b/tests/any.json5 index ab480704..c89f68e0 100644 --- a/tests/any.json5 +++ b/tests/any.json5 @@ -84,13 +84,13 @@ ], "ignore_nodata": false }, - "returns": {"type": "nodata"} + "returns": false }, { "arguments": { "data": [] }, - "returns": {"type": "nodata"} + "returns": false } ] }