Skip to content

Commit

Permalink
Clarifications for non-null values, added process graph to median #137
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jul 3, 2020
1 parent c4e1b08 commit ae3df5a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `constant`
- Process graphs added to:
- `mean`
- `median`
- Folder with examples (`examples/`). [#136](https://github.com/Open-EO/openeo-processes/issues/136)

### Changed
Expand All @@ -31,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `aggregate_temporal`: Fixed outdated message for exception `TooManyDimensions`.
- `clip`: Fixed examples.
- `resample_*`: Clarified behaviour.
- `mean`: Clarify behavior for arrays with `null`-values only.
- `first`, `last`, `max`, `mean`, `median`, `min`, `sd`, `variance`: Clarify behavior for arrays with `null`-values only.

## 1.0.0-rc.1 - 2020-01-31

Expand Down
4 changes: 2 additions & 2 deletions first.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"id": "first",
"summary": "First element",
"description": "Gives the first element of an array. For an empty array `null` is returned.",
"description": "Gives the first element of an array.",
"categories": [
"arrays",
"reducer"
],
"parameters": [
{
"name": "data",
"description": "An array with elements of any data type. An empty array resolves always with `null`.",
"description": "An array with elements of any data type. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down
4 changes: 2 additions & 2 deletions last.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"id": "last",
"summary": "Last element",
"description": "Gives the last element of an array. For an empty array `null` is returned.",
"description": "Gives the last element of an array.",
"categories": [
"arrays",
"reducer"
],
"parameters": [
{
"name": "data",
"description": "An array with elements of any data type. An empty array resolves always with `null`.",
"description": "An array with elements of any data type. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion max.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"parameters": [
{
"name": "data",
"description": "An array of numbers. An empty array resolves always with `null`.",
"description": "An array of numbers. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down
43 changes: 40 additions & 3 deletions median.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"id": "median",
"summary": "Statistical median",
"description": "The statistical median of an array of numbers is the value separating the higher half from the lower half of the data.\n\n**Remarks:**\n\n* For a symmetric arrays, the result is equal to the ``mean()``.\n* The median can also be calculated by computing the quantile (see process ``quantiles()``) with the probability of *0.5*: `quantiles(data, [0.5])`.\n* An empty input array returns `null`.",
"description": "The statistical median of an array of numbers is the value separating the higher half from the lower half of the data.\n\n**Remarks:**\n\n* For a symmetric arrays, the result is equal to the ``mean()``.\n* The median can also be calculated by computing the ``quantiles()`` with a probability of *0.5*.",
"categories": [
"math",
"reducer"
],
"parameters": [
{
"name": "data",
"description": "An array of numbers. An empty array resolves always with `null`.",
"description": "An array of numbers. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down Expand Up @@ -98,6 +98,16 @@
"data": []
},
"returns": null
},
{
"description": "The input array has only `null` elements: return `null`.",
"arguments": {
"data": [
null,
null
]
},
"returns": null
}
],
"links": [
Expand All @@ -106,5 +116,32 @@
"href": "http://mathworld.wolfram.com/StatisticalMedian.html",
"title": "Statistical Median explained by Wolfram MathWorld"
}
]
],
"process_graph": {
"quantiles": {
"process_id": "quantiles",
"arguments": {
"data": {
"from_parameter": "data"
},
"probabilities": [
0.5
],
"ignore_nodata": {
"from_parameter": "ignore_nodata"
}
}
},
"array_element": {
"process_id": "array_element",
"arguments": {
"data": {
"from_node": "quantiles"
},
"return_nodata": true,
"index": 0
},
"result": true
}
}
}
2 changes: 1 addition & 1 deletion min.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"parameters": [
{
"name": "data",
"description": "An array of numbers. An empty array resolves always with `null`.",
"description": "An array of numbers. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion sd.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"parameters": [
{
"name": "data",
"description": "An array of numbers. An empty array resolves always with `null`.",
"description": "An array of numbers. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion variance.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"parameters": [
{
"name": "data",
"description": "An array of numbers. An empty array resolves always with `null`.",
"description": "An array of numbers. An array without non-`null` elements resolves always with `null`.",
"schema": {
"type": "array",
"items": {
Expand Down

0 comments on commit ae3df5a

Please sign in to comment.