From ec6aca850d840f28ad04353d908d757ed8b00b1a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 2 Jul 2020 15:09:54 +0200 Subject: [PATCH 1/2] Clarify mod process #168 --- CHANGELOG.md | 3 ++- mod.json | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21d3fb71..2b4acd19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,8 +30,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `filter_bbox`, `load_collection`, `resample_spatial`: Fixed invalid EPSG code examples. - `aggregate_temporal`: Fixed outdated message for exception `TooManyDimensions`. - `clip`: Fixed examples. +- `mean`: Clarify behaviour for arrays with `null`-values only. +- `mod`: Clarified behaviour. [#168](https://github.com/Open-EO/openeo-processes/issues/168) - `resample_*`: Clarified behaviour. -- `mean`: Clarify behavior for arrays with `null`-values only. ## 1.0.0-rc.1 - 2020-01-31 diff --git a/mod.json b/mod.json index c9ed9ce1..132c41c9 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "id": "mod", "summary": "Modulo", - "description": "Remainder after division of `x` by `y`.\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) and needs careful consideration while implementing this process.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.", + "description": "Remainder after 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. To remove the sign, use the process ``absolute()``.\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` error must the thrown.", "categories": [ "math" ], @@ -36,6 +36,11 @@ ] } }, + "exceptions": { + "DivisionByZero": { + "message": "Division by zero is not supported." + } + }, "examples": [ { "arguments": { @@ -53,10 +58,10 @@ }, { "arguments": { - "x": 27, - "y": -5 + "x": 3.14, + "y": -2 }, - "returns": -3 + "returns": -0.86 }, { "arguments": { From 996b631d925abd08974f218d83714ce619bf09ec Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 2 Jul 2020 16:38:16 +0200 Subject: [PATCH 2/2] Leave it up to the mathematicians ;-) --- mod.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod.json b/mod.json index 132c41c9..5409df05 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "id": "mod", "summary": "Modulo", - "description": "Remainder after 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. To remove the sign, use the process ``absolute()``.\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` error must the thrown.", + "description": "Remainder after 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` error must the thrown.", "categories": [ "math" ],