Skip to content

Commit

Permalink
Merge branch 'draft' into mod
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr authored Jul 6, 2020
2 parents 996b631 + 4bfc660 commit 1418b8a
Show file tree
Hide file tree
Showing 18 changed files with 470 additions and 163 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ sudo: false
install:
- cd tests
- npm install
- npm install -g concat-json-files

script:
- npm run test
- cd ..

before_deploy:
- concat-json-files "*.json" -t "processes.json"
- npm run generate
- cd ..
- git clone --branch gh-pages https://[email protected]/Open-EO/openeo-processes.git gh-pages
- cp tests/docs.html index.html
- |
if [[ $TRAVIS_BRANCH == 'draft' ]] ; then
rm -rf gh-pages/draft
mkdir -p gh-pages/draft
rsync -vrm --include='*.json' --include='*.html' --include='examples/***' --exclude='*' . gh-pages/draft
rsync -vrm --include='*.json' --include='*.html' --include='examples/***' --include='meta/***' --exclude='*' . gh-pages/draft
fi
- |
if [[ $TRAVIS_BRANCH == 'master' ]] ; then
find gh-pages -maxdepth 1 -type f -delete
rm -rf gh-pages/examples/
mkdir -p gh-pages
rsync -vrm --include='*.json' --include='*.html' --include='examples/***' --exclude='*' . gh-pages
rsync -vrm --include='*.json' --include='*.html' --include='examples/***' --include='meta/***' --exclude='*' . gh-pages
fi
- |
if [ -n "$TRAVIS_TAG" ] ; then
rm -rf gh-pages/$TRAVIS_TAG
mkdir -p gh-pages/$TRAVIS_TAG
rsync -vrm --include='*.json' --include='*.html' --include='examples/***' --exclude='*' . gh-pages/$TRAVIS_TAG
rsync -vrm --include='*.json' --include='*.html' --include='examples/***' --include='meta/***' --exclude='*' . gh-pages/$TRAVIS_TAG
fi
deploy:
Expand Down
2 changes: 2 additions & 0 deletions 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 @@ -33,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `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.
- `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
11 changes: 7 additions & 4 deletions aggregate_temporal_period.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@
},
{
"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* `month`: Month of the year\n* `year`: Proleptic years\n* `season`: Refers to three month periods of the calendar seasons (December - February, March - May, June - August, September - November).\n* `tropical-season`: Refers to the six month periods of the tropical seasons (November - April, May - October).",
"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 fourth dekad is Feb, 1 - Feb, 10 each year.\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": [
"hour",
"day",
"week",
"dekad",
"month",
"year",
"season",
"tropical-season"
"tropical-season",
"year",
"decade",
"decade-ad"
]
}
},
Expand Down Expand Up @@ -85,7 +88,7 @@
}
],
"returns": {
"description": "A data cube with potentially lower resolution and cardinality, but the same number of dimensions as the original data cube. The specified temporal dimension has the following dimension labels (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `month`: `YYYY-01` - `YYYY-12`\n* `year`: `YYYY`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).",
"description": "A data cube with potentially lower resolution and cardinality, but the same number of dimensions as the original data cube. The specified temporal dimension has the following dimension labels (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `dekad`: `YYYY-00` - `YYYY-36`\n* `month`: `YYYY-01` - `YYYY-12`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).\n* `year`: `YYYY`\n* `decade`: `YYY0`\n* `decade-ad`: `YYY1`",
"schema": {
"type": "object",
"subtype": "raster-cube"
Expand Down
15 changes: 9 additions & 6 deletions anomaly.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,38 @@
"parameters": [
{
"name": "data",
"description": "A data cube with exactly one temporal dimension and the following dimension labels for the given period (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `month`: `YYYY-01` - `YYYY-12`\n* `year`: `YYYY`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November)\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October)\n\n``aggregate_temporal_period()`` can compute such a data cube.",
"description": "A data cube with exactly one temporal dimension and the following dimension labels for the given period (`YYYY` = four-digit year, `MM` = two-digit month, `DD` two-digit day of month):\n\n* `hour`: `YYYY-MM-DD-00` - `YYYY-MM-DD-23`\n* `day`: `YYYY-001` - `YYYY-365`\n* `week`: `YYYY-01` - `YYYY-52`\n* `dekad`: `YYYY-00` - `YYYY-36`\n* `month`: `YYYY-01` - `YYYY-12`\n* `season`: `YYYY-djf` (December - February), `YYYY-mam` (March - May), `YYYY-jja` (June - August), `YYYY-son` (September - November).\n* `tropical-season`: `YYYY-ndjfma` (November - April), `YYYY-mjjaso` (May - October).\n* `year`: `YYYY`\n* `decade`: `YYY0`\n* `decade-ad`: `YYY1`\n* `single-period` / `climatology-period`: Any\n\n``aggregate_temporal_period()`` can compute such a data cube.",
"schema": {
"type": "object",
"subtype": "raster-cube"
}
},
{
"name": "normals",
"description": "A data cube with normals, e.g. daily, monthly or yearly values computed from a process such as ``climatological_normal()``. Must contain exactly one temporal dimension with the following dimension labels for the given period:\n\n* `hour`: `00` - `23`\n* `day`: `001` - `365`\n* `week`: `01` - `52`\n* `month`: `01` - `12`\n* `year`: Four-digit year numbers\n* `single-period` / `climatology-period`: A single dimension label with any name is expected.\n* `season`: `djf` (December - February), `mam` (March - May), `jja` (June - August), `son` (September - November)\n* `tropical-season`: `ndjfma` (November - April), `mjjaso` (May - October)",
"description": "A data cube with normals, e.g. daily, monthly or yearly values computed from a process such as ``climatological_normal()``. Must contain exactly one temporal dimension with the following dimension labels for the given period:\n\n* `hour`: `00` - `23`\n* `day`: `001` - `365`\n* `week`: `01` - `52`\n* `dekad`: `00` - `36`\n* `month`: `01` - `12`\n* `season`: `djf` (December - February), `mam` (March - May), `jja` (June - August), `son` (September - November)\n* `tropical-season`: `ndjfma` (November - April), `mjjaso` (May - October)\n* `year`: Four-digit year numbers\n* `decade`: Four-digit year numbers, the last digit being a `0`\n* `decade-ad`: Four-digit year numbers, the last digit being a `1`\n* `single-period` / `climatology-period`: A single dimension label with any name is expected.",
"schema": {
"type": "object",
"subtype": "raster-cube"
}
},
{
"name": "period",
"description": "Specifies the time intervals available in the normals data cube. The following options are available:\n\n* `hour`: Hour of the day\n* `day`: Day of the year\n* `week`: Week of the year\n* `month`: Month of the year\n* `year`: Proleptic years\n* `season`: Refers to three month periods of the calendar seasons (December - February, March - May, June - August, September - November).\n* `tropical-season`: Refers to the six month periods of the tropical seasons (November - April, May - October).",
"description": "Specifies the time intervals available in the normals data cube. The following options 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 fourth dekad is Feb, 1 - Feb, 10 each year.\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.\n* `single-period` / `climatology-period`: A single period of arbitrary length",
"schema": {
"type": "string",
"enum": [
"hour",
"day",
"week",
"dekad",
"month",
"season",
"tropical-season",
"year",
"single-period",
"decade",
"decade-ad",
"climatology-period",
"season",
"tropical-season"
"single-period"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion climatological_normal.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
{
"name": "period",
"description": "The time intervals to aggregate the average value for. The following pre-defined frequencies are supported:\n\n* `day`: Day of the year\n* `month`: Month of the year\n* `climatology-period`: The period specified in the `climatology-period`.\n* `season`: Refers to three month periods of the calendar seasons (December - February, March - May, June - August, September - November).\n* `tropical-season`: Refers to the six month periods of the tropical seasons (November - April, May - October).",
"description": "The time intervals to aggregate the average value for. The following pre-defined frequencies are supported:\n\n* `day`: Day of the year\n* `month`: Month of the year\n* `climatology-period`: The period specified in the `climatology-period`.\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).",
"schema": {
"type": "string",
"enum": [
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.\n\nAn array without non-`null` elements resolves always with `null`.",
"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.",
"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.\n\nAn array without non-`null` elements resolves always with `null`.",
"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.",
"schema": {
"type": "array",
"items": {
Expand Down
4 changes: 2 additions & 2 deletions max.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"id": "max",
"summary": "Maximum value",
"description": "Computes the largest value of an array of numbers, which is is equal to the first element of a sorted (i.e., ordered) version the array.",
"description": "Computes the largest value of an array of numbers, which is is equal to the first element of a sorted (i.e., ordered) version the array.\n\nAn array without non-`null` elements resolves always with `null`.",
"categories": [
"math",
"reducer"
],
"parameters": [
{
"name": "data",
"description": "An array of numbers. An empty array resolves always with `null`.",
"description": "An array of numbers.",
"schema": {
"type": "array",
"items": {
Expand Down
4 changes: 2 additions & 2 deletions mean.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"id": "mean",
"summary": "Arithmetic mean (average)",
"description": "The arithmetic mean of an array of numbers is the quantity commonly called the average. It is defined as the sum of all elements divided by the number of elements.",
"description": "The arithmetic mean of an array of numbers is the quantity commonly called the average. It is defined as the sum of all elements divided by the number of elements.\n\nAn array without non-`null` elements resolves always with `null`.",
"categories": [
"math",
"reducer"
],
"parameters": [
{
"name": "data",
"description": "An array of numbers. An array without non-`null` elements resolves always with `null`.",
"description": "An array of numbers.",
"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\nAn array without non-`null` elements resolves always with `null`.\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.",
"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
}
}
}
Loading

0 comments on commit 1418b8a

Please sign in to comment.