From 0833d4ebab71b16a09658c21e7278e40688b3bf1 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Sat, 30 Sep 2023 09:21:44 +0200 Subject: [PATCH 01/14] Issue #460 doc crossreferences between filter_bbox/filter_spatial/filter_vector (#462) --- filter_bbox.json | 2 +- filter_spatial.json | 2 +- proposals/filter_vector.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/filter_bbox.json b/filter_bbox.json index 3e2a7485..e95d5fa2 100644 --- a/filter_bbox.json +++ b/filter_bbox.json @@ -1,7 +1,7 @@ { "id": "filter_bbox", "summary": "Spatial filter using a bounding box", - "description": "Limits the data cube to the specified bounding box.\n\n* For raster data cubes, the filter retains a pixel in the data cube if the point at the pixel center intersects with the bounding box (as defined in the Simple Features standard by the OGC). Alternatively, ``filter_spatial()`` can be used to filter by geometry.\n* For vector data cubes, the filter retains the geometry in the data cube if the geometry is fully within the bounding box (as defined in the Simple Features standard by the OGC). All geometries that were empty or not contained fully within the bounding box will be removed from the data cube.\n\nAlternatively, ``filter_vector()`` can be used to filter by geometry.", + "description": "Limits the data cube to the specified bounding box.\n\n* For raster data cubes, the filter retains a pixel in the data cube if the point at the pixel center intersects with the bounding box (as defined in the Simple Features standard by the OGC). Alternatively, ``filter_spatial()`` can be used to filter by geometry.\n* For vector data cubes, the filter retains the geometry in the data cube if the geometry is fully within the bounding box (as defined in the Simple Features standard by the OGC). All geometries that were empty or not contained fully within the bounding box will be removed from the data cube.\n\nAlternatively, filter spatially with geometries using ``filter_spatial()`` (on a raster data cube) or ``filter_vector()`` (on a vector data cube).", "categories": [ "cubes", "filter" diff --git a/filter_spatial.json b/filter_spatial.json index c0c116cd..f2648b05 100644 --- a/filter_spatial.json +++ b/filter_spatial.json @@ -1,7 +1,7 @@ { "id": "filter_spatial", "summary": "Spatial filter raster data cubes using geometries", - "description": "Limits the raster data cube over the spatial dimensions to the specified geometries.\n\n- For **polygons**, the filter retains a pixel in the data cube if the point at the pixel center intersects with at least one of the polygons (as defined in the Simple Features standard by the OGC).\n- For **points**, the process considers the closest pixel center.\n- For **lines** (line strings), the process considers all the pixels whose centers are closest to at least one point on the line.\n\nMore specifically, pixels outside of the bounding box of the given geometry will not be available after filtering. All pixels inside the bounding box that are not retained will be set to `null` (no data).\n\n Alternatively, use ``filter_bbox()`` to filter by bounding box.", + "description": "Limits the raster data cube over the spatial dimensions to the specified geometries.\n\n- For **polygons**, the filter retains a pixel in the data cube if the point at the pixel center intersects with at least one of the polygons (as defined in the Simple Features standard by the OGC).\n- For **points**, the process considers the closest pixel center.\n- For **lines** (line strings), the process considers all the pixels whose centers are closest to at least one point on the line.\n\nMore specifically, pixels outside of the bounding box of the given geometry will not be available after filtering. All pixels inside the bounding box that are not retained will be set to `null` (no data).\n\n Alternatively, use ``filter_bbox()`` to filter with a bounding box or ``filter_vector()`` to filter a vector data cube based on geometries.", "categories": [ "cubes", "filter" diff --git a/proposals/filter_vector.json b/proposals/filter_vector.json index 349f8d0f..1bb33c86 100644 --- a/proposals/filter_vector.json +++ b/proposals/filter_vector.json @@ -1,7 +1,7 @@ { "id": "filter_vector", "summary": "Spatial vector filter using geometries", - "description": "Limits the vector data cube to the specified geometries. The process works on geometries as defined in the Simple Features standard by the OGC. All geometries that were empty or become empty will be removed from the data cube. Alternatively, use ``filter_bbox()`` to filter by bounding box.", + "description": "Limits the vector data cube to the specified geometries. The process works on geometries as defined in the Simple Features standard by the OGC. All geometries that were empty or become empty will be removed from the data cube. Alternatively, use ``filter_bbox()`` to filter with a bounding box or ``filter_spatial()`` to filter a raster data cube based on geometries.", "categories": [ "cubes", "filter", From c130dd732c912624dea89c8eb15134c1378bd9e7 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 12 Oct 2023 11:24:39 +0200 Subject: [PATCH 02/14] Move tests to dev --- .github/workflows/docs.yml | 6 +++--- .github/workflows/tests.yml | 6 +++--- README.md | 2 +- {tests => dev}/.gitignore | 0 {tests => dev}/.words | 0 {tests => dev}/README.md | 0 {tests => dev}/docs.html | 0 {tests => dev}/package.json | 0 {tests => dev}/testConfig.json | 0 9 files changed, 7 insertions(+), 7 deletions(-) rename {tests => dev}/.gitignore (100%) rename {tests => dev}/.words (100%) rename {tests => dev}/README.md (100%) rename {tests => dev}/docs.html (100%) rename {tests => dev}/package.json (100%) rename {tests => dev}/testConfig.json (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 29baf6db..b09f6e3d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: - run: | npm install npm run generate - working-directory: tests + working-directory: dev - name: clone gh-pages and clean-up if: ${{ env.GITHUB_REF_SLUG == 'master' }} run: | @@ -31,8 +31,8 @@ jobs: if: ${{ env.GITHUB_REF_SLUG != 'master' }} run: mkdir gh-pages - run: | - cp tests/docs.html index.html - cp tests/processes.json processes.json + cp dev/docs.html index.html + cp dev/processes.json processes.json rsync -vrm --include='*.json' --include='*.html' --include='meta/***' --include='proposals/***' --exclude='*' . gh-pages - name: deploy to root (master) uses: peaceiris/actions-gh-pages@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b108eb18..25659365 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,8 +8,8 @@ jobs: with: node-version: 'lts/*' - uses: actions/checkout@v3 - - name: Run tests + - name: Run linter run: | npm install - npm run test - working-directory: tests \ No newline at end of file + npm test + working-directory: dev \ No newline at end of file diff --git a/README.md b/README.md index 24c28899..621276b6 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ This repository contains a set of files formally describing the openEO Processes * [implementation.md](meta/implementation.md) in the `meta` folder provide some additional implementation details for back-ends. For back-end implementors, it's highly recommended to read them. * [subtype-schemas.json](meta/subtype-schemas.json) in the `meta` folder defines common data types (`subtype`s) for JSON Schema used in openEO processes. * Previously, an `examples` folder contained examples of user-defined processes. These have been migrated to the [openEO Community Examples](https://github.com/Open-EO/openeo-community-examples/tree/main/processes) repository. -* The [`tests`](tests/) folder can be used to test the process specification for validity and consistent "style". It also allows rendering the processes in a web browser. Check the [tests documentation](tests/README.md) for details. +* The [`dev`](dev/) folder can be used to test the process specification for validity and consistent "style". It also allows rendering the processes in a web browser. Check the [development documentation](dev/README.md) for details. ## Process diff --git a/tests/.gitignore b/dev/.gitignore similarity index 100% rename from tests/.gitignore rename to dev/.gitignore diff --git a/tests/.words b/dev/.words similarity index 100% rename from tests/.words rename to dev/.words diff --git a/tests/README.md b/dev/README.md similarity index 100% rename from tests/README.md rename to dev/README.md diff --git a/tests/docs.html b/dev/docs.html similarity index 100% rename from tests/docs.html rename to dev/docs.html diff --git a/tests/package.json b/dev/package.json similarity index 100% rename from tests/package.json rename to dev/package.json diff --git a/tests/testConfig.json b/dev/testConfig.json similarity index 100% rename from tests/testConfig.json rename to dev/testConfig.json From c2d77e2e5fea0cafc6576d10a97d472aa6616ffb Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 25 Oct 2023 14:51:17 +0200 Subject: [PATCH 03/14] Use x \ y instead of a \ b --- and.json | 4 ++-- or.json | 4 ++-- xor.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/and.json b/and.json index c24ce95b..3b28c8ef 100644 --- a/and.json +++ b/and.json @@ -1,7 +1,7 @@ { "id": "and", "summary": "Logical AND", - "description": "Checks if **both** values are true.\n\nEvaluates parameter `x` before `y` and stops once the outcome is unambiguous. If any argument is `null`, the result will be `null` if the outcome is ambiguous.\n\n**Truth table:**\n\n```\na \\ b || null | false | true\n----- || ----- | ----- | -----\nnull || null | false | null\nfalse || false | false | false\ntrue || null | false | true\n```", + "description": "Checks if **both** values are true.\n\nEvaluates parameter `x` before `y` and stops once the outcome is unambiguous. If any argument is `null`, the result will be `null` if the outcome is ambiguous.\n\n**Truth table:**\n\n```\nx \\ y || null | false | true\n----- || ----- | ----- | -----\nnull || null | false | null\nfalse || false | false | false\ntrue || null | false | true\n```", "categories": [ "logic" ], @@ -90,4 +90,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/or.json b/or.json index 5964a341..4a83a63e 100644 --- a/or.json +++ b/or.json @@ -1,7 +1,7 @@ { "id": "or", "summary": "Logical OR", - "description": "Checks if **at least one** of the values is true. Evaluates parameter `x` before `y` and stops once the outcome is unambiguous. If a component is `null`, the result will be `null` if the outcome is ambiguous.\n\n**Truth table:**\n\n```\na \\ b || null | false | true\n----- || ---- | ----- | ----\nnull || null | null | true\nfalse || null | false | true\ntrue || true | true | true\n```", + "description": "Checks if **at least one** of the values is true. Evaluates parameter `x` before `y` and stops once the outcome is unambiguous. If a component is `null`, the result will be `null` if the outcome is ambiguous.\n\n**Truth table:**\n\n```\nx \\ y || null | false | true\n----- || ---- | ----- | ----\nnull || null | null | true\nfalse || null | false | true\ntrue || true | true | true\n```", "categories": [ "logic" ], @@ -90,4 +90,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/xor.json b/xor.json index d8dbde50..6af7ae5e 100644 --- a/xor.json +++ b/xor.json @@ -1,7 +1,7 @@ { "id": "xor", "summary": "Logical XOR (exclusive or)", - "description": "Checks if **exactly one** of the values is true. If a component is `null`, the result will be `null` if the outcome is ambiguous.\n\n**Truth table:**\n\n```\na \\ b || null | false | true\n----- || ---- | ----- | -----\nnull || null | null | null\nfalse || null | false | true\ntrue || null | true | false\n```", + "description": "Checks if **exactly one** of the values is true. If a component is `null`, the result will be `null` if the outcome is ambiguous.\n\n**Truth table:**\n\n```\nx \\ y || null | false | true\n----- || ---- | ----- | -----\nnull || null | null | null\nfalse || null | false | true\ntrue || null | true | false\n```", "categories": [ "logic" ], @@ -125,4 +125,4 @@ "result": true } } -} \ No newline at end of file +} From 13c3f85696d6f142f68694ba4726337b1fecca28 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 27 Oct 2023 11:07:14 +0200 Subject: [PATCH 04/14] `sqrt`: Clarified that NaN is returned for negative numbers #474 (#475) --- CHANGELOG.md | 4 ++++ sqrt.json | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 407447dc..78b16e73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased / Draft +### Fixed + +- `sqrt`: Clarified that NaN is returned for negative numbers. + ## [2.0.0-rc.1] - 2023-05-25 ### Added diff --git a/sqrt.json b/sqrt.json index bc1aeb6c..b85caf94 100644 --- a/sqrt.json +++ b/sqrt.json @@ -1,7 +1,7 @@ { "id": "sqrt", "summary": "Square root", - "description": "Computes the square root of a real number `x`, which is equal to calculating `x` to the power of *0.5*.\n\nA square root of x is a number a such that *`a² = x`*. Therefore, the square root is the inverse function of a to the power of 2, but only for *a >= 0*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the square root of a real number `x`, which is equal to calculating `x` to the power of *0.5*. For negative `x`, the process returns `NaN`.\n\nA square root of x is a number a such that *`a² = x`*. Therefore, the square root is the inverse function of a to the power of 2, but only for *a >= 0*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math", "math > exponential & logarithmic" @@ -58,6 +58,11 @@ "rel": "about", "href": "http://mathworld.wolfram.com/SquareRoot.html", "title": "Square root explained by Wolfram MathWorld" + }, + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/8766229", + "title": "IEEE Standard 754-2019 for Floating-Point Arithmetic" } ], "process_graph": { @@ -72,4 +77,4 @@ "result": true } } -} \ No newline at end of file +} From 4fd92b217ec84bfb27273c2d1acdb8418574b7b7 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 27 Oct 2023 11:08:00 +0200 Subject: [PATCH 05/14] `clip`: Throw an exception if min > max #472 (#477) --- CHANGELOG.md | 4 ++++ clip.json | 40 ++++++++-------------------------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78b16e73..281ab2d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased / Draft +### Changed + +- `clip`: Throw an exception if min > max [#472](https://github.com/Open-EO/openeo-processes/issues/472) + ### Fixed - `sqrt`: Clarified that NaN is returned for negative numbers. diff --git a/clip.json b/clip.json index adbf7eaa..de2a4d1a 100644 --- a/clip.json +++ b/clip.json @@ -1,7 +1,7 @@ { "id": "clip", "summary": "Clip a value between a minimum and a maximum", - "description": "Clips a number between specified minimum and maximum values. A value larger than the maximum value is set to the maximum value, a value lower than the minimum value is set to the minimum value.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Clips a number between specified minimum and maximum values. A value larger than the maximum value is set to the maximum value, a value lower than the minimum value is set to the minimum value. If the maximum value is smaller than the minimum number, the process throws a `MinMaxSwapped` exception.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math" ], @@ -40,6 +40,11 @@ ] } }, + "exceptions": { + "MinMaxSwapped": { + "message": "The minimum value should be lower than or equal to the maximum value." + } + }, "examples": [ { "arguments": { @@ -73,34 +78,5 @@ }, "returns": null } - ], - "process_graph": { - "min": { - "process_id": "min", - "arguments": { - "data": [ - { - "from_parameter": "max" - }, - { - "from_parameter": "x" - } - ] - } - }, - "max": { - "process_id": "max", - "arguments": { - "data": [ - { - "from_parameter": "min" - }, - { - "from_node": "min" - } - ] - }, - "result": true - } - } -} \ No newline at end of file + ] +} From ab4a62eb3fc3eac0c66a51f5670aa131e52c0745 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 27 Oct 2023 12:24:32 +0200 Subject: [PATCH 06/14] `array_append`: Added `number` type for labels to be consistent with other processes. Default to numerical index instead of string. (#478) --- CHANGELOG.md | 4 ++++ array_append.json | 22 +++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 281ab2d8..0319d15d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.0.0-rc.1] - 2023-05-25 +### Fixed + +- `array_append`: Added `number` type for labels to be consistent with other processes. Default to numerical index instead of string. Clarify that the `label` parameter only applies to labeled arrays. + ### Added - New processes in proposal state: diff --git a/array_append.json b/array_append.json index 80b48d12..f09145d2 100644 --- a/array_append.json +++ b/array_append.json @@ -25,15 +25,20 @@ }, { "name": "label", - "description": "If the given array is a labeled array, a new label for the new value should be given. If not given or `null`, the array index as string is used as the label. If in any case the label exists, a `LabelExists` exception is thrown.", + "description": "Provides a label for the new value. If not given or `null`, the natural next array index as number is used as the label. If in any case the label exists, a `LabelExists` exception is thrown.\n\nThis parameter only applies if the given array is a labeled array. If a non-null values is provided and the array is not labeled, an `ArrayNotLabeled` exception is thrown.", "optional": true, "default": null, - "schema": { - "type": [ - "string", - "null" - ] - } + "schema": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "null" + } + ] } ], "returns": { @@ -48,6 +53,9 @@ "exceptions": { "LabelExists": { "message": "An array element with the specified label already exists." + }, + "ArrayNotLabeled": { + "message": "A label can't be provided as the given array is not labeled." } }, "examples": [ From f303adfce42cba91cd436934766cfa82dddd7b53 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 27 Oct 2023 12:29:23 +0200 Subject: [PATCH 07/14] `filter_spatial`: Clarify masking (#470) * `filter_spatial`: Clarified that a masking get applied for the given geometries. #469 * `filter_bbox`: Clarified that the bounding box is reprojected to the CRS of the spatial data cube dimensions if required. --------- Co-authored-by: Stefaan Lippens --- CHANGELOG.md | 2 ++ dev/.words | 1 + filter_bbox.json | 2 +- filter_spatial.json | 4 ++-- load_collection.json | 2 +- proposals/load_stac.json | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0319d15d..f3cf3bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `filter_bbox`, `load_collection`, `load_stac`: Clarified that the bounding box is reprojected to the CRS of the spatial data cube dimensions if required. +- `filter_spatial`: Clarified that masking is applied using the given geometries. [#469](https://github.com/Open-EO/openeo-processes/issues/469) - `sqrt`: Clarified that NaN is returned for negative numbers. ## [2.0.0-rc.1] - 2023-05-25 diff --git a/dev/.words b/dev/.words index a50285ba..846e729a 100644 --- a/dev/.words +++ b/dev/.words @@ -23,6 +23,7 @@ orthorectified radiometrically reflectances reproject +reprojected Reprojects resample resampled diff --git a/filter_bbox.json b/filter_bbox.json index e95d5fa2..b7335847 100644 --- a/filter_bbox.json +++ b/filter_bbox.json @@ -39,7 +39,7 @@ }, { "name": "extent", - "description": "A bounding box, which may include a vertical axis (see `base` and `height`).", + "description": "A bounding box, which may include a vertical axis (see `base` and `height`).\n\nIf the bounding box is not provided in the coordinate reference system (CRS) of the data cube, the bounding box is reprojected to the CRS of the spatial data cube dimensions.", "schema": { "type": "object", "subtype": "bounding-box", diff --git a/filter_spatial.json b/filter_spatial.json index f2648b05..ed4f7c3f 100644 --- a/filter_spatial.json +++ b/filter_spatial.json @@ -1,7 +1,7 @@ { "id": "filter_spatial", "summary": "Spatial filter raster data cubes using geometries", - "description": "Limits the raster data cube over the spatial dimensions to the specified geometries.\n\n- For **polygons**, the filter retains a pixel in the data cube if the point at the pixel center intersects with at least one of the polygons (as defined in the Simple Features standard by the OGC).\n- For **points**, the process considers the closest pixel center.\n- For **lines** (line strings), the process considers all the pixels whose centers are closest to at least one point on the line.\n\nMore specifically, pixels outside of the bounding box of the given geometry will not be available after filtering. All pixels inside the bounding box that are not retained will be set to `null` (no data).\n\n Alternatively, use ``filter_bbox()`` to filter with a bounding box or ``filter_vector()`` to filter a vector data cube based on geometries.", + "description": "Limits the raster data cube over the spatial dimensions to the specified geometries.\n\n- For **polygons**, the filter retains a pixel in the data cube if the point at the pixel center intersects with at least one of the polygons (as defined in the Simple Features standard by the OGC).\n- For **points**, the process considers the closest pixel center.\n- For **lines** (line strings), the process considers all the pixels whose centers are closest to at least one point on the line.\n\nMore specifically, pixels outside of the bounding box of the given geometries will not be available after filtering. All pixels inside the bounding box that are not retained will be set to `null` (no data).\n\n Alternatively, use ``filter_bbox()`` to filter with a bounding box or ``filter_vector()`` to filter a vector data cube based on geometries. Use ``mask_polygon()`` to mask without changing the spatial extent of your data cube.", "categories": [ "cubes", "filter" @@ -26,7 +26,7 @@ }, { "name": "geometries", - "description": "One or more geometries used for filtering, given as GeoJSON or vector data cube. If multiple geometries are provided, the union of them is used. Empty geometries are ignored.\n\nLimits the data cube to the bounding box of the given geometries. No implicit masking gets applied. To mask the pixels of the data cube use ``mask_polygon()``.", + "description": "One or more geometries used for spatial filtering and masking, given as GeoJSON or vector data cube.", "schema": [ { "title": "Vector Data Cube", diff --git a/load_collection.json b/load_collection.json index b93c879c..a6701cc3 100644 --- a/load_collection.json +++ b/load_collection.json @@ -64,7 +64,7 @@ "default": null }, "crs": { - "description": "Coordinate reference system of the extent, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). Defaults to `4326` (EPSG code 4326) unless the client explicitly requests a different coordinate reference system.", + "description": "Coordinate reference system of the extent, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). Defaults to `4326` (EPSG code 4326) unless the client explicitly requests a different coordinate reference system. If the bounding box is not provided in the coordinate reference system (CRS) of the data cube, the bounding box is reprojected to the CRS of the spatial data cube dimensions.", "anyOf": [ { "title": "EPSG Code", diff --git a/proposals/load_stac.json b/proposals/load_stac.json index c71d3a80..262745fc 100644 --- a/proposals/load_stac.json +++ b/proposals/load_stac.json @@ -67,7 +67,7 @@ "default": null }, "crs": { - "description": "Coordinate reference system of the extent, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). Defaults to `4326` (EPSG code 4326) unless the client explicitly requests a different coordinate reference system.", + "description": "Coordinate reference system of the extent, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). Defaults to `4326` (EPSG code 4326) unless the client explicitly requests a different coordinate reference system. If the bounding box is not provided in the coordinate reference system (CRS) of the data cube, the bounding box is reprojected to the CRS of the spatial data cube dimensions.", "anyOf": [ { "title": "EPSG Code", From d8cf96a68f421a02f2e704ae6080a87841f206e1 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 17:02:00 +0100 Subject: [PATCH 08/14] `between`: Clarify that `null` is passed through --- CHANGELOG.md | 1 + between.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3cf3bc8..87dbf987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `between`: Clarify that `null` is passed through. - `filter_bbox`, `load_collection`, `load_stac`: Clarified that the bounding box is reprojected to the CRS of the spatial data cube dimensions if required. - `filter_spatial`: Clarified that masking is applied using the given geometries. [#469](https://github.com/Open-EO/openeo-processes/issues/469) - `sqrt`: Clarified that NaN is returned for negative numbers. diff --git a/between.json b/between.json index b2e59b92..12e37693 100644 --- a/between.json +++ b/between.json @@ -8,7 +8,7 @@ "parameters": [ { "name": "x", - "description": "The value to check.", + "description": "The value to check.\n\nThe no-data value `null` is passed through and therefore gets propagated.", "schema": { "description": "Any data type is allowed." } @@ -38,7 +38,7 @@ } ], "returns": { - "description": "`true` if `x` is between the specified bounds, otherwise `false`.", + "description": "`true` if `x` is between the specified bounds, `null` if `x` is a no-data value, `false` otherwise.", "schema": { "type": [ "boolean", From 899b8249911fc6f978661bfc63442696bfaeb6f8 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 18:26:09 +0100 Subject: [PATCH 09/14] `eq` and `neq`: Explicitly set the minimum value for the `delta` parameter. --- CHANGELOG.md | 1 + eq.json | 3 ++- neq.json | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87dbf987..c2a4f1d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - `between`: Clarify that `null` is passed through. +- `eq` and `neq`: Explicitly set the minimum value for the `delta` parameter. - `filter_bbox`, `load_collection`, `load_stac`: Clarified that the bounding box is reprojected to the CRS of the spatial data cube dimensions if required. - `filter_spatial`: Clarified that masking is applied using the given geometries. [#469](https://github.com/Open-EO/openeo-processes/issues/469) - `sqrt`: Clarified that NaN is returned for negative numbers. diff --git a/eq.json b/eq.json index e7712399..0c62b42c 100644 --- a/eq.json +++ b/eq.json @@ -38,7 +38,8 @@ "type": [ "number", "null" - ] + ], + "minimumExclusive": 0 }, "default": null, "optional": true diff --git a/neq.json b/neq.json index ff6bc9fd..0e22b347 100644 --- a/neq.json +++ b/neq.json @@ -38,7 +38,8 @@ "type": [ "number", "null" - ] + ], + "minimumExclusive": 0 }, "default": null, "optional": true From ab2e6c233a073a1ac23abc004216794127b32c2c Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 31 Oct 2023 16:10:18 +0100 Subject: [PATCH 10/14] Clarify linear_scale_range --- linear_scale_range.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linear_scale_range.json b/linear_scale_range.json index 172027c9..01f09857 100644 --- a/linear_scale_range.json +++ b/linear_scale_range.json @@ -1,7 +1,7 @@ { "id": "linear_scale_range", "summary": "Linear transformation between two ranges", - "description": "Performs a linear transformation between the input and output range.\n\nThe given number in `x` is clipped to the bounds specified in `inputMin` and `inputMax` so that the underlying formula *`((x - inputMin) / (inputMax - inputMin)) * (outputMax - outputMin) + outputMin`* never returns any value lower than `outputMin` or greater than `outputMax`.\n\nPotential use case include\n\n* scaling values to the 8-bit range (0 - 255) often used for numeric representation of values in one of the channels of the [RGB colour model](https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations) or\n* calculating percentages (0 - 100).\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Performs a linear transformation between the input and output range.\n\nThe given number in `x` is clipped to the bounds specified in `inputMin` and `inputMax` so that the underlying formula *`((x - inputMin) / (inputMax - inputMin)) * (outputMax - outputMin) + outputMin`* never returns a value outside of the range defined by `outputMin` and `outputMax`.\n\nPotential use case include\n\n* scaling values to the 8-bit range (0 - 255) often used for numeric representation of values in one of the channels of the [RGB colour model](https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations) or\n* calculating percentages (0 - 100).\n\nThe no-data value `null` is passed through and therefore gets propagated.", "categories": [ "math" ], @@ -166,4 +166,4 @@ "result": true } } -} \ No newline at end of file +} From 78e1d19bc4c9c26877916d0e72cbd17076c88d0d Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Tue, 5 Dec 2023 16:00:34 +0100 Subject: [PATCH 11/14] ml support vector classification --- dev/.words | 3 +++ dev/testConfig.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/.words b/dev/.words index 846e729a..07712aa6 100644 --- a/dev/.words +++ b/dev/.words @@ -48,3 +48,6 @@ Hyndman date1 date2 favor +Cortes +Vapnik +rbf diff --git a/dev/testConfig.json b/dev/testConfig.json index 9b5fbcb2..b712c156 100644 --- a/dev/testConfig.json +++ b/dev/testConfig.json @@ -11,4 +11,4 @@ "forbidDeprecatedTypes": false, "checkProcessLinks": true, "verbose": false -} +} \ No newline at end of file From 1efb0cc0c02ac63bb8cc8b584015f818de68450c Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Tue, 5 Dec 2023 16:04:57 +0100 Subject: [PATCH 12/14] ml support vector classification --- CHANGELOG.md | 1 + meta/subtype-schemas.json | 8 +- proposals/ml_fit_class_support_vector.json | 153 +++++++++++++++++++++ 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 proposals/ml_fit_class_support_vector.json diff --git a/CHANGELOG.md b/CHANGELOG.md index c2a4f1d7..b5579592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `flatten_dimensions` - `load_geojson` - `load_url` + - `ml_fit_class_support_vector` - `unflatten_dimension` - `vector_buffer` - `vector_reproject` diff --git a/meta/subtype-schemas.json b/meta/subtype-schemas.json index 347df234..6809dcb1 100644 --- a/meta/subtype-schemas.json +++ b/meta/subtype-schemas.json @@ -232,6 +232,12 @@ } } }, + "ml-model": { + "type": "object", + "subtype": "ml-model", + "title": "Machine Learning Model", + "description": "A machine learning model, accompanied with STAC metadata that implements the the STAC ml-model extension." + }, "output-format": { "type": "string", "subtype": "output-format", @@ -420,4 +426,4 @@ "description": "Year as integer, can be any number of digits and can be negative." } } -} +} \ No newline at end of file diff --git a/proposals/ml_fit_class_support_vector.json b/proposals/ml_fit_class_support_vector.json new file mode 100644 index 00000000..aab18302 --- /dev/null +++ b/proposals/ml_fit_class_support_vector.json @@ -0,0 +1,153 @@ +{ + "id": "ml_fit_class_support_vector", + "summary": "Train a support vector classification model", + "description": "Executes the fit of a support vector classification model based on training data. The support vector classification model aims to find a hyperplane that best separates different classes in the feature space.", + "categories": [ + "machine learning" + ], + "experimental": true, + "parameters": [ + { + "name": "predictors", + "description": "The predictors for the classification model as a vector data cube. Aggregated to the features (vectors) of the target input variable.", + "schema": [ + { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + }, + { + "type": "bands" + } + ] + }, + { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + }, + { + "type": "other" + } + ] + } + ] + }, + { + "name": "target", + "description": "The training sites for the classification model as a vector data cube. This is associated with the target variable for the support vector classification model. The geometry has to be associated with a class label.", + "schema": { + "type": "object", + "subtype": "datacube", + "dimensions": [ + { + "type": "geometry" + } + ] + } + }, + { + "name": "kernel", + "description": "Specifies the kernel type to be used in the algorithm.", + "schema": { + "type": "string", + "enum": [ + "linear", + "poly", + "rbf", + "sigmoid" + ], + "default": "rbf" + } + }, + { + "name": "C", + "description": "Regularization parameter. The strength of the regularization is inversely proportional to C. Must be strictly positive.", + "schema": { + "type": "number", + "minimum": 0, + "default": 1 + } + }, + { + "name": "gamma", + "description": "Kernel coefficient for 'rbf', 'poly', and 'sigmoid'. Higher values lead to tighter fits.", + "optional": true, + "default": 1, + "schema": { + "type": "number", + "minimum": 0 + } + }, + { + "name": "degree", + "description": "Degree of the polynomial kernel function (only relevant for 'poly' kernel).", + "optional": true, + "default": 3, + "schema": { + "type": "integer", + "minimum": 1 + } + }, + { + "name": "coef0", + "description": "Independent term in the kernel function (only relevant for 'poly' and 'sigmoid' kernels).", + "optional": true, + "default": 0, + "schema": { + "type": "number" + } + }, + { + "name": "tolerance", + "description": "Tolerance of termination criterion.", + "optional": true, + "default": 0.001, + "schema": { + "type": "number", + "minimum": 0 + } + }, + { + "name": "cachesize", + "description": "Size of the kernel cache in MB.", + "optional": true, + "default": 1000, + "schema": { + "type": "integer", + "minimum": 1 + } + }, + { + "name": "seed", + "description": "A randomization seed to use for the random sampling in training. If not given or `null`, no seed is used and results may differ on subsequent use.", + "optional": true, + "default": null, + "schema": { + "type": [ + "integer", + "null" + ] + } + } + ], + "returns": { + "description": "A model object that can be saved with ``save_ml_model()`` and restored with ``load_ml_model()``.", + "schema": { + "type": "object", + "subtype": "ml-model" + } + }, + "links": [ + { + "href": "https://link.springer.com/article/10.1007/BF00994018", + "title": "C. Cortes and V. Vapnik (1995), Support-vector networks", + "type": "text/html", + "rel": "about" + } + ] +} \ No newline at end of file From f86e7e6ab0d41e06412f6afd3b7bf62c5427c2f0 Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Tue, 5 Dec 2023 16:24:26 +0100 Subject: [PATCH 13/14] no cross reference --- proposals/ml_fit_class_support_vector.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/ml_fit_class_support_vector.json b/proposals/ml_fit_class_support_vector.json index aab18302..aa1145fa 100644 --- a/proposals/ml_fit_class_support_vector.json +++ b/proposals/ml_fit_class_support_vector.json @@ -136,7 +136,7 @@ } ], "returns": { - "description": "A model object that can be saved with ``save_ml_model()`` and restored with ``load_ml_model()``.", + "description": "A model object that can be saved with `save_ml_model()` and restored with `load_ml_model()`.", "schema": { "type": "object", "subtype": "ml-model" From 28ecc03a01969109081f5c20555455c0e9e5e7c1 Mon Sep 17 00:00:00 2001 From: Brian Pondi Date: Wed, 6 Dec 2023 23:41:27 +0100 Subject: [PATCH 14/14] target redefined --- proposals/ml_fit_class_support_vector.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/ml_fit_class_support_vector.json b/proposals/ml_fit_class_support_vector.json index aa1145fa..ea4cc7d9 100644 --- a/proposals/ml_fit_class_support_vector.json +++ b/proposals/ml_fit_class_support_vector.json @@ -39,7 +39,7 @@ }, { "name": "target", - "description": "The training sites for the classification model as a vector data cube. This is associated with the target variable for the support vector classification model. The geometry has to be associated with a class label.", + "description": "Labeled information for training the support vector classification model. Each entry corresponds to a set of features (predictors).", "schema": { "type": "object", "subtype": "datacube",