From a3710ad96bf16934259da87f1d92be93930cf235 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 3 Jan 2024 14:01:54 +0100 Subject: [PATCH 01/39] Clarify no-data value / null for most processes #480 --- CHANGELOG.md | 14 ++++++----- absolute.json | 2 +- add.json | 4 ++-- aggregate_temporal.json | 2 +- aggregate_temporal_period.json | 2 +- all.json | 6 ++--- and.json | 2 +- any.json | 6 ++--- apply_neighborhood.json | 2 +- arccos.json | 2 +- arcosh.json | 2 +- arcsin.json | 2 +- arctan.json | 2 +- arctan2.json | 4 ++-- array_contains.json | 4 ++-- array_element.json | 4 ++-- array_find.json | 16 ++----------- array_interpolate_linear.json | 6 ++--- arsinh.json | 2 +- artanh.json | 2 +- between.json | 4 ++-- ceil.json | 4 ++-- clip.json | 2 +- cos.json | 2 +- cosh.json | 2 +- divide.json | 2 +- eq.json | 18 ++------------- exp.json | 2 +- extrema.json | 16 +++---------- filter_spatial.json | 2 +- first.json | 13 +++-------- floor.json | 4 ++-- gt.json | 11 ++------- gte.json | 11 ++------- if.json | 4 ++-- int.json | 4 ++-- is_nodata.json | 2 +- last.json | 13 +++-------- linear_scale_range.json | 2 +- ln.json | 2 +- load_collection.json | 4 ++-- log.json | 2 +- lt.json | 11 ++------- lte.json | 11 ++------- mask.json | 4 ++-- mask_polygon.json | 4 ++-- max.json | 13 +++-------- mean.json | 23 +++---------------- median.json | 23 +++---------------- merge_cubes.json | 2 +- meta/implementation.md | 22 ++++++++++++++++++ min.json | 6 ++--- mod.json | 2 +- multiply.json | 4 ++-- neq.json | 11 ++------- not.json | 4 ++-- or.json | 2 +- order.json | 2 +- power.json | 4 ++-- product.json | 6 ++--- proposals/aggregate_spatial_window.json | 2 +- proposals/apply_polygon.json | 2 +- .../ard_normalized_radar_backscatter.json | 4 ++-- proposals/ard_surface_reflectance.json | 4 ++-- proposals/atmospheric_correction.json | 2 +- proposals/cummax.json | 6 ++--- proposals/cummin.json | 6 ++--- proposals/cumproduct.json | 6 ++--- proposals/cumsum.json | 6 ++--- proposals/fit_curve.json | 2 +- proposals/load_geojson.json | 2 +- proposals/load_stac.json | 4 ++-- proposals/predict_curve.json | 2 +- proposals/sar_backscatter.json | 4 ++-- proposals/vector_to_random_points.json | 2 +- quantiles.json | 2 +- resample_cube_temporal.json | 4 ++-- resample_spatial.json | 2 +- round.json | 2 +- sd.json | 13 +++-------- sgn.json | 2 +- sin.json | 2 +- sinh.json | 2 +- sort.json | 2 +- sqrt.json | 2 +- subtract.json | 4 ++-- sum.json | 6 ++--- tan.json | 2 +- tanh.json | 2 +- text_begins.json | 2 +- text_contains.json | 2 +- text_ends.json | 2 +- variance.json | 13 +++-------- xor.json | 2 +- 94 files changed, 186 insertions(+), 302 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a301787..f4811eee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,21 +8,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- `clip`: Throw an exception if min > max [#472](https://github.com/Open-EO/openeo-processes/issues/472) +- Clarified for various mathematical functions the defined input and output ranges. Mention that `NaN` is returned outside of the defined input range where possible. +- Clarified for various processes the handling of no-data values and null, see also the [implementation guide](meta/implementation.md). [#480](https://github.com/Open-EO/openeo-processes/issues/480) - Added a uniqueness contraint to various array-typed parameters (e.g. lists of dimension names or labels) +- `array_interpolate_linear`: Apply interpolation to NaN and no-data values. +- `clip`: Throw an exception if min > max. [#472](https://github.com/Open-EO/openeo-processes/issues/472) ### Fixed -- Clarified for various mathematical functions the defined input and output ranges. Mention that `NaN` is returned outside of the defined input range where possible. - `aggregate_temporal` and `aggregate_temporal_period`: Clarified that the process throws a `DimensionNotAvailable` exception when no temporal dimension exists. -- `aggregate_temporal_period`: Removed unused exception `DistinctDimensionLabelsRequired` -- `aggregate_temporal_period`: Clarified that the definition of weeks follows ISO 8601 -- `divide`: Clarified behavior for division by 0 +- `aggregate_temporal_period`: Removed unused exception `DistinctDimensionLabelsRequired`. +- `aggregate_temporal_period`: Clarified that the definition of weeks follows ISO 8601. +- `divide`: Clarified behavior for division by 0. - `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) -- `mod`: Clarified behavior for y = 0 +- `mod`: Clarified behavior for y = 0. - `sqrt`: Clarified that NaN is returned for negative numbers. ## [2.0.0-rc.1] - 2023-05-25 diff --git a/absolute.json b/absolute.json index c6a3713d..fa5d003f 100644 --- a/absolute.json +++ b/absolute.json @@ -1,7 +1,7 @@ { "id": "absolute", "summary": "Absolute value", - "description": "Computes the absolute value of a real number `x`, which is the \"unsigned\" portion of `x` and often denoted as *|x|*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the absolute value of a real number `x`, which is the \"unsigned\" portion of `x` and often denoted as *|x|*.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math" ], diff --git a/add.json b/add.json index ac65541c..434e6ba5 100644 --- a/add.json +++ b/add.json @@ -1,7 +1,7 @@ { "id": "add", "summary": "Addition of two numbers", - "description": "Sums up the two numbers `x` and `y` (*`x + y`*) and returns the computed sum.\n\nNo-data values are taken into account so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", + "description": "Sums up the two numbers `x` and `y` (*`x + y`*) and returns the computed sum.\n\nNo-data values are taken into account so that the no-data value is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", "categories": [ "math" ], @@ -88,4 +88,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/aggregate_temporal.json b/aggregate_temporal.json index 2c66e0f2..5576a7e4 100644 --- a/aggregate_temporal.json +++ b/aggregate_temporal.json @@ -89,7 +89,7 @@ }, { "name": "reducer", - "description": "A reducer to be applied for the values contained in each interval. A reducer is a single process such as ``mean()`` or a set of processes, which computes a single value for a list of values, see the category 'reducer' for such processes. Intervals may not contain any values, which for most reducers leads to no-data (`null`) values by default.", + "description": "A reducer to be applied for the values contained in each interval. A reducer is a single process such as ``mean()`` or a set of processes, which computes a single value for a list of values, see the category 'reducer' for such processes. Intervals may not contain any values, which leads to a no-data value for most reducers by default.", "schema": { "type": "object", "subtype": "process-graph", diff --git a/aggregate_temporal_period.json b/aggregate_temporal_period.json index 446afa8d..cc0c4161 100644 --- a/aggregate_temporal_period.json +++ b/aggregate_temporal_period.json @@ -42,7 +42,7 @@ }, { "name": "reducer", - "description": "A reducer to be applied for the values contained in each period. A reducer is a single process such as ``mean()`` or a set of processes, which computes a single value for a list of values, see the category 'reducer' for such processes. Periods may not contain any values, which for most reducers leads to no-data (`null`) values by default.", + "description": "A reducer to be applied for the values contained in each period. A reducer is a single process such as ``mean()`` or a set of processes, which computes a single value for a list of values, see the category 'reducer' for such processes. Periods may not contain any values, which leads to a no-data value for most reducers by default.", "schema": { "type": "object", "subtype": "process-graph", diff --git a/all.json b/all.json index b12059de..2e8bec38 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 `null`.\n\nBy default all no-data values are ignored so that the process returns `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 || null | false | true\n----- || ----- | ----- | -----\nnull || null | false | null\nfalse || false | false | false\ntrue || null | 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 `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.", "categories": [ "logic", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not and ignores them by default.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default.", "schema": { "type": "boolean" }, @@ -131,4 +131,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/and.json b/and.json index 3b28c8ef..87c21f01 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```\nx \\ y || 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 a no-data value, the result will be the no-data value whenever the outcome is ambiguous.\n\n**Truth table:**\n\n```\nx \\ y || no-data | false | true\n------- || ------- | ----- | -------\nno-data || no-data | false | no-data\nfalse || false | false | false\ntrue || no-data | false | true\n```", "categories": [ "logic" ], diff --git a/any.json b/any.json index 545c1669..f54c9cf4 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 `null`.\n\nBy default all no-data values are ignored so that the process returns `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 || null | false | true\n----- || ---- | ----- | ----\nnull || null | null | true\nfalse || null | 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 `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`.", "categories": [ "logic", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not and ignores them by default.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default.", "schema": { "type": "boolean" }, @@ -131,4 +131,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/apply_neighborhood.json b/apply_neighborhood.json index 87f2b1dd..dd7a89d9 100644 --- a/apply_neighborhood.json +++ b/apply_neighborhood.json @@ -1,7 +1,7 @@ { "id": "apply_neighborhood", "summary": "Apply a process to pixels in a n-dimensional neighborhood", - "description": "Applies a focal process to a data cube.\n\nA focal process is a process that works on a 'neighborhood' of pixels. The neighborhood can extend into multiple dimensions, this extent is specified by the `size` argument. It is not only (part of) the size of the input window, but also the size of the output for a given position of the sliding window. The sliding window moves with multiples of `size`.\n\nAn overlap can be specified so that neighborhoods can have overlapping boundaries. This allows for continuity of the output. The overlap region must be included in the data cube or array returned by `process`, but any changed values will be ignored. The missing overlap at the borders of the original data cube is made available as no-data (`null`) in the sub-data cubes.\n\nThe neighborhood size should be kept small enough, to avoid running beyond computational resources, but a too-small size will result in a larger number of process invocations, which may slow down processing. Window sizes for spatial dimensions typically range from 64 to 512 pixels, while overlaps of 8 to 32 pixels are common.\n\nFor the special case of 2D convolution, it is recommended to use ``apply_kernel()``.", + "description": "Applies a focal process to a data cube.\n\nA focal process is a process that works on a 'neighborhood' of pixels. The neighborhood can extend into multiple dimensions, this extent is specified by the `size` argument. It is not only (part of) the size of the input window, but also the size of the output for a given position of the sliding window. The sliding window moves with multiples of `size`.\n\nAn overlap can be specified so that neighborhoods can have overlapping boundaries. This allows for continuity of the output. The overlap region must be included in the data cube or array returned by `process`, but any changed values will be ignored. The missing overlap at the borders of the original data cube is made available as no-data values in the sub-data cubes.\n\nThe neighborhood size should be kept small enough, to avoid running beyond computational resources, but a too-small size will result in a larger number of process invocations, which may slow down processing. Window sizes for spatial dimensions typically range from 64 to 512 pixels, while overlaps of 8 to 32 pixels are common.\n\nFor the special case of 2D convolution, it is recommended to use ``apply_kernel()``.", "categories": [ "cubes" ], diff --git a/arccos.json b/arccos.json index 4cd498a7..87378a40 100644 --- a/arccos.json +++ b/arccos.json @@ -1,7 +1,7 @@ { "id": "arccos", "summary": "Inverse cosine", - "description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values outside of the allowed range.", + "description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > trigonometric" ], diff --git a/arcosh.json b/arcosh.json index 820b8cd4..800ad449 100644 --- a/arcosh.json +++ b/arcosh.json @@ -1,7 +1,7 @@ { "id": "arcosh", "summary": "Inverse hyperbolic cosine", - "description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values outside of the allowed range.", + "description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > trigonometric" ], diff --git a/arcsin.json b/arcsin.json index 2c772a00..9f6c72ee 100644 --- a/arcsin.json +++ b/arcsin.json @@ -1,7 +1,7 @@ { "id": "arcsin", "summary": "Inverse sine", - "description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values < -1 and > 1.", + "description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values < -1 and > 1.", "categories": [ "math > trigonometric" ], diff --git a/arctan.json b/arctan.json index 9461eba3..08c7eb5c 100644 --- a/arctan.json +++ b/arctan.json @@ -1,7 +1,7 @@ { "id": "arctan", "summary": "Inverse tangent", - "description": "Computes the arc tangent of `x`. The arc tangent is the inverse function of the tangent so that *`arctan(tan(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the arc tangent of `x`. The arc tangent is the inverse function of the tangent so that *`arctan(tan(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/arctan2.json b/arctan2.json index ca7d507f..17bd38e6 100644 --- a/arctan2.json +++ b/arctan2.json @@ -1,7 +1,7 @@ { "id": "arctan2", "summary": "Inverse tangent of two numbers", - "description": "Computes the arc tangent of two numbers `x` and `y`. It is similar to calculating the arc tangent of *`y / x`*, except that the signs of both arguments are used to determine the quadrant of the result.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.", + "description": "Computes the arc tangent of two numbers `x` and `y`. It is similar to calculating the arc tangent of *`y / x`*, except that the signs of both arguments are used to determine the quadrant of the result.\n\nWorks on radians only.\nIf any argument is a no-data value, the result will be the no-data value (or `null`).", "categories": [ "math > trigonometric" ], @@ -59,4 +59,4 @@ "title": "Two-argument inverse tangent explained by Wikipedia" } ] -} \ No newline at end of file +} diff --git a/array_contains.json b/array_contains.json index 37ced980..cd1586ac 100644 --- a/array_contains.json +++ b/array_contains.json @@ -1,7 +1,7 @@ { "id": "array_contains", "summary": "Check whether the array contains a given value", - "description": "Checks whether the array specified for `data` contains the value specified in `value`. Returns `true` if there's a match, otherwise `false`.\n\n**Remarks:**\n\n* To get the index or the label of the value found, use ``array_find()``.\n* All definitions for the process ``eq()`` regarding the comparison of values apply here as well. A `null` return value from ``eq()`` is handled exactly as `false` (no match).\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*.\n* An integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`. Still, this process may return unexpectedly `false` when comparing floating-point numbers due to floating-point inaccuracy in machine-based computation.\n* Temporal strings are treated as normal strings and MUST NOT be interpreted.", + "description": "Checks whether the array specified for `data` contains the value specified in `value`. Returns `true` if there's a match, otherwise `false`.\n\n**Remarks:**\n\n* To get the index or the label of the value found, use ``array_find()``.\n* All definitions for the process ``eq()`` regarding the comparison of values apply here as well. A no-data return value from ``eq()`` is handled as `false` (no match).\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*.\n* An integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`. Still, this process may return unexpectedly `false` when comparing floating-point numbers due to floating-point inaccuracy in machine-based computation.\n* Temporal strings are treated as normal strings and MUST NOT be interpreted.\n\nSee the examples to check for no-data values.", "categories": [ "arrays", "comparison", @@ -20,7 +20,7 @@ }, { "name": "value", - "description": "Value to find in `data`. If the value is `null`, this process returns always `false`.", + "description": "Value to find in `data`. If the value is no-data value (or `null`), this process returns always `false`.", "schema": { "type": [ "number", diff --git a/array_element.json b/array_element.json index 8b70a2e5..f0763793 100644 --- a/array_element.json +++ b/array_element.json @@ -41,7 +41,7 @@ }, { "name": "return_nodata", - "description": "By default this process throws an `ArrayElementNotAvailable` exception if the index or label is invalid. If you want to return `null` instead, set this flag to `true`.", + "description": "By default this process throws an `ArrayElementNotAvailable` exception if the index or label is invalid. If you want to return the no-data value (or `null`) instead, set this flag to `true`.", "schema": { "type": "boolean" }, @@ -103,4 +103,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/array_find.json b/array_find.json index 7b0e6317..6344d223 100644 --- a/array_find.json +++ b/array_find.json @@ -1,7 +1,7 @@ { "id": "array_find", "summary": "Get the index for a value in an array", - "description": "Returns the zero-based index of the first (or last) occurrence of the value specified by `value` in the array specified by `data` or `null` if there is no match. Use the parameter `reverse` to switch from the first to the last match.\n\n**Remarks:**\n\n* Use ``array_contains()`` to check if an array contains a value regardless of the position.\n* Use ``array_find_label()`` to find the index for a label.\n* All definitions for the process ``eq()`` regarding the comparison of values apply here as well. A `null` return value from ``eq()`` is handled exactly as `false` (no match).\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*.\n* An integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`. Still, this process may return unexpectedly `false` when comparing floating-point numbers due to floating-point inaccuracy in machine-based computation.\n* Temporal strings are treated as normal strings and MUST NOT be interpreted.\n* If the specified value is an array, object or null, the process always returns `null`. See the examples for one to find `null` values.", + "description": "Returns the zero-based index of the first (or last) occurrence of the value specified by `value` in the array specified by `data` or `null` if there is no match. Use the parameter `reverse` to switch from the first to the last match.\n\n**Remarks:**\n\n* Use ``array_contains()`` to check if an array contains a value regardless of the position.\n* Use ``array_find_label()`` to find the index for a label.\n* All definitions for the process ``eq()`` regarding the comparison of values apply here as well. A no-data return value from ``eq()`` is handled as `false` (no match).\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*.\n* An integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`. Still, this process may return unexpectedly `false` when comparing floating-point numbers due to floating-point inaccuracy in machine-based computation.\n* Temporal strings are treated as normal strings and MUST NOT be interpreted.\n* If the specified value is an array, object or null, the process always returns `null`. See the examples to find no-data values.", "categories": [ "arrays", "reducer" @@ -19,7 +19,7 @@ }, { "name": "value", - "description": "Value to find in `data`. If the value is `null`, this process returns always `null`.", + "description": "Value to find in `data`. If the value is a no-data value (or `null`), this process returns the no-data value (or `null`).", "schema": { "description": "Any data type is allowed." } @@ -96,18 +96,6 @@ }, "returns": null }, - { - "arguments": { - "data": [ - 1, - null, - 2, - null - ], - "value": null - }, - "returns": null - }, { "arguments": { "data": [ diff --git a/array_interpolate_linear.json b/array_interpolate_linear.json index 021522b0..57188e8f 100644 --- a/array_interpolate_linear.json +++ b/array_interpolate_linear.json @@ -1,7 +1,7 @@ { "id": "array_interpolate_linear", "summary": "One-dimensional linear interpolation for arrays", - "description": "Performs a linear interpolation for each of the no-data values (`null`) in the array given, except for leading and trailing no-data values.\n\nThe linear interpolants are defined by the array indices or labels (x) and the values in the array (y).", + "description": "Performs a linear interpolation for each of the NaN and no-data values in the array given, except for leading and trailing NaN and no-data values.\n\nThe linear interpolants are defined by the array indices or labels (x axis) and the values in the array (y axis).", "categories": [ "arrays", "math", @@ -10,7 +10,7 @@ "parameters": [ { "name": "data", - "description": "An array of numbers and no-data values.\n\nIf the given array is a labeled array, the labels must have a natural/inherent label order and the process expects the labels to be sorted accordingly. This is the default behavior in openEO for spatial and temporal dimensions.", + "description": "An array of numbers, which may include NaN, ±infinity, and no-data values.\n\nIf the given array is a labeled array, the labels must have a natural/inherent label order and the process expects the labels to be sorted accordingly. This is the default behavior in openEO for spatial and temporal dimensions.", "schema": { "type": "array", "items": { @@ -23,7 +23,7 @@ } ], "returns": { - "description": "An array with no-data values being replaced with interpolated values. If not at least 2 numerical values are available in the array, the array stays the same.", + "description": "An array with NaN and no-data values being replaced with interpolated values. If not at least 2 numerical values are available in the array, the array stays the same.", "schema": { "type": "array", "items": { diff --git a/arsinh.json b/arsinh.json index 2b7942dd..405ab410 100644 --- a/arsinh.json +++ b/arsinh.json @@ -1,7 +1,7 @@ { "id": "arsinh", "summary": "Inverse hyperbolic sine", - "description": "Computes the inverse hyperbolic sine of `x`. It is the inverse function of the hyperbolic sine so that *`arsinh(sinh(x)) = x`*.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the inverse hyperbolic sine of `x`. It is the inverse function of the hyperbolic sine so that *`arsinh(sinh(x)) = x`*.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/artanh.json b/artanh.json index 6308290d..c7d4778d 100644 --- a/artanh.json +++ b/artanh.json @@ -1,7 +1,7 @@ { "id": "artanh", "summary": "Inverse hyperbolic tangent", - "description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values outside of the allowed range. The computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, `x` = 1 results in +infinity and `x` = 0 results in -infinity. Otherwise, an exception is thrown.", + "description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values outside of the allowed range. The computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, `x` = 1 results in +infinity and `x` = 0 results in -infinity. Otherwise, an exception is thrown.", "categories": [ "math > trigonometric" ], diff --git a/between.json b/between.json index 12e37693..b09d09fb 100644 --- a/between.json +++ b/between.json @@ -8,7 +8,7 @@ "parameters": [ { "name": "x", - "description": "The value to check.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "The value to check.\n\nNo-data values are passed through and therefore get propagated.", "schema": { "description": "Any data type is allowed." } @@ -38,7 +38,7 @@ } ], "returns": { - "description": "`true` if `x` is between the specified bounds, `null` if `x` is a no-data value, `false` otherwise.", + "description": "`true` if `x` is between the specified bounds, the no-data value (or `null`) if `x` is a no-data value, `false` otherwise.", "schema": { "type": [ "boolean", diff --git a/ceil.json b/ceil.json index 7c01cf45..9f237bf1 100644 --- a/ceil.json +++ b/ceil.json @@ -1,7 +1,7 @@ { "id": "ceil", "summary": "Round fractions up", - "description": "The least integer greater than or equal to the number `x`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "The least integer greater than or equal to the number `x`.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > rounding" ], @@ -59,4 +59,4 @@ "title": "Ceiling explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/clip.json b/clip.json index de2a4d1a..04c2d7b4 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. 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.", + "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\nNo-data values are passed through and therefore get propagated.", "categories": [ "math" ], diff --git a/cos.json b/cos.json index 0d6229a8..ac312c20 100644 --- a/cos.json +++ b/cos.json @@ -1,7 +1,7 @@ { "id": "cos", "summary": "Cosine", - "description": "Computes the cosine of `x`.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the cosine of `x`.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/cosh.json b/cosh.json index 8b56a222..572a6161 100644 --- a/cosh.json +++ b/cosh.json @@ -1,7 +1,7 @@ { "id": "cosh", "summary": "Hyperbolic cosine", - "description": "Computes the hyperbolic cosine of `x`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the hyperbolic cosine of `x`.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/divide.json b/divide.json index 0c6c254a..2c41bd3d 100644 --- a/divide.json +++ b/divide.json @@ -1,7 +1,7 @@ { "id": "divide", "summary": "Division of two numbers", - "description": "Divides argument `x` by the argument `y` (*`x / y`*) and returns the computed result.\n\nNo-data values are taken into account so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. A division by zero results in:\n\n- +infinity for `x` > 0,\n- -infinity for `x` < 0,\n- `NaN` for `x` = 0,\n- or otherwise, throws a `DivisionByZero` exception if the other options are not supported by the processing environment.", + "description": "Divides argument `x` by the argument `y` (*`x / y`*) and returns the computed result.\n\nNo-data values are taken into account so that the no-data value is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. A division by zero results in:\n\n- +infinity for `x` > 0,\n- -infinity for `x` < 0,\n- `NaN` for `x` = 0,\n- or otherwise, throws a `DivisionByZero` exception if the other options are not supported by the processing environment.", "categories": [ "math" ], diff --git a/eq.json b/eq.json index 0c62b42c..b1b23385 100644 --- a/eq.json +++ b/eq.json @@ -1,7 +1,7 @@ { "id": "eq", "summary": "Equal to comparison", - "description": "Compares whether `x` is strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is `null`, the return value is `null`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "texts", "comparison" @@ -55,7 +55,7 @@ } ], "returns": { - "description": "`true` if `x` is equal to `y`, `null` if any operand is `null`, otherwise `false`.", + "description": "`true` if `x` is equal to `y`, the no-data value (or `null`) if any operand is a no-data value, otherwise `false`.", "schema": { "type": [ "boolean", @@ -71,13 +71,6 @@ }, "returns": null }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null - }, { "arguments": { "x": 1, @@ -152,13 +145,6 @@ "y": "2018-01-01T00:00:00+00:00" }, "returns": false - }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null } ] } diff --git a/exp.json b/exp.json index 2d551390..bceeef2c 100644 --- a/exp.json +++ b/exp.json @@ -1,7 +1,7 @@ { "id": "exp", "summary": "Exponentiation to the base e", - "description": "Exponential function to the base *e* raised to the power of `p`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Exponential function to the base *e* raised to the power of `p`.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > exponential & logarithmic" ], diff --git a/extrema.json b/extrema.json index 6f6075de..7028a420 100644 --- a/extrema.json +++ b/extrema.json @@ -21,7 +21,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that an array with two `null` values is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in an array with two no-data (or `null`) values.", "schema": { "type": "boolean" }, @@ -30,7 +30,7 @@ } ], "returns": { - "description": "An array containing the minimum and maximum values for the specified numbers. The first element is the minimum, the second element is the maximum. If the input array is empty both elements are set to `null`.", + "description": "An array containing the minimum and maximum values for the specified numbers. The first element is the minimum, the second element is the maximum. If the input array is empty both elements are set to the no-data value (or `null`).", "schema": [ { "type": "array", @@ -94,16 +94,6 @@ null, null ] - }, - { - "description": "The input array is empty: return two `null` values.", - "arguments": { - "data": [] - }, - "returns": [ - null, - null - ] } ] -} \ No newline at end of file +} diff --git a/filter_spatial.json b/filter_spatial.json index ed4f7c3f..f1b5f8b8 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 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.", + "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 no-data values.\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" diff --git a/first.json b/first.json index 1afa9624..59fe4f77 100644 --- a/first.json +++ b/first.json @@ -1,7 +1,7 @@ { "id": "first", "summary": "First element", - "description": "Gives the first element of an array.\n\nAn array without non-`null` elements resolves always with `null`.", + "description": "Gives the first element of an array.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "arrays", "reducer" @@ -19,7 +19,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if the first value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, the first value of the array is returned regardless of whether it is a no-data value or not. For the default value `true`, the first non-no-data value is returned.", "schema": { "type": "boolean" }, @@ -65,13 +65,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null } ] -} \ No newline at end of file +} diff --git a/floor.json b/floor.json index d0eb5a94..63c1c48d 100644 --- a/floor.json +++ b/floor.json @@ -1,7 +1,7 @@ { "id": "floor", "summary": "Round fractions down", - "description": "The greatest integer less than or equal to the number `x`.\n\nThis process is *not* an alias for the ``int()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "The greatest integer less than or equal to the number `x`.\n\nThis process is *not* an alias for the ``int()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > rounding" ], @@ -59,4 +59,4 @@ "title": "Floor explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/gt.json b/gt.json index ae2cf151..542f618c 100644 --- a/gt.json +++ b/gt.json @@ -1,7 +1,7 @@ { "id": "gt", "summary": "Greater than comparison", - "description": "Compares whether `x` is strictly greater than `y`.\n\n**Remarks:**\n\n* If any operand is `null`, the return value is `null`.\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is strictly greater than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -32,7 +32,7 @@ } ], "returns": { - "description": "`true` if `x` is strictly greater than `y` or `null` if any operand is `null`, otherwise `false`.", + "description": "`true` if `x` is strictly greater than `y`, the no-data value (or `null`) if any operand is a no-data value, otherwise `false`.", "schema": { "type": [ "boolean", @@ -89,13 +89,6 @@ "y": false }, "returns": false - }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null } ] } diff --git a/gte.json b/gte.json index a32816c4..712b6b9c 100644 --- a/gte.json +++ b/gte.json @@ -1,7 +1,7 @@ { "id": "gte", "summary": "Greater than or equal to comparison", - "description": "Compares whether `x` is greater than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is `null`, the return value is `null`.\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is greater than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -32,7 +32,7 @@ } ], "returns": { - "description": "`true` if `x` is greater than or equal to `y`, `null` if any operand is `null`, otherwise `false`.", + "description": "`true` if `x` is greater than or equal to `y`, the no-data value (or `null`) if any operand is a no-data value, otherwise `false`.", "schema": { "type": [ "boolean", @@ -82,13 +82,6 @@ "y": false }, "returns": false - }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null } ], "process_graph": { diff --git a/if.json b/if.json index 43e6fcdc..aae6db8e 100644 --- a/if.json +++ b/if.json @@ -27,7 +27,7 @@ }, { "name": "reject", - "description": "A value that is returned if the boolean value is **not** `true`. Defaults to `null`.", + "description": "A value that is returned if the boolean value is **not** `true`. Defaults to the no-data value (or `null`).", "schema": { "description": "Any data type is allowed." }, @@ -93,4 +93,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/int.json b/int.json index 8fca1655..32d1424a 100644 --- a/int.json +++ b/int.json @@ -1,7 +1,7 @@ { "id": "int", "summary": "Integer part of a number", - "description": "The integer part of the real number `x`.\n\nThis process is *not* an alias for the ``floor()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "The integer part of the real number `x`.\n\nThis process is *not* an alias for the ``floor()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math", "math > rounding" @@ -60,4 +60,4 @@ "title": "Integer Part explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/is_nodata.json b/is_nodata.json index a1b7c08b..f7d696b9 100644 --- a/is_nodata.json +++ b/is_nodata.json @@ -1,7 +1,7 @@ { "id": "is_nodata", "summary": "Value is a no-data value", - "description": "Checks whether the specified data is missing data, i.e. equals to `null` or any of the no-data values specified in the metadata.\n\nThe special numerical value `NaN` (not a number) as defined by the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935) is only considered as no-data value if specified as no-data value in the metadata.", + "description": "Checks whether the specified data is no-data value, i.e. equals to any of the no-data values of the data cube (or `null`). The specific no-data values are usually provided through the collection or STAC metadata.\n\nThe special numerical value `NaN` (not a number) as defined by the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935) is only considered as no-data value if explicitly specified as no-data value for the data cube.", "categories": [ "comparison" ], diff --git a/last.json b/last.json index 1a35e6ac..f523c488 100644 --- a/last.json +++ b/last.json @@ -1,7 +1,7 @@ { "id": "last", "summary": "Last element", - "description": "Gives the last element of an array.\n\nAn array without non-`null` elements resolves always with `null`.", + "description": "Gives the last element of an array.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "arrays", "reducer" @@ -19,7 +19,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if the last value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, the last value of the array is returned regardless of whether it is a no-data value or not. For the default value `true`, the last non-no-data value is returned.", "schema": { "type": "boolean" }, @@ -65,13 +65,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null } ] -} \ No newline at end of file +} diff --git a/linear_scale_range.json b/linear_scale_range.json index 01f09857..c3de1096 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 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.", + "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\nNo-data values are passed through and therefore get propagated.", "categories": [ "math" ], diff --git a/ln.json b/ln.json index 1663771b..6b9b5022 100644 --- a/ln.json +++ b/ln.json @@ -1,7 +1,7 @@ { "id": "ln", "summary": "Natural logarithm", - "description": "The natural logarithm is the logarithm to the base *e* of the number `x`, which equals to using the *log* process with the base set to *e*. The natural logarithm is the inverse function of taking *e* to the power x.\n\nThe no-data value `null` is passed through.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`ln(0)`* results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", + "description": "The natural logarithm is the logarithm to the base *e* of the number `x`, which equals to using the *log* process with the base set to *e*. The natural logarithm is the inverse function of taking *e* to the power x.\n\nNo-data values are passed through and therefore get propagated.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`ln(0)`* results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > exponential & logarithmic" ], diff --git a/load_collection.json b/load_collection.json index a6701cc3..aeb9269e 100644 --- a/load_collection.json +++ b/load_collection.json @@ -87,14 +87,14 @@ }, { "title": "GeoJSON", - "description": "Deprecated in favor of ``load_geojson()``. Limits the data cube to the bounding box of the given geometries. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`).\n\nThe GeoJSON type `GeometryCollection` is not supported. Empty geometries are ignored.", + "description": "Deprecated in favor of ``load_geojson()``. Limits the data cube to the bounding box of the given geometries. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to the no-data value of the data cube.\n\nThe GeoJSON type `GeometryCollection` is not supported. Empty geometries are ignored.", "type": "object", "subtype": "geojson", "deprecated": true }, { "title": "Vector data cube", - "description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`). Empty geometries are ignored.", + "description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to the no-data value of the data cube. Empty geometries are ignored.", "type": "object", "subtype": "datacube", "dimensions": [ diff --git a/log.json b/log.json index 67a19ba2..9b8866ca 100644 --- a/log.json +++ b/log.json @@ -1,7 +1,7 @@ { "id": "log", "summary": "Logarithm to a base", - "description": "Logarithm to the base `base` of the number `x` is defined to be the inverse function of taking b to the power of x.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, having `x` set to `0` with any base results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", + "description": "Logarithm to the base `base` of the number `x` is defined to be the inverse function of taking b to the power of x.\n\nIf any argument is a no-data value, the result will be the no-data value (or `null`).\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, having `x` set to `0` with any base results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > exponential & logarithmic" ], diff --git a/lt.json b/lt.json index 0cc45f87..b7e35bf4 100644 --- a/lt.json +++ b/lt.json @@ -1,7 +1,7 @@ { "id": "lt", "summary": "Less than comparison", - "description": "Compares whether `x` is strictly less than `y`.\n\n**Remarks:**\n\n* If any operand is `null`, the return value is `null`.\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is strictly less than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -32,7 +32,7 @@ } ], "returns": { - "description": "`true` if `x` is strictly less than `y`, `null` if any operand is `null`, otherwise `false`.", + "description": "`true` if `x` is strictly less than `y`, the no-data value (or `null`) if any operand is a no-data value, otherwise `false`.", "schema": { "type": [ "boolean", @@ -89,13 +89,6 @@ "y": true }, "returns": false - }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null } ] } diff --git a/lte.json b/lte.json index 9f936915..5ab05126 100644 --- a/lte.json +++ b/lte.json @@ -1,7 +1,7 @@ { "id": "lte", "summary": "Less than or equal to comparison", - "description": "Compares whether `x` is less than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is `null`, the return value is `null`.\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is less than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -32,7 +32,7 @@ } ], "returns": { - "description": "`true` if `x` is less than or equal to `y`, `null` if any operand is `null`, otherwise `false`.", + "description": "`true` if `x` is less than or equal to `y`, the no-data value (or `null`) if any operand is a no-data value, otherwise `false`.", "schema": { "type": [ "boolean", @@ -82,13 +82,6 @@ "y": true }, "returns": false - }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null } ], "process_graph": { diff --git a/mask.json b/mask.json index 0381d220..02b394bc 100644 --- a/mask.json +++ b/mask.json @@ -1,7 +1,7 @@ { "id": "mask", "summary": "Apply a raster mask", - "description": "Applies a mask to a raster data cube. To apply a polygon as a mask, use ``mask_polygon()``.\n\nA mask is a raster data cube for which corresponding pixels among `data` and `mask` are compared and those pixels in `data` are replaced whose pixels in `mask` are non-zero (for numbers) or `true` (for boolean values). The pixel values are replaced with the value specified for `replacement`, which defaults to `null` (no data).\n\nThe data cubes have to be compatible except that the horizontal spatial dimensions (axes `x` and `y`) will be aligned implicitly by ``resample_cube_spatial()``. `data` is the target data cube for resampling and the default parameters of ``resample_cube_spatial()`` apply. All other dimensions in the mask must also be available in the raster data cube with the same name, type, reference system, resolution and labels. Dimensions can be missing in the mask with the result that the mask is applied to each label of the dimension in `data` that is missing in the data cube of the mask. The process fails if there's an incompatibility found between the raster data cube and the mask.", + "description": "Applies a mask to a raster data cube. To apply a polygon as a mask, use ``mask_polygon()``.\n\nA mask is a raster data cube for which corresponding pixels among `data` and `mask` are compared and those pixels in `data` are replaced whose pixels in `mask` are non-zero (for numbers) or `true` (for boolean values). The pixel values are replaced with the value specified for `replacement`, which defaults to the no-data value of the raster data cube.\n\nThe data cubes have to be compatible except that the horizontal spatial dimensions (axes `x` and `y`) will be aligned implicitly by ``resample_cube_spatial()``. `data` is the target data cube for resampling and the default parameters of ``resample_cube_spatial()`` apply. All other dimensions in the mask must also be available in the raster data cube with the same name, type, reference system, resolution and labels. Dimensions can be missing in the mask with the result that the mask is applied to each label of the dimension in `data` that is missing in the data cube of the mask. The process fails if there's an incompatibility found between the raster data cube and the mask.", "categories": [ "cubes", "masks" @@ -43,7 +43,7 @@ }, { "name": "replacement", - "description": "The value used to replace masked values with.", + "description": "The value used to replace masked values with. `null` refers to the no-data value of the data cube provided for `data`.", "schema": { "type": [ "number", diff --git a/mask_polygon.json b/mask_polygon.json index f04d3750..acf2ee6a 100644 --- a/mask_polygon.json +++ b/mask_polygon.json @@ -1,7 +1,7 @@ { "id": "mask_polygon", "summary": "Apply a polygon mask", - "description": "Applies a (multi) polygon mask to a raster data cube. To apply a raster mask use ``mask()``.\n\nAll pixels for which the point at the pixel center **does not** intersect with any polygon (as defined in the Simple Features standard by the OGC) are replaced. This behavior can be inverted by setting the parameter `inside` to `true`. The pixel values are replaced with the value specified for `replacement`, which defaults to `null` (no data). No data values in `data` will be left untouched by the masking operation.", + "description": "Applies a (multi) polygon mask to a raster data cube. To apply a raster mask use ``mask()``.\n\nAll pixels for which the point at the pixel center **does not** intersect with any polygon (as defined in the Simple Features standard by the OGC) are replaced. This behavior can be inverted by setting the parameter `inside` to `true`. The pixel values are replaced with the value specified for `replacement`, which defaults to the no-data value of the raster data cube. No data values in `data` will be left untouched by the masking operation.", "categories": [ "cubes", "masks" @@ -53,7 +53,7 @@ }, { "name": "replacement", - "description": "The value used to replace masked values with.", + "description": "The value used to replace masked values with. `null` refers to the no-data value of the data cube provided for `data`.", "schema": [ { "type": "number" diff --git a/max.json b/max.json index d8903df0..6a931780 100644 --- a/max.json +++ b/max.json @@ -1,7 +1,7 @@ { "id": "max", "summary": "Maximum value", - "description": "Computes the largest value of an array of numbers, which is equal to the first element of a sorted (i.e., ordered) version of the array.\n\nAn array without non-`null` elements resolves always with `null`.", + "description": "Computes the largest value of an array of numbers, which is equal to the first element of a sorted (i.e., ordered) version of the array.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "math", "math > statistics", @@ -23,7 +23,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -75,13 +75,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null } ], "links": [ @@ -91,4 +84,4 @@ "title": "Maximum explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/mean.json b/mean.json index cb45faa4..31f1c9ec 100644 --- a/mean.json +++ b/mean.json @@ -1,7 +1,7 @@ { "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.\n\nAn array without non-`null` elements resolves always with `null`.", + "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 with solely no-data values returns the no-data value (or `null`).", "categories": [ "math > statistics", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -71,23 +71,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null - }, - { - "description": "The input array has only `null` elements: return `null`.", - "arguments": { - "data": [ - null, - null - ] - }, - "returns": null } ], "links": [ @@ -163,4 +146,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/median.json b/median.json index e54deb84..fb1f31c1 100644 --- a/median.json +++ b/median.json @@ -1,7 +1,7 @@ { "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\nAn array without non-`null` elements resolves always with `null`.\n\n**Remarks:**\n\n* For 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*.", + "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 with solely no-data values returns the no-data value (or `null`).\n\n**Remarks:**\n\n* For 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 > statistics", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -91,23 +91,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null - }, - { - "description": "The input array has only `null` elements: return `null`.", - "arguments": { - "data": [ - null, - null - ] - }, - "returns": null } ], "links": [ @@ -144,4 +127,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/merge_cubes.json b/merge_cubes.json index c22421c2..8b3595b7 100644 --- a/merge_cubes.json +++ b/merge_cubes.json @@ -24,7 +24,7 @@ }, { "name": "overlap_resolver", - "description": "A reduction operator that resolves the conflict if the data overlaps. The reducer must return a value of the same data type as the input values are. The reduction operator may be a single process such as ``multiply()`` or consist of multiple sub-processes. `null` (the default) can be specified if no overlap resolver is required.", + "description": "A reduction operator that resolves the conflict if the data overlaps. The reducer must return a value of the same data type as the input values are. The reduction operator may be a single process such as ``multiply()`` or consist of multiple sub-processes. The default value `null` can be specified if no overlap resolver is required.", "schema": { "type": "object", "subtype": "process-graph", diff --git a/meta/implementation.md b/meta/implementation.md index 65a24430..fafe6ea0 100644 --- a/meta/implementation.md +++ b/meta/implementation.md @@ -2,6 +2,28 @@ This file is meant to provide some additional implementation details for back-ends. +## No-data value + +A data cube shall always keep reference of the applicable no-data values. +The no-data value can be chosen by the back-end implementation, e.g. depending on the data type of the data. +No-data values should be exposed for each pre-defined Collection in its metadata. +For all data generated through openEO (e.g. through synchronous or batch jobs), the metadata and/or data +shall expose the no-data values. + +The openEO process specifications generally use `null` as a generic value to express no-data values. +This is primarily meant for the JSON encoding, this means: +1. in the process specification (data type `null` in the schema), and +2. in the process graph (if the no-data value exposed through the metadata can't be used in JSON). + +Back-ends may or may not use `null` as a no-data value internally. + +**NaN**: If `NaN` is the no-data value for floating-point numbers, be aware that the behavior of +no-data values in openEO and `NaN` (IEEE 754) sometimes differs. + +**Array processes:** Some array processes (e.g. `array_find` or `any`) use `null` as a return value. +In the context of data cube operations (e.g. in `reduce_dimension`), `null` values returned +by the array processes shall be replaced with the no-data value of the data cube. + ## Optimizations for conditions (e.g. `if`) None of the openEO processes per se is "special" and thus all are treated the same way by default. diff --git a/min.json b/min.json index 26c60882..b59336ba 100644 --- a/min.json +++ b/min.json @@ -1,7 +1,7 @@ { "id": "min", "summary": "Minimum value", - "description": "Computes the smallest value of an array of numbers, which is equal to the last element of a sorted (i.e., ordered) version of the array.\n\nAn array without non-`null` elements resolves always with `null`.", + "description": "Computes the smallest value of an array of numbers, which is equal to the last element of a sorted (i.e., ordered) version of the array.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "math", "math > statistics", @@ -23,7 +23,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -90,4 +90,4 @@ "title": "Minimum explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/mod.json b/mod.json index 0c8a6ea9..9a2a648c 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "id": "mod", "summary": "Modulo", - "description": "Remainder after a 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`. If `y` is set to 0 this results in:\n\n- +infinity for `x` > 0,\n- -infinity for `x` < 0,\n- `NaN` for `x` = 0,\n- or otherwise, throws a `DivisionByZero` exception if the other options are not supported by the processing environment.", + "description": "Remainder after a 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\nIf any argument is a no-data value, the result will be the no-data value (or `null`). If `y` is set to 0 this results in:\n\n- +infinity for `x` > 0,\n- -infinity for `x` < 0,\n- `NaN` for `x` = 0,\n- or otherwise, throws a `DivisionByZero` exception if the other options are not supported by the processing environment.", "categories": [ "math" ], diff --git a/multiply.json b/multiply.json index afa88daa..5ad94da3 100644 --- a/multiply.json +++ b/multiply.json @@ -1,7 +1,7 @@ { "id": "multiply", "summary": "Multiplication of two numbers", - "description": "Multiplies the two numbers `x` and `y` (*`x * y`*) and returns the computed product.\n\nNo-data values are taken into account so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", + "description": "Multiplies the two numbers `x` and `y` (*`x * y`*) and returns the computed product.\n\nNo-data values are taken into account so that the no-data value is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", "categories": [ "math" ], @@ -93,4 +93,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/neq.json b/neq.json index 0e22b347..1b115b3b 100644 --- a/neq.json +++ b/neq.json @@ -1,7 +1,7 @@ { "id": "neq", "summary": "Not equal to comparison", - "description": "Compares whether `x` is **not** strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is `null`, the return value is `null`.\n* Strings are expected to be encoded in UTF-8 by default.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is **not** strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* Strings are expected to be encoded in UTF-8 by default.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "texts", "comparison" @@ -55,7 +55,7 @@ } ], "returns": { - "description": "`true` if `x` is *not* equal to `y`, `null` if any operand is `null`, otherwise `false`.", + "description": "`true` if `x` is *not* equal to `y`, the no-data value (or `null`) if any operand is a no-data value, otherwise `false`.", "schema": { "type": [ "boolean", @@ -145,13 +145,6 @@ "y": "2018-01-01T00:00:00+00:00" }, "returns": true - }, - { - "arguments": { - "x": null, - "y": null - }, - "returns": null } ], "process_graph": { diff --git a/not.json b/not.json index 523cb4a0..5879a767 100644 --- a/not.json +++ b/not.json @@ -1,7 +1,7 @@ { "id": "not", "summary": "Inverting a boolean", - "description": "Inverts a single boolean so that `true` gets `false` and `false` gets `true`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Inverts a single boolean so that `true` gets `false` and `false` gets `true`.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "logic" ], @@ -46,4 +46,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/or.json b/or.json index 4a83a63e..c2ce931a 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```\nx \\ y || 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 any argument is a no-data value, the result will be the no-data value whenever the outcome is ambiguous.\n\n**Truth table:**\n\n```\nx \\ y || no-data | false | true\n------- || ------- | ------- | ----\nno-data || no-data | no-data | true\nfalse || no-data | false | true\ntrue || true | true | true\n```", "categories": [ "logic" ], diff --git a/order.json b/order.json index 9b67f52d..6480fc44 100644 --- a/order.json +++ b/order.json @@ -45,7 +45,7 @@ }, { "name": "nodata", - "description": "Controls the handling of no-data values (`null`). By default, they are removed. If set to `true`, missing values in the data are put last; if set to `false`, they are put first.", + "description": "Controls the handling of no-data values. For the default value `null`, all no-data values get removed. If set to `true`, no-data values in the data are moved to the end of the array. If set to `false`, they are moved to the start of the array.", "schema": { "type": [ "boolean", diff --git a/power.json b/power.json index d01912a0..94cf7106 100644 --- a/power.json +++ b/power.json @@ -1,7 +1,7 @@ { "id": "power", "summary": "Exponentiation", - "description": "Computes the exponentiation for the base `base` raised to the power of `p`.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.", + "description": "Computes the exponentiation for the base `base` raised to the power of `p`.\n\nIf any argument is a no-data value, the result will be the no-data value (or `null`).", "categories": [ "math", "math > exponential & logarithmic" @@ -95,4 +95,4 @@ "title": "Power explained by Wolfram MathWorld" } ] -} \ No newline at end of file +} diff --git a/product.json b/product.json index 6bb8428d..8e5a64b9 100644 --- a/product.json +++ b/product.json @@ -1,7 +1,7 @@ { "id": "product", "summary": "Compute the product by multiplying numbers", - "description": "Multiplies all elements in a sequential array of numbers and returns the computed product.\n\nBy default no-data values are ignored. Setting `ignore_nodata` to `false` considers no-data values so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", + "description": "Multiplies all elements in a sequential array of numbers and returns the computed product.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "math", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -105,4 +105,4 @@ "title": "IEEE Standard 754-2019 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/proposals/aggregate_spatial_window.json b/proposals/aggregate_spatial_window.json index 9e5dce4a..7b0d198f 100644 --- a/proposals/aggregate_spatial_window.json +++ b/proposals/aggregate_spatial_window.json @@ -75,7 +75,7 @@ }, { "name": "boundary", - "description": "Behavior to apply if the number of values for the axes `x` and `y` is not a multiple of the corresponding value in the `size` parameter. Options are:\n\n- `pad` (default): pad the data cube with the no-data value `null` to fit the required window size.\n\n- `trim`: trim the data cube to fit the required window size.\n\nUse the parameter `align` to align the data to the desired corner.", + "description": "Behavior to apply if the number of values for the axes `x` and `y` is not a multiple of the corresponding value in the `size` parameter. Options are:\n\n- `pad` (default): pad the data cube with the no-data value to fit the required window size.\n\n- `trim`: trim the data cube to fit the required window size.\n\nUse the parameter `align` to align the data to the desired corner.", "schema": { "type": "string", "enum": [ diff --git a/proposals/apply_polygon.json b/proposals/apply_polygon.json index 735226a1..fe48ab5f 100644 --- a/proposals/apply_polygon.json +++ b/proposals/apply_polygon.json @@ -71,7 +71,7 @@ }, { "name": "mask_value", - "description": "All pixels for which the point at the pixel center **does not** intersect with the polygon are replaced with the given value, which defaults to `null` (no data).\n\nIt can provide a distinction between no data values within the polygon and masked pixels outside of it.", + "description": "All pixels for which the point at the pixel center **does not** intersect with the polygon are replaced with the given value. The default value is `null`, which uses the no-data value of the data cube.\n\nThis parameter can provide a distinction between no-data values within the polygon and masked pixels outside of it.", "schema": [ { "type": "number" diff --git a/proposals/ard_normalized_radar_backscatter.json b/proposals/ard_normalized_radar_backscatter.json index ec60de44..7a9204ec 100644 --- a/proposals/ard_normalized_radar_backscatter.json +++ b/proposals/ard_normalized_radar_backscatter.json @@ -31,7 +31,7 @@ }, { "name": "elevation_model", - "description": "The digital elevation model to use. Set to `null` (the default) to allow the back-end to choose, which will improve portability, but reduce reproducibility.", + "description": "The digital elevation model to use. The default value `null` allows the back-end to choose, which will improve portability, but reduce reproducibility.", "optional": true, "default": null, "schema": [ @@ -83,7 +83,7 @@ } ], "returns": { - "description": "Backscatter values expressed as gamma0 in linear scale.\n\nIn addition to the bands `contributing_area` and `ellipsoid_incidence_angle` that can optionally be added with corresponding parameters, the following bands are always added to the data cube:\n\n- `mask`: A data mask that indicates which values are valid (1), invalid (0) or contain no-data (null).\n- `local_incidence_angle`: A band with DEM-based local incidence angles in degrees.\n\nThe data returned is CARD4L compliant with corresponding metadata.", + "description": "Backscatter values expressed as gamma0 in linear scale.\n\nIn addition to the bands `contributing_area` and `ellipsoid_incidence_angle` that can optionally be added with corresponding parameters, the following bands are always added to the data cube:\n\n- `mask`: A data mask that indicates which values are valid (1), invalid (0), or contain a no-data value.\n- `local_incidence_angle`: A band with DEM-based local incidence angles in degrees.\n\nThe data returned is CARD4L compliant with corresponding metadata.", "schema": { "type": "object", "subtype": "datacube", diff --git a/proposals/ard_surface_reflectance.json b/proposals/ard_surface_reflectance.json index 01328f10..74f3347f 100644 --- a/proposals/ard_surface_reflectance.json +++ b/proposals/ard_surface_reflectance.json @@ -57,7 +57,7 @@ } }, { - "description": "The digital elevation model to use. Set to `null` (the default) to allow the back-end to choose, which will improve portability, but reduce reproducibility.", + "description": "The digital elevation model to use. The default value `null` allows the back-end to choose, which will improve portability, but reduce reproducibility.", "name": "elevation_model", "optional": true, "default": null, @@ -93,7 +93,7 @@ } ], "returns": { - "description": "Data cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. No-data values (null) are directly set in the bands. Depending on the methods used, several additional bands will be added to the data cube:\n\nData cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. Depending on the methods used, several additional bands will be added to the data cube:\n\n- `date` (optional): Specifies per-pixel acquisition timestamps.\n- `incomplete-testing` (required): Identifies pixels with a value of 1 for which the per-pixel tests (at least saturation, cloud and cloud shadows, see CARD4L specification for details) have not all been successfully completed. Otherwise, the value is 0.\n- `saturation` (required) / `saturation_{band}` (optional): Indicates where pixels in the input spectral bands are saturated (1) or not (0). If the saturation is given per band, the band names are `saturation_{band}` with `{band}` being the band name from the source data cube.\n- `cloud`, `shadow` (both required),`aerosol`, `haze`, `ozone`, `water_vapor` (all optional): Indicates the probability of pixels being an atmospheric disturbance such as clouds. All bands have values between 0 (clear) and 1, which describes the probability that it is an atmospheric disturbance.\n- `snow-ice` (optional): Points to a file that indicates whether a pixel is assessed as being snow/ice (1) or not (0). All values describe the probability and must be between 0 and 1.\n- `land-water` (optional): Indicates whether a pixel is assessed as being land (1) or water (0). All values describe the probability and must be between 0 and 1.\n- `incidence-angle` (optional): Specifies per-pixel incidence angles in degrees.\n- `azimuth` (optional): Specifies per-pixel azimuth angles in degrees.\n- `sun-azimuth:` (optional): Specifies per-pixel sun azimuth angles in degrees.\n- `sun-elevation` (optional): Specifies per-pixel sun elevation angles in degrees.\n- `terrain-shadow` (optional): Indicates with a value of 1 whether a pixel is not directly illuminated due to terrain shadowing. Otherwise, the value is 0.\n- `terrain-occlusion` (optional): Indicates with a value of 1 whether a pixel is not visible to the sensor due to terrain occlusion during off-nadir viewing. Otherwise, the value is 0.\n- `terrain-illumination` (optional): Contains coefficients used for terrain illumination correction are provided for each pixel.\n\nThe data returned is CARD4L compliant with corresponding metadata.", + "description": "Data cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. No-data values are directly set in the bands. Depending on the methods used, several additional bands will be added to the data cube:\n\nData cube containing bottom of atmosphere reflectances for each spectral band in the source data cube, with atmospheric disturbances like clouds and cloud shadows removed. Depending on the methods used, several additional bands will be added to the data cube:\n\n- `date` (optional): Specifies per-pixel acquisition timestamps.\n- `incomplete-testing` (required): Identifies pixels with a value of 1 for which the per-pixel tests (at least saturation, cloud and cloud shadows, see CARD4L specification for details) have not all been successfully completed. Otherwise, the value is 0.\n- `saturation` (required) / `saturation_{band}` (optional): Indicates where pixels in the input spectral bands are saturated (1) or not (0). If the saturation is given per band, the band names are `saturation_{band}` with `{band}` being the band name from the source data cube.\n- `cloud`, `shadow` (both required),`aerosol`, `haze`, `ozone`, `water_vapor` (all optional): Indicates the probability of pixels being an atmospheric disturbance such as clouds. All bands have values between 0 (clear) and 1, which describes the probability that it is an atmospheric disturbance.\n- `snow-ice` (optional): Points to a file that indicates whether a pixel is assessed as being snow/ice (1) or not (0). All values describe the probability and must be between 0 and 1.\n- `land-water` (optional): Indicates whether a pixel is assessed as being land (1) or water (0). All values describe the probability and must be between 0 and 1.\n- `incidence-angle` (optional): Specifies per-pixel incidence angles in degrees.\n- `azimuth` (optional): Specifies per-pixel azimuth angles in degrees.\n- `sun-azimuth:` (optional): Specifies per-pixel sun azimuth angles in degrees.\n- `sun-elevation` (optional): Specifies per-pixel sun elevation angles in degrees.\n- `terrain-shadow` (optional): Indicates with a value of 1 whether a pixel is not directly illuminated due to terrain shadowing. Otherwise, the value is 0.\n- `terrain-occlusion` (optional): Indicates with a value of 1 whether a pixel is not visible to the sensor due to terrain occlusion during off-nadir viewing. Otherwise, the value is 0.\n- `terrain-illumination` (optional): Contains coefficients used for terrain illumination correction are provided for each pixel.\n\nThe data returned is CARD4L compliant with corresponding metadata.", "schema": { "type": "object", "subtype": "datacube", diff --git a/proposals/atmospheric_correction.json b/proposals/atmospheric_correction.json index d366f1ed..57575f78 100644 --- a/proposals/atmospheric_correction.json +++ b/proposals/atmospheric_correction.json @@ -47,7 +47,7 @@ ] }, { - "description": "The digital elevation model to use. Set to `null` (the default) to allow the back-end to choose, which will improve portability, but reduce reproducibility.", + "description": "The digital elevation model to use. The default value `null` allows the back-end to choose, which will improve portability, but reduce reproducibility.", "name": "elevation_model", "optional": true, "default": null, diff --git a/proposals/cummax.json b/proposals/cummax.json index 69580459..95532334 100644 --- a/proposals/cummax.json +++ b/proposals/cummax.json @@ -1,7 +1,7 @@ { "id": "cummax", "summary": "Cumulative maxima", - "description": "Finds cumulative maxima of an array of numbers. Every computed element is equal to the bigger one between the current element and the previously computed element. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value (`null`) is reached all following elements are set to `null` in the result.", + "description": "Finds cumulative maxima of an array of numbers. Every computed element is equal to the bigger one between the current element and the previously computed element. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value is reached all following elements are set to the no-data value in the result.", "categories": [ "math > cumulative" ], @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to `false` considers no-data values so that `null` is set for all the following elements.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, the first no-data value makes all following values also no-data values.", "schema": { "type": "boolean" }, @@ -99,4 +99,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/proposals/cummin.json b/proposals/cummin.json index d84612e3..50cd3b00 100644 --- a/proposals/cummin.json +++ b/proposals/cummin.json @@ -1,7 +1,7 @@ { "id": "cummin", "summary": "Cumulative minima", - "description": "Finds cumulative minima of an array of numbers. Every computed element is equal to the smaller one between the current element and the previously computed element. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value (`null`) is reached all following elements are set to `null` in the result.", + "description": "Finds cumulative minima of an array of numbers. Every computed element is equal to the smaller one between the current element and the previously computed element. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value is reached all following elements are set to the no-data value in the result.", "categories": [ "math > cumulative" ], @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to `false` considers no-data values so that `null` is set for all the following elements.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, the first no-data value makes all following values also no-data values.", "schema": { "type": "boolean" }, @@ -99,4 +99,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/proposals/cumproduct.json b/proposals/cumproduct.json index f5e6ae1b..3c7b455e 100644 --- a/proposals/cumproduct.json +++ b/proposals/cumproduct.json @@ -1,7 +1,7 @@ { "id": "cumproduct", "summary": "Cumulative products", - "description": "Computes cumulative products of an array of numbers. Every computed element is equal to the product of the current and all previous values. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value (`null`) is reached all following elements are set to `null` in the result.", + "description": "Computes cumulative products of an array of numbers. Every computed element is equal to the product of the current and all previous values. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value is reached all following elements are set to the no-data value in the result.", "categories": [ "math > cumulative" ], @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to `false` considers no-data values so that `null` is set for all the following elements.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, the first no-data value makes all following values also no-data values.", "schema": { "type": "boolean" }, @@ -103,4 +103,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/proposals/cumsum.json b/proposals/cumsum.json index 717999e5..abd0e2c3 100644 --- a/proposals/cumsum.json +++ b/proposals/cumsum.json @@ -1,7 +1,7 @@ { "id": "cumsum", "summary": "Cumulative sums", - "description": "Computes cumulative sums of an array of numbers. Every computed element is equal to the sum of current and all previous values. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value (`null`) is reached all following elements are set to `null` in the result.", + "description": "Computes cumulative sums of an array of numbers. Every computed element is equal to the sum of current and all previous values. The returned array and the input array have always the same length.\n\nBy default, no-data values are skipped, but stay in the result. Setting the `ignore_nodata` flag to `true` makes that once a no-data value is reached all following elements are set to the no-data value in the result.", "categories": [ "math > cumulative" ], @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not and ignores them by default. Setting this flag to `false` considers no-data values so that `null` is set for all the following elements.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, the first no-data value makes all following values also no-data values.", "schema": { "type": "boolean" }, @@ -99,4 +99,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/proposals/fit_curve.json b/proposals/fit_curve.json index aafb917e..407e9547 100644 --- a/proposals/fit_curve.json +++ b/proposals/fit_curve.json @@ -69,7 +69,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is passed to the model function.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that no-data values are passed to the model function.", "schema": { "type": "boolean" }, diff --git a/proposals/load_geojson.json b/proposals/load_geojson.json index 70566a56..89e8440b 100644 --- a/proposals/load_geojson.json +++ b/proposals/load_geojson.json @@ -18,7 +18,7 @@ }, { "name": "properties", - "description": "A list of properties from the GeoJSON file to construct an additional dimension from. A new dimension with the name `properties` and type `other` is created if at least one property is provided. Only applies for GeoJSON Features and FeatureCollections. Missing values are generally set to no-data (`null`).\n\nDepending on the number of properties provided, the process creates the dimension differently:\n\n- Single property with scalar values: A single dimension label with the name of the property and a single value per geometry.\n- Single property of type array: The dimension labels correspond to the array indices. There are as many values and labels per geometry as there are for the largest array.\n- Multiple properties with scalar values: The dimension labels correspond to the property names. There are as many values and labels per geometry as there are properties provided here.", + "description": "A list of properties from the GeoJSON file to construct an additional dimension from. A new dimension with the name `properties` and type `other` is created if at least one property is provided. Only applies for GeoJSON Features and FeatureCollections. Missing values are generally set to the no-data value in the data cube.\n\nDepending on the number of properties provided, the process creates the dimension differently:\n\n- Single property with scalar values: A single dimension label with the name of the property and a single value per geometry.\n- Single property of type array: The dimension labels correspond to the array indices. There are as many values and labels per geometry as there are for the largest array.\n- Multiple properties with scalar values: The dimension labels correspond to the property names. There are as many values and labels per geometry as there are properties provided here.", "schema": { "type": "array", "uniqueItems": true, diff --git a/proposals/load_stac.json b/proposals/load_stac.json index 262745fc..318edc67 100644 --- a/proposals/load_stac.json +++ b/proposals/load_stac.json @@ -90,13 +90,13 @@ }, { "title": "GeoJSON", - "description": "Limits the data cube to the bounding box of the given geometries. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`).\n\nThe GeoJSON type `GeometryCollection` is not supported. Empty geometries are ignored.", + "description": "Limits the data cube to the bounding box of the given geometries. For raster data, all pixels inside the bounding box that do not intersect with any of the polygons will be set to the no-data value of the data cube.\n\nThe GeoJSON type `GeometryCollection` is not supported. Empty geometries are ignored.", "type": "object", "subtype": "geojson" }, { "title": "Vector data cube", - "description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. All pixels inside the bounding box that do not intersect with any of the polygons will be set to no data (`null`). Empty geometries are ignored.", + "description": "Limits the data cube to the bounding box of the given geometries in the vector data cube. All pixels inside the bounding box that do not intersect with any of the polygons will be set to the no-data value of the data cube. Empty geometries are ignored.", "type": "object", "subtype": "datacube", "dimensions": [ diff --git a/proposals/predict_curve.json b/proposals/predict_curve.json index ef3e9596..204cbb3f 100644 --- a/proposals/predict_curve.json +++ b/proposals/predict_curve.json @@ -59,7 +59,7 @@ }, { "name": "labels", - "description": "The labels to predict values for. If no labels are given, predicts values only for no-data (`null`) values in the data cube.", + "description": "The labels to predict values for. If no labels are given, predicts values only for no-data values in the data cube.", "optional": true, "default": null, "schema": [ diff --git a/proposals/sar_backscatter.json b/proposals/sar_backscatter.json index 03d13d29..6fb2503a 100644 --- a/proposals/sar_backscatter.json +++ b/proposals/sar_backscatter.json @@ -52,7 +52,7 @@ }, { "name": "elevation_model", - "description": "The digital elevation model to use. Set to `null` (the default) to allow the back-end to choose, which will improve portability, but reduce reproducibility.", + "description": "The digital elevation model to use. The default value `null` allows the back-end to choose, which will improve portability, but reduce reproducibility.", "optional": true, "default": null, "schema": [ @@ -67,7 +67,7 @@ }, { "name": "mask", - "description": "If set to `true`, a data mask is added to the bands with the name `mask`. It indicates which values are valid (1), invalid (0) or contain no-data (null).", + "description": "If set to `true`, a data mask is added to the bands with the name `mask`. It indicates which values are valid (1), invalid (0), or contain a no-data value.", "optional": true, "default": false, "schema": { diff --git a/proposals/vector_to_random_points.json b/proposals/vector_to_random_points.json index b568b54c..6eda87ad 100644 --- a/proposals/vector_to_random_points.json +++ b/proposals/vector_to_random_points.json @@ -1,7 +1,7 @@ { "id": "vector_to_random_points", "summary": "Sample random points from geometries", - "description": "Generate a vector data cube of points by sampling random points from input geometries. At least one point is sampled per input geometry. Empty geometries are passed through without any points assigned. Feature properties are preserved.\n\nIf `geometry_count` and `total_count` are both unrestricted (i.e. set to `null`, which is the default), one sample per geometry is used.", + "description": "Generate a vector data cube of points by sampling random points from input geometries. At least one point is sampled per input geometry. Empty geometries are passed through without any points assigned. Feature properties are preserved.\n\nIf `geometry_count` and `total_count` are both unrestricted (i.e. set to the default value `null`), one sample per geometry is used.", "categories": [ "cubes", "vector" diff --git a/quantiles.json b/quantiles.json index 033a4d89..f47fc5a9 100644 --- a/quantiles.json +++ b/quantiles.json @@ -53,7 +53,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that an array with `null` values is returned if any element is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in an array with solely no-data (or `null`) values.", "schema": { "type": "boolean" }, diff --git a/resample_cube_temporal.json b/resample_cube_temporal.json index 260954d0..e8308a01 100644 --- a/resample_cube_temporal.json +++ b/resample_cube_temporal.json @@ -1,7 +1,7 @@ { "id": "resample_cube_temporal", "summary": "Resample temporal dimensions to match a target data cube", - "description": "Resamples one or more given temporal dimensions from a source data cube to align with the corresponding dimensions of the given target data cube using the nearest neighbor method. Returns a new data cube with the resampled dimensions.\n\nBy default, this process simply takes the nearest neighbor independent of the value (including values such as no-data / `null`). Depending on the data cubes this may lead to values being assigned to two target timestamps. To only consider valid values in a specific range around the target timestamps, use the parameter `valid_within`.\n\nThe rare case of ties is resolved by choosing the earlier timestamps.", + "description": "Resamples one or more given temporal dimensions from a source data cube to align with the corresponding dimensions of the given target data cube using the nearest neighbor method. Returns a new data cube with the resampled dimensions.\n\nBy default, this process simply takes the nearest neighbor independent of the value (including no-data values). Depending on the data cubes this may lead to values being assigned to two target timestamps. To only consider valid values in a specific range around the target timestamps, use the parameter `valid_within`.\n\nThe rare case of ties is resolved by choosing the earlier timestamps.", "categories": [ "cubes", "reproject" @@ -47,7 +47,7 @@ }, { "name": "valid_within", - "description": "Setting this parameter to a numerical value enables that the process searches for valid values within the given period of days before and after the target timestamps. Valid values are determined based on the function ``is_valid()``. For example, the limit of `7` for the target timestamps `2020-01-15 12:00:00` looks for a nearest neighbor after `2020-01-08 12:00:00` and before `2020-01-22 12:00:00`. If no valid value is found within the given period, the value will be set to no-data (`null`).", + "description": "Setting this parameter to a numerical value enables that the process searches for valid values within the given period of days before and after the target timestamps. Valid values are determined based on the function ``is_valid()``. For example, the limit of `7` for the target timestamps `2020-01-15 12:00:00` looks for a nearest neighbor after `2020-01-08 12:00:00` and before `2020-01-22 12:00:00`. If no valid value is found within the given period, the value will be set to the no-data value of the data cube given for the parameter `data`.", "schema": { "type": [ "number", diff --git a/resample_spatial.json b/resample_spatial.json index fb34f194..418f13ec 100644 --- a/resample_spatial.json +++ b/resample_spatial.json @@ -49,7 +49,7 @@ }, { "name": "projection", - "description": "Warps the data cube to the target projection, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). By default (`null`), the projection is not changed.", + "description": "Warps the data cube to the target projection, specified as as [EPSG code](http://www.epsg-registry.org/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). For the default value `null`, the projection is not changed.", "schema": [ { "title": "EPSG Code", diff --git a/round.json b/round.json index cb1ff9e0..aa1d8d87 100644 --- a/round.json +++ b/round.json @@ -1,7 +1,7 @@ { "id": "round", "summary": "Round to a specified precision", - "description": "Rounds a real number `x` to specified precision `p`.\n\nIf `x` is halfway between closest numbers of precision `p`, it is rounded to the closest even number of precision `p`.\nThis behavior follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) and is often called \"round to nearest (even)\" or \"banker's rounding\". It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Rounds a real number `x` to specified precision `p`.\n\nIf `x` is halfway between closest numbers of precision `p`, it is rounded to the closest even number of precision `p`.\nThis behavior follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) and is often called \"round to nearest (even)\" or \"banker's rounding\". It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > rounding" ], diff --git a/sd.json b/sd.json index 156e4b38..4616756b 100644 --- a/sd.json +++ b/sd.json @@ -1,7 +1,7 @@ { "id": "sd", "summary": "Standard deviation", - "description": "Computes the sample standard deviation, which quantifies the amount of variation of an array of numbers. It is defined to be the square root of the corresponding variance (see ``variance()``).\n\nA low standard deviation indicates that the values tend to be close to the expected value, while a high standard deviation indicates that the values are spread out over a wider range.\n\nAn array without non-`null` elements resolves always with `null`.", + "description": "Computes the sample standard deviation, which quantifies the amount of variation of an array of numbers. It is defined to be the square root of the corresponding variance (see ``variance()``).\n\nA low standard deviation indicates that the values tend to be close to the expected value, while a high standard deviation indicates that the values are spread out over a wider range.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "math > statistics", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -62,13 +62,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null } ], "links": [ @@ -101,4 +94,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/sgn.json b/sgn.json index ecdbd9d1..5019957e 100644 --- a/sgn.json +++ b/sgn.json @@ -1,7 +1,7 @@ { "id": "sgn", "summary": "Signum", - "description": "The signum (also known as *sign*) of `x` is defined as:\n\n* *1* if *x > 0*\n* *0* if *x = 0*\n* *-1* if *x < 0*\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "The signum (also known as *sign*) of `x` is defined as:\n\n* *1* if *x > 0*\n* *0* if *x = 0*\n* *-1* if *x < 0*\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math" ], diff --git a/sin.json b/sin.json index 15285979..01fbc9cb 100644 --- a/sin.json +++ b/sin.json @@ -1,7 +1,7 @@ { "id": "sin", "summary": "Sine", - "description": "Computes the sine of `x`.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the sine of `x`.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/sinh.json b/sinh.json index 6eced19c..3ee8271e 100644 --- a/sinh.json +++ b/sinh.json @@ -1,7 +1,7 @@ { "id": "sinh", "summary": "Hyperbolic sine", - "description": "Computes the hyperbolic sine of `x`.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the hyperbolic sine of `x`.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/sort.json b/sort.json index 422f8d53..a375e386 100644 --- a/sort.json +++ b/sort.json @@ -45,7 +45,7 @@ }, { "name": "nodata", - "description": "Controls the handling of no-data values (`null`). By default, they are removed. If set to `true`, missing values in the data are put last; if set to `false`, they are put first.", + "description": "Controls the handling of no-data values. For the default value `null`, all no-data values get removed. If set to `true`, no-data values in the data are moved to the end of the array. If set to `false`, they are moved to the start of the array.", "schema": { "type": [ "boolean", diff --git a/sqrt.json b/sqrt.json index b85caf94..efe65919 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*. 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.", + "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\nNo-data values are passed through and therefore get propagated.", "categories": [ "math", "math > exponential & logarithmic" diff --git a/subtract.json b/subtract.json index 2cf8aba7..feb24c06 100644 --- a/subtract.json +++ b/subtract.json @@ -1,7 +1,7 @@ { "id": "subtract", "summary": "Subtraction of two numbers", - "description": "Subtracts argument `y` from the argument `x` (*`x - y`*) and returns the computed result.\n\nNo-data values are taken into account so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", + "description": "Subtracts argument `y` from the argument `x` (*`x - y`*) and returns the computed result.\n\nNo-data values are taken into account so that the no-data value is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", "categories": [ "math" ], @@ -71,4 +71,4 @@ "title": "IEEE Standard 754-2019 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/sum.json b/sum.json index 17af5bfe..912ba47a 100644 --- a/sum.json +++ b/sum.json @@ -1,7 +1,7 @@ { "id": "sum", "summary": "Compute the sum by adding up numbers", - "description": "Sums up all elements in a sequential array of numbers and returns the computed sum.\n\nBy default no-data values are ignored. Setting `ignore_nodata` to `false` considers no-data values so that `null` is returned if any element is such a value.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.", + "description": "Sums up all elements in a sequential array of numbers and returns the computed sum.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "math", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -105,4 +105,4 @@ "title": "IEEE Standard 754-2019 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/tan.json b/tan.json index 6e927ffc..59557039 100644 --- a/tan.json +++ b/tan.json @@ -1,7 +1,7 @@ { "id": "tan", "summary": "Tangent", - "description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`tan(pi()/2 + multipliy(pi(), n))`* with `n` being any integer results in ±infinity. -infinity for negative values passed to `tan`, +infinity otherwise. If the processing environment does not supports it, an exception is thrown.", + "description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`tan(pi()/2 + multipliy(pi(), n))`* with `n` being any integer results in ±infinity. -infinity for negative values passed to `tan`, +infinity otherwise. If the processing environment does not supports it, an exception is thrown.", "categories": [ "math > trigonometric" ], diff --git a/tanh.json b/tanh.json index a38462c9..96b15804 100644 --- a/tanh.json +++ b/tanh.json @@ -1,7 +1,7 @@ { "id": "tanh", "summary": "Hyperbolic tangent", - "description": "Computes the hyperbolic tangent of `x`. The tangent is defined to be the hyperbolic sine of x divided by the hyperbolic cosine of x.\n\nThe no-data value `null` is passed through and therefore gets propagated.", + "description": "Computes the hyperbolic tangent of `x`. The tangent is defined to be the hyperbolic sine of x divided by the hyperbolic cosine of x.\n\nNo-data values are passed through and therefore get propagated.", "categories": [ "math > trigonometric" ], diff --git a/text_begins.json b/text_begins.json index 766d5f0f..f422999f 100644 --- a/text_begins.json +++ b/text_begins.json @@ -1,7 +1,7 @@ { "id": "text_begins", "summary": "Text begins with another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. Both are expected to be encoded in UTF-8 by default. The no-data value `null` is passed through and therefore gets propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.", "categories": [ "texts", "comparison" diff --git a/text_contains.json b/text_contains.json index 9b78318f..d0046131 100644 --- a/text_contains.json +++ b/text_contains.json @@ -1,7 +1,7 @@ { "id": "text_contains", "summary": "Text contains another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern`. Both are expected to be encoded in UTF-8 by default. The no-data value `null` is passed through and therefore gets propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern`. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.", "categories": [ "texts", "comparison" diff --git a/text_ends.json b/text_ends.json index f31e8e12..7bd2238c 100644 --- a/text_ends.json +++ b/text_ends.json @@ -1,7 +1,7 @@ { "id": "text_ends", "summary": "Text ends with another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the end. Both are expected to be encoded in UTF-8 by default. The no-data value `null` is passed through and therefore gets propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the end. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.", "categories": [ "texts", "comparison" diff --git a/variance.json b/variance.json index 78f76feb..0ab044d7 100644 --- a/variance.json +++ b/variance.json @@ -1,7 +1,7 @@ { "id": "variance", "summary": "Variance", - "description": "Computes the sample variance of an array of numbers by calculating the square of the standard deviation (see ``sd()``). It is defined to be the expectation of the squared deviation of a random variable from its expected value. Basically, it measures how far the numbers in the array are spread out from their average value.\n\nAn array without non-`null` elements resolves always with `null`.", + "description": "Computes the sample variance of an array of numbers by calculating the square of the standard deviation (see ``sd()``). It is defined to be the expectation of the squared deviation of a random variable from its expected value. Basically, it measures how far the numbers in the array are spread out from their average value.\n\nAn array with solely no-data values returns the no-data value (or `null`).", "categories": [ "math > statistics", "reducer" @@ -22,7 +22,7 @@ }, { "name": "ignore_nodata", - "description": "Indicates whether no-data values are ignored or not. Ignores them by default. Setting this flag to `false` considers no-data values so that `null` is returned if any value is such a value.", + "description": "Indicates whether no-data values are ignored or not. Ignores them by default. If set to `false`, any no-data value in the array results in a no-data value (or `null`).", "schema": { "type": "boolean" }, @@ -75,13 +75,6 @@ "ignore_nodata": false }, "returns": null - }, - { - "description": "The input array is empty: return `null`.", - "arguments": { - "data": [] - }, - "returns": null } ], "links": [ @@ -149,4 +142,4 @@ "result": true } } -} \ No newline at end of file +} diff --git a/xor.json b/xor.json index 6af7ae5e..01b8efda 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```\nx \\ y || 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 any argument is a no-data value, the result will be the no-data value whenever the outcome is ambiguous.\n\n**Truth table:**\n\n```\nx \\ y || no-data | false | true\n------- || ------- | ------- | -------\nno-data || no-data | no-data | no-data\nfalse || no-data | false | true\ntrue || no-data | true | false\n```", "categories": [ "logic" ], From d19039a6f3d205991c8138f78f441e804ae7db40 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 3 Jan 2024 14:56:03 +0100 Subject: [PATCH 02/39] Clarify NaN in comparisons, clarify character encoding issues --- CHANGELOG.md | 8 ++++++-- eq.json | 9 ++++++++- gt.json | 9 ++++++++- gte.json | 9 ++++++++- lt.json | 9 ++++++++- lte.json | 9 ++++++++- meta/implementation.md | 22 ++++++++++++++++++---- neq.json | 9 ++++++++- proposals/is_infinite.json | 4 ++-- text_begins.json | 2 +- text_contains.json | 2 +- text_ends.json | 2 +- 12 files changed, 77 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4811eee..f4ec2834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Clarified for various mathematical functions the defined input and output ranges. Mention that `NaN` is returned outside of the defined input range where possible. -- Clarified for various processes the handling of no-data values and null, see also the [implementation guide](meta/implementation.md). [#480](https://github.com/Open-EO/openeo-processes/issues/480) +- Clarified for various mathematical functions the defined input and output ranges. + Mention that `NaN` is returned outside of the defined input range where possible. +- Clarified for several comparison processes how `NaN` values have to be handled. +- Clarified for various processes the handling of no-data values and `null`, see also the [implementation guide](meta/implementation.md#no-data-value). [#480](https://github.com/Open-EO/openeo-processes/issues/480) +- 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) - `array_interpolate_linear`: Apply interpolation to NaN and no-data values. - `clip`: Throw an exception if min > max. [#472](https://github.com/Open-EO/openeo-processes/issues/472) diff --git a/eq.json b/eq.json index b1b23385..73ffaaa4 100644 --- a/eq.json +++ b/eq.json @@ -1,7 +1,7 @@ { "id": "eq", "summary": "Equal to comparison", - "description": "Compares whether `x` is strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "texts", "comparison" @@ -146,5 +146,12 @@ }, "returns": false } + ], + "links": [ + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" + } ] } diff --git a/gt.json b/gt.json index 542f618c..dbb33296 100644 --- a/gt.json +++ b/gt.json @@ -1,7 +1,7 @@ { "id": "gt", "summary": "Greater than comparison", - "description": "Compares whether `x` is strictly greater than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is strictly greater than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If any operand is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -90,5 +90,12 @@ }, "returns": false } + ], + "links": [ + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" + } ] } diff --git a/gte.json b/gte.json index 712b6b9c..3c054ba8 100644 --- a/gte.json +++ b/gte.json @@ -1,7 +1,7 @@ { "id": "gte", "summary": "Greater than or equal to comparison", - "description": "Compares whether `x` is greater than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is greater than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If the operands are not equal (see process ``eq()``) and any of them is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -84,6 +84,13 @@ "returns": false } ], + "links": [ + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" + } + ], "process_graph": { "eq": { "process_id": "eq", diff --git a/lt.json b/lt.json index b7e35bf4..bcb167b1 100644 --- a/lt.json +++ b/lt.json @@ -1,7 +1,7 @@ { "id": "lt", "summary": "Less than comparison", - "description": "Compares whether `x` is strictly less than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If any operand is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is strictly less than `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If any operand is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -90,5 +90,12 @@ }, "returns": false } + ], + "links": [ + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" + } ] } diff --git a/lte.json b/lte.json index 5ab05126..0968dfa1 100644 --- a/lte.json +++ b/lte.json @@ -1,7 +1,7 @@ { "id": "lte", "summary": "Less than or equal to comparison", - "description": "Compares whether `x` is less than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* If the operands are not equal (see process ``eq()``) and any of them is not a `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is less than or equal to `y`.\n\n**Remarks:**\n\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* If the operands are not equal (see process ``eq()``) and any of them is not the data type `number`, the process returns `false`.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "comparison" ], @@ -84,6 +84,13 @@ "returns": false } ], + "links": [ + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" + } + ], "process_graph": { "eq": { "process_id": "eq", diff --git a/meta/implementation.md b/meta/implementation.md index fafe6ea0..0f7e75ca 100644 --- a/meta/implementation.md +++ b/meta/implementation.md @@ -4,16 +4,16 @@ This file is meant to provide some additional implementation details for back-en ## No-data value -A data cube shall always keep reference of the applicable no-data values. -The no-data value can be chosen by the back-end implementation, e.g. depending on the data type of the data. +A data cube shall always keep reference of the applicable no-data value(s). +The no-data values can be chosen by the back-end implementation, e.g. depending on the data type of the data. No-data values should be exposed for each pre-defined Collection in its metadata. For all data generated through openEO (e.g. through synchronous or batch jobs), the metadata and/or data shall expose the no-data values. -The openEO process specifications generally use `null` as a generic value to express no-data values. +The openEO process specifications generally uses `null` as a generic value to express no-data values. This is primarily meant for the JSON encoding, this means: 1. in the process specification (data type `null` in the schema), and -2. in the process graph (if the no-data value exposed through the metadata can't be used in JSON). +2. in the process graph (if the no-data value exposed through the metadata can't be used in JSON, e.g. `NaN`). Back-ends may or may not use `null` as a no-data value internally. @@ -23,12 +23,26 @@ no-data values in openEO and `NaN` (IEEE 754) sometimes differs. **Array processes:** Some array processes (e.g. `array_find` or `any`) use `null` as a return value. In the context of data cube operations (e.g. in `reduce_dimension`), `null` values returned by the array processes shall be replaced with the no-data value of the data cube. +As the processes may be used outside of data cubes where the no-data values are undefined, +most processes fall back to `null` in this case (reflected through the mention of "(or `null`)" in the process description). ## Optimizations for conditions (e.g. `if`) None of the openEO processes per se is "special" and thus all are treated the same way by default. Nevertheless, there are some cases where a special treatment can make a huge difference. +## Character encoding + +String-related processes previously mentioned that strings have to be "encoded in UTF-8 by default". +This was removed and we clarify the behavior here: + +For data transfer through the API, the character encoding of strings is specified using HTTP headers. +This means all strings provided in the process graph have the same encoding as specified in the HTTP headers. +Back-ends can internally use any character encoding and as such may need to convert the character encoding +upon receipt of the process graph. +It is recommended to use a [Unicode](https://en.wikipedia.org/wiki/Unicode) character encoding such as UTF-8. +In case of doubt, clients and server should assume UTF-8 as character encoding. + ### Branching behavior The `if` process (and any process that is working on some kind of condition) are usually diff --git a/neq.json b/neq.json index 1b115b3b..383d6b8b 100644 --- a/neq.json +++ b/neq.json @@ -1,7 +1,7 @@ { "id": "neq", "summary": "Not equal to comparison", - "description": "Compares whether `x` is **not** strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* Strings are expected to be encoded in UTF-8 by default.\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", + "description": "Compares whether `x` is **not** strictly equal to `y`.\n\n**Remarks:**\n\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*. Nevertheless, an integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`.\n* If any operand is a no-data value, the result will be the no-data value (or `null`).\n* The comparison of `NaN` (not a number) follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229).\n* Temporal strings are normal strings. To compare temporal strings as dates/times, use ``date_difference()``.", "categories": [ "texts", "comparison" @@ -147,6 +147,13 @@ "returns": true } ], + "links": [ + { + "rel": "about", + "href": "https://ieeexplore.ieee.org/document/4610935", + "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" + } + ], "process_graph": { "eq": { "process_id": "eq", diff --git a/proposals/is_infinite.json b/proposals/is_infinite.json index b6a5acca..da0d165f 100644 --- a/proposals/is_infinite.json +++ b/proposals/is_infinite.json @@ -1,7 +1,7 @@ { "id": "is_infinite", "summary": "Value is an infinite number", - "description": "Checks whether the specified value `x` is an infinite number. The definition of infinite numbers follows the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935). The special numerical value `NaN` (not a number) as defined by the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935) is not an infinite number and must return `false`.", + "description": "Checks whether the specified value `x` is an infinite number. The definition of infinite numbers (and `NaN`) follows the [IEEE Standard 754](https://ieeexplore.ieee.org/document/4610935). `NaN` (not a number) is not an infinite number and must return `false`.", "categories": [ "comparison" ], @@ -28,4 +28,4 @@ "title": "IEEE Standard 754-2008 for Floating-Point Arithmetic" } ] -} \ No newline at end of file +} diff --git a/text_begins.json b/text_begins.json index f422999f..8fc39624 100644 --- a/text_begins.json +++ b/text_begins.json @@ -1,7 +1,7 @@ { "id": "text_begins", "summary": "Text begins with another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. No-data values are passed through and therefore get propagated.", "categories": [ "texts", "comparison" diff --git a/text_contains.json b/text_contains.json index d0046131..a41a3d95 100644 --- a/text_contains.json +++ b/text_contains.json @@ -1,7 +1,7 @@ { "id": "text_contains", "summary": "Text contains another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern`. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern`. No-data values are passed through and therefore get propagated.", "categories": [ "texts", "comparison" diff --git a/text_ends.json b/text_ends.json index 7bd2238c..70a04855 100644 --- a/text_ends.json +++ b/text_ends.json @@ -1,7 +1,7 @@ { "id": "text_ends", "summary": "Text ends with another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the end. Both are expected to be encoded in UTF-8 by default. No-data values are passed through and therefore get propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the end. No-data values are passed through and therefore get propagated.", "categories": [ "texts", "comparison" From 281584a1a61e225387e83dab554b30a7101615f7 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 5 Jan 2024 13:33:39 +0100 Subject: [PATCH 03/39] Updates according to PR review --- absolute.json | 2 +- all.json | 2 +- any.json | 2 +- arccos.json | 2 +- arcosh.json | 2 +- arcsin.json | 2 +- arctan.json | 2 +- array_find.json | 4 ++-- arsinh.json | 2 +- artanh.json | 2 +- between.json | 2 +- ceil.json | 2 +- clip.json | 2 +- cos.json | 2 +- cosh.json | 2 +- exp.json | 2 +- floor.json | 2 +- int.json | 2 +- linear_scale_range.json | 2 +- ln.json | 2 +- meta/implementation.md | 1 + not.json | 2 +- proposals/array_find_label.json | 6 +++--- round.json | 2 +- sgn.json | 2 +- sin.json | 2 +- sinh.json | 2 +- sqrt.json | 2 +- tan.json | 2 +- tanh.json | 2 +- text_begins.json | 2 +- text_contains.json | 2 +- text_ends.json | 2 +- 33 files changed, 36 insertions(+), 35 deletions(-) diff --git a/absolute.json b/absolute.json index fa5d003f..3b83437a 100644 --- a/absolute.json +++ b/absolute.json @@ -1,7 +1,7 @@ { "id": "absolute", "summary": "Absolute value", - "description": "Computes the absolute value of a real number `x`, which is the \"unsigned\" portion of `x` and often denoted as *|x|*.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the absolute value of a real number `x`, which is the \"unsigned\" portion of `x` and often denoted as *|x|*.\n\nNo-data values are passed through.", "categories": [ "math" ], diff --git a/all.json b/all.json index 2e8bec38..dbf751a4 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 `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 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.", "categories": [ "logic", "reducer" diff --git a/any.json b/any.json index f54c9cf4..4cdce32d 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 `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 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`.", "categories": [ "logic", "reducer" diff --git a/arccos.json b/arccos.json index 87378a40..91e19977 100644 --- a/arccos.json +++ b/arccos.json @@ -1,7 +1,7 @@ { "id": "arccos", "summary": "Inverse cosine", - "description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values outside of the allowed range.", + "description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through. `NaN` is returned for values < -1 and > 1.", "categories": [ "math > trigonometric" ], diff --git a/arcosh.json b/arcosh.json index 800ad449..9222a122 100644 --- a/arcosh.json +++ b/arcosh.json @@ -1,7 +1,7 @@ { "id": "arcosh", "summary": "Inverse hyperbolic cosine", - "description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values outside of the allowed range.", + "description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nNo-data values are passed through. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > trigonometric" ], diff --git a/arcsin.json b/arcsin.json index 9f6c72ee..b927813d 100644 --- a/arcsin.json +++ b/arcsin.json @@ -1,7 +1,7 @@ { "id": "arcsin", "summary": "Inverse sine", - "description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values < -1 and > 1.", + "description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through. `NaN` is returned for values < -1 and > 1.", "categories": [ "math > trigonometric" ], diff --git a/arctan.json b/arctan.json index 08c7eb5c..c091218b 100644 --- a/arctan.json +++ b/arctan.json @@ -1,7 +1,7 @@ { "id": "arctan", "summary": "Inverse tangent", - "description": "Computes the arc tangent of `x`. The arc tangent is the inverse function of the tangent so that *`arctan(tan(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the arc tangent of `x`. The arc tangent is the inverse function of the tangent so that *`arctan(tan(x)) = x`*.\n\nWorks on radians only.\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/array_find.json b/array_find.json index 6344d223..58eb5ea7 100644 --- a/array_find.json +++ b/array_find.json @@ -1,7 +1,7 @@ { "id": "array_find", "summary": "Get the index for a value in an array", - "description": "Returns the zero-based index of the first (or last) occurrence of the value specified by `value` in the array specified by `data` or `null` if there is no match. Use the parameter `reverse` to switch from the first to the last match.\n\n**Remarks:**\n\n* Use ``array_contains()`` to check if an array contains a value regardless of the position.\n* Use ``array_find_label()`` to find the index for a label.\n* All definitions for the process ``eq()`` regarding the comparison of values apply here as well. A no-data return value from ``eq()`` is handled as `false` (no match).\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*.\n* An integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`. Still, this process may return unexpectedly `false` when comparing floating-point numbers due to floating-point inaccuracy in machine-based computation.\n* Temporal strings are treated as normal strings and MUST NOT be interpreted.\n* If the specified value is an array, object or null, the process always returns `null`. See the examples to find no-data values.", + "description": "Returns the zero-based index of the first (or last) occurrence of the value specified by `value` in the array specified by `data` or the no-data value (or `null`) if there is no match. Use the parameter `reverse` to switch from the first to the last match.\n\n**Remarks:**\n\n* Use ``array_contains()`` to check if an array contains a value regardless of the position.\n* Use ``array_find_label()`` to find the index for a label.\n* All definitions for the process ``eq()`` regarding the comparison of values apply here as well. A no-data return value from ``eq()`` is handled as `false` (no match).\n* Data types MUST be checked strictly. For example, a string with the content *1* is not equal to the number *1*.\n* An integer *1* is equal to a floating-point number *1.0* as `integer` is a sub-type of `number`. Still, this process may return unexpectedly `false` when comparing floating-point numbers due to floating-point inaccuracy in machine-based computation.\n* Temporal strings are treated as normal strings and MUST NOT be interpreted.\n* If the specified value is an array, object or null, the process always returns the no-data value (or `null`). See the examples to find no-data values.", "categories": [ "arrays", "reducer" @@ -35,7 +35,7 @@ } ], "returns": { - "description": "The index of the first element with the specified value. If no element was found, `null` is returned.", + "description": "The index of the first element with the specified value. If no element was found, the no-data value (or `null`) is returned.", "schema": [ { "type": "null" diff --git a/arsinh.json b/arsinh.json index 405ab410..31e6bf56 100644 --- a/arsinh.json +++ b/arsinh.json @@ -1,7 +1,7 @@ { "id": "arsinh", "summary": "Inverse hyperbolic sine", - "description": "Computes the inverse hyperbolic sine of `x`. It is the inverse function of the hyperbolic sine so that *`arsinh(sinh(x)) = x`*.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the inverse hyperbolic sine of `x`. It is the inverse function of the hyperbolic sine so that *`arsinh(sinh(x)) = x`*.\n\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/artanh.json b/artanh.json index c7d4778d..a61956c1 100644 --- a/artanh.json +++ b/artanh.json @@ -1,7 +1,7 @@ { "id": "artanh", "summary": "Inverse hyperbolic tangent", - "description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nNo-data values are passed through and therefore get propagated. `NaN` is returned for values outside of the allowed range. The computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, `x` = 1 results in +infinity and `x` = 0 results in -infinity. Otherwise, an exception is thrown.", + "description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nNo-data values are passed through. `NaN` is returned for values outside of the allowed range. The computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, `x` = 1 results in +infinity and `x` = 0 results in -infinity. Otherwise, an exception is thrown.", "categories": [ "math > trigonometric" ], diff --git a/between.json b/between.json index b09d09fb..a362776c 100644 --- a/between.json +++ b/between.json @@ -8,7 +8,7 @@ "parameters": [ { "name": "x", - "description": "The value to check.\n\nNo-data values are passed through and therefore get propagated.", + "description": "The value to check.\n\nNo-data values are passed through.", "schema": { "description": "Any data type is allowed." } diff --git a/ceil.json b/ceil.json index 9f237bf1..f98dccdc 100644 --- a/ceil.json +++ b/ceil.json @@ -1,7 +1,7 @@ { "id": "ceil", "summary": "Round fractions up", - "description": "The least integer greater than or equal to the number `x`.\n\nNo-data values are passed through and therefore get propagated.", + "description": "The least integer greater than or equal to the number `x`.\n\nNo-data values are passed through.", "categories": [ "math > rounding" ], diff --git a/clip.json b/clip.json index 04c2d7b4..a34a191e 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. If the maximum value is smaller than the minimum number, the process throws a `MinMaxSwapped` exception.\n\nNo-data values are passed through and therefore get 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\nNo-data values are passed through.", "categories": [ "math" ], diff --git a/cos.json b/cos.json index ac312c20..b1e0b98c 100644 --- a/cos.json +++ b/cos.json @@ -1,7 +1,7 @@ { "id": "cos", "summary": "Cosine", - "description": "Computes the cosine of `x`.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the cosine of `x`.\n\nWorks on radians only.\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/cosh.json b/cosh.json index 572a6161..64fbd88d 100644 --- a/cosh.json +++ b/cosh.json @@ -1,7 +1,7 @@ { "id": "cosh", "summary": "Hyperbolic cosine", - "description": "Computes the hyperbolic cosine of `x`.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the hyperbolic cosine of `x`.\n\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/exp.json b/exp.json index bceeef2c..a7bb1746 100644 --- a/exp.json +++ b/exp.json @@ -1,7 +1,7 @@ { "id": "exp", "summary": "Exponentiation to the base e", - "description": "Exponential function to the base *e* raised to the power of `p`.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Exponential function to the base *e* raised to the power of `p`.\n\nNo-data values are passed through.", "categories": [ "math > exponential & logarithmic" ], diff --git a/floor.json b/floor.json index 63c1c48d..621513af 100644 --- a/floor.json +++ b/floor.json @@ -1,7 +1,7 @@ { "id": "floor", "summary": "Round fractions down", - "description": "The greatest integer less than or equal to the number `x`.\n\nThis process is *not* an alias for the ``int()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nNo-data values are passed through and therefore get propagated.", + "description": "The greatest integer less than or equal to the number `x`.\n\nThis process is *not* an alias for the ``int()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nNo-data values are passed through.", "categories": [ "math > rounding" ], diff --git a/int.json b/int.json index 32d1424a..20ede2df 100644 --- a/int.json +++ b/int.json @@ -1,7 +1,7 @@ { "id": "int", "summary": "Integer part of a number", - "description": "The integer part of the real number `x`.\n\nThis process is *not* an alias for the ``floor()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nNo-data values are passed through and therefore get propagated.", + "description": "The integer part of the real number `x`.\n\nThis process is *not* an alias for the ``floor()`` process as defined by some mathematicians, see the examples for negative numbers in both processes for differences.\n\nNo-data values are passed through.", "categories": [ "math", "math > rounding" diff --git a/linear_scale_range.json b/linear_scale_range.json index c3de1096..9346d8ba 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 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\nNo-data values are passed through and therefore get 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\nNo-data values are passed through.", "categories": [ "math" ], diff --git a/ln.json b/ln.json index 6b9b5022..54729115 100644 --- a/ln.json +++ b/ln.json @@ -1,7 +1,7 @@ { "id": "ln", "summary": "Natural logarithm", - "description": "The natural logarithm is the logarithm to the base *e* of the number `x`, which equals to using the *log* process with the base set to *e*. The natural logarithm is the inverse function of taking *e* to the power x.\n\nNo-data values are passed through and therefore get propagated.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`ln(0)`* results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", + "description": "The natural logarithm is the logarithm to the base *e* of the number `x`, which equals to using the *log* process with the base set to *e*. The natural logarithm is the inverse function of taking *e* to the power x.\n\nNo-data values are passed through.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`ln(0)`* results in -infinity if the processing environment supports it or otherwise an exception is thrown. `NaN` is returned for values outside of the allowed range.", "categories": [ "math > exponential & logarithmic" ], diff --git a/meta/implementation.md b/meta/implementation.md index 0f7e75ca..10137a06 100644 --- a/meta/implementation.md +++ b/meta/implementation.md @@ -25,6 +25,7 @@ In the context of data cube operations (e.g. in `reduce_dimension`), `null` valu by the array processes shall be replaced with the no-data value of the data cube. As the processes may be used outside of data cubes where the no-data values are undefined, most processes fall back to `null` in this case (reflected through the mention of "(or `null`)" in the process description). +This effectively means that `null` is the default value for an undefined no-data value in openEO. ## Optimizations for conditions (e.g. `if`) diff --git a/not.json b/not.json index 5879a767..8701a4e3 100644 --- a/not.json +++ b/not.json @@ -1,7 +1,7 @@ { "id": "not", "summary": "Inverting a boolean", - "description": "Inverts a single boolean so that `true` gets `false` and `false` gets `true`.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Inverts a single boolean so that `true` gets `false` and `false` gets `true`.\n\nNo-data values are passed through.", "categories": [ "logic" ], diff --git a/proposals/array_find_label.json b/proposals/array_find_label.json index 98371cb5..fb8c24fd 100644 --- a/proposals/array_find_label.json +++ b/proposals/array_find_label.json @@ -1,7 +1,7 @@ { "id": "array_find_label", "summary": "Get the index for a label in a labeled array", - "description": "Checks whether the labeled array specified for `data` has the label specified in `label` and returns the zero-based index for it. If there's no match as either the label doesn't exist or the array is not labeled, `null` is returned.\n\nUse ``array_find()`` to find the index for a given value in the array.", + "description": "Checks whether the labeled array specified for `data` has the label specified in `label` and returns the zero-based index for it. If there's no match as either the label doesn't exist or the array is not labeled, the no-data value (or `null`) is returned.\n\nUse ``array_find()`` to find the index for a given value in the array.", "categories": [ "arrays", "reducer" @@ -32,7 +32,7 @@ } ], "returns": { - "description": "The index of the element with the specified label assigned. If no such label was found, `null` is returned.", + "description": "The index of the element with the specified label assigned. If no such label was found, the no-data value (or `null`) is returned.", "schema": [ { "type": "null" @@ -43,4 +43,4 @@ } ] } -} \ No newline at end of file +} diff --git a/round.json b/round.json index aa1d8d87..8f61b8a0 100644 --- a/round.json +++ b/round.json @@ -1,7 +1,7 @@ { "id": "round", "summary": "Round to a specified precision", - "description": "Rounds a real number `x` to specified precision `p`.\n\nIf `x` is halfway between closest numbers of precision `p`, it is rounded to the closest even number of precision `p`.\nThis behavior follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) and is often called \"round to nearest (even)\" or \"banker's rounding\". It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Rounds a real number `x` to specified precision `p`.\n\nIf `x` is halfway between closest numbers of precision `p`, it is rounded to the closest even number of precision `p`.\nThis behavior follows [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) and is often called \"round to nearest (even)\" or \"banker's rounding\". It minimizes rounding errors that result from consistently rounding a midpoint value in a single direction.\n\nNo-data values are passed through.", "categories": [ "math > rounding" ], diff --git a/sgn.json b/sgn.json index 5019957e..98772952 100644 --- a/sgn.json +++ b/sgn.json @@ -1,7 +1,7 @@ { "id": "sgn", "summary": "Signum", - "description": "The signum (also known as *sign*) of `x` is defined as:\n\n* *1* if *x > 0*\n* *0* if *x = 0*\n* *-1* if *x < 0*\n\nNo-data values are passed through and therefore get propagated.", + "description": "The signum (also known as *sign*) of `x` is defined as:\n\n* *1* if *x > 0*\n* *0* if *x = 0*\n* *-1* if *x < 0*\n\nNo-data values are passed through.", "categories": [ "math" ], diff --git a/sin.json b/sin.json index 01fbc9cb..989be23d 100644 --- a/sin.json +++ b/sin.json @@ -1,7 +1,7 @@ { "id": "sin", "summary": "Sine", - "description": "Computes the sine of `x`.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the sine of `x`.\n\nWorks on radians only.\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/sinh.json b/sinh.json index 3ee8271e..4bfa4975 100644 --- a/sinh.json +++ b/sinh.json @@ -1,7 +1,7 @@ { "id": "sinh", "summary": "Hyperbolic sine", - "description": "Computes the hyperbolic sine of `x`.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the hyperbolic sine of `x`.\n\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/sqrt.json b/sqrt.json index efe65919..446ded3c 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*. 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\nNo-data values are passed through and therefore get 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\nNo-data values are passed through.", "categories": [ "math", "math > exponential & logarithmic" diff --git a/tan.json b/tan.json index 59557039..372e3188 100644 --- a/tan.json +++ b/tan.json @@ -1,7 +1,7 @@ { "id": "tan", "summary": "Tangent", - "description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nNo-data values are passed through and therefore get propagated.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`tan(pi()/2 + multipliy(pi(), n))`* with `n` being any integer results in ±infinity. -infinity for negative values passed to `tan`, +infinity otherwise. If the processing environment does not supports it, an exception is thrown.", + "description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nNo-data values are passed through.\n\nThe computations follow [IEEE Standard 754](https://ieeexplore.ieee.org/document/8766229) whenever the processing environment supports it. Therefore, *`tan(pi()/2 + multipliy(pi(), n))`* with `n` being any integer results in ±infinity. -infinity for negative values passed to `tan`, +infinity otherwise. If the processing environment does not supports it, an exception is thrown.", "categories": [ "math > trigonometric" ], diff --git a/tanh.json b/tanh.json index 96b15804..41eab735 100644 --- a/tanh.json +++ b/tanh.json @@ -1,7 +1,7 @@ { "id": "tanh", "summary": "Hyperbolic tangent", - "description": "Computes the hyperbolic tangent of `x`. The tangent is defined to be the hyperbolic sine of x divided by the hyperbolic cosine of x.\n\nNo-data values are passed through and therefore get propagated.", + "description": "Computes the hyperbolic tangent of `x`. The tangent is defined to be the hyperbolic sine of x divided by the hyperbolic cosine of x.\n\nNo-data values are passed through.", "categories": [ "math > trigonometric" ], diff --git a/text_begins.json b/text_begins.json index 8fc39624..873fd649 100644 --- a/text_begins.json +++ b/text_begins.json @@ -1,7 +1,7 @@ { "id": "text_begins", "summary": "Text begins with another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. No-data values are passed through and therefore get propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the beginning. No-data values are passed through.", "categories": [ "texts", "comparison" diff --git a/text_contains.json b/text_contains.json index a41a3d95..21d5ea9f 100644 --- a/text_contains.json +++ b/text_contains.json @@ -1,7 +1,7 @@ { "id": "text_contains", "summary": "Text contains another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern`. No-data values are passed through and therefore get propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern`. No-data values are passed through.", "categories": [ "texts", "comparison" diff --git a/text_ends.json b/text_ends.json index 70a04855..a63fc424 100644 --- a/text_ends.json +++ b/text_ends.json @@ -1,7 +1,7 @@ { "id": "text_ends", "summary": "Text ends with another text", - "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the end. No-data values are passed through and therefore get propagated.", + "description": "Checks whether the text (also known as *string*) specified for `data` contains the text specified for `pattern` at the end. No-data values are passed through.", "categories": [ "texts", "comparison" From 35891d9d4446d966f9e3d8940272438aaeba3af8 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 12 Oct 2023 14:16:51 +0200 Subject: [PATCH 04/39] Add first tests from process examples --- tests/README.md | 25 +++++ tests/absolute.json5 | 28 ++++++ tests/add.json5 | 25 +++++ tests/add_dimension.json5 | 3 + tests/aggregate_spatial.json5 | 3 + tests/aggregate_spatial_window.json5 | 3 + tests/aggregate_temporal.json5 | 53 +++++++++++ tests/aggregate_temporal_period.json5 | 3 + tests/all.json5 | 94 +++++++++++++++++++ tests/and.json5 | 39 ++++++++ tests/anomaly.json5 | 3 + tests/any.json5 | 94 +++++++++++++++++++ tests/apply.json5 | 3 + tests/apply_dimension.json5 | 3 + tests/apply_kernel.json5 | 3 + tests/apply_neighborhood.json5 | 58 ++++++++++++ tests/apply_polygon.json5 | 3 + tests/arccos.json5 | 10 ++ tests/arcosh.json5 | 10 ++ tests/arcsin.json5 | 10 ++ tests/arctan.json5 | 10 ++ tests/arctan2.json5 | 18 ++++ tests/array_append.json5 | 18 ++++ tests/array_apply.json5 | 3 + tests/array_concat.json5 | 40 ++++++++ tests/array_contains.json5 | 64 +++++++++++++ tests/array_create.json5 | 55 +++++++++++ tests/array_create_labeled.json5 | 3 + tests/array_element.json5 | 36 ++++++++ tests/array_filter.json5 | 3 + tests/array_find.json5 | 116 +++++++++++++++++++++++ tests/array_find_label.json5 | 3 + tests/array_interpolate_linear.json5 | 40 ++++++++ tests/array_labels.json5 | 3 + tests/array_modify.json5 | 121 ++++++++++++++++++++++++ tests/arsinh.json5 | 10 ++ tests/artanh.json5 | 10 ++ tests/between.json5 | 46 ++++++++++ tests/ceil.json5 | 28 ++++++ tests/climatological_normal.json5 | 3 + tests/clip.json5 | 36 ++++++++ tests/constant.json5 | 3 + tests/cos.json5 | 10 ++ tests/cosh.json5 | 10 ++ tests/count.json5 | 66 +++++++++++++ tests/create_data_cube.json5 | 3 + tests/cummax.json5 | 59 ++++++++++++ tests/cummin.json5 | 59 ++++++++++++ tests/cumproduct.json5 | 63 +++++++++++++ tests/cumsum.json5 | 59 ++++++++++++ tests/date_between.json5 | 12 +++ tests/date_difference.json5 | 33 +++++++ tests/date_shift.json5 | 72 +++++++++++++++ tests/dimension_labels.json5 | 3 + tests/divide.json5 | 25 +++++ tests/drop_dimension.json5 | 3 + tests/e.json5 | 3 + tests/eq.json5 | 100 ++++++++++++++++++++ tests/exp.json5 | 16 ++++ tests/extrema.json5 | 58 ++++++++++++ tests/filter_bands.json5 | 3 + tests/filter_bbox.json5 | 3 + tests/filter_labels.json5 | 28 ++++++ tests/filter_spatial.json5 | 3 + tests/filter_temporal.json5 | 3 + tests/filter_vector.json5 | 3 + tests/first.json5 | 43 +++++++++ tests/flatten_dimensions.json5 | 3 + tests/floor.json5 | 28 ++++++ tests/gt.json5 | 60 ++++++++++++ tests/gte.json5 | 53 +++++++++++ tests/if.json5 | 54 +++++++++++ tests/int.json5 | 28 ++++++ tests/is_infinite.json5 | 3 + tests/is_nan.json5 | 22 +++++ tests/is_nodata.json5 | 31 +++++++ tests/is_valid.json5 | 31 +++++++ tests/last.json5 | 43 +++++++++ tests/linear_scale_range.json5 | 41 +++++++++ tests/ln.json5 | 10 ++ tests/load_geojson.json5 | 3 + tests/load_stac.json5 | 58 ++++++++++++ tests/load_uploaded_files.json5 | 3 + tests/load_url.json5 | 3 + tests/log.json5 | 32 +++++++ tests/lt.json5 | 60 ++++++++++++ tests/lte.json5 | 53 +++++++++++ tests/mask.json5 | 3 + tests/mask_polygon.json5 | 3 + tests/max.json5 | 46 ++++++++++ tests/mean.json5 | 53 +++++++++++ tests/median.json5 | 73 +++++++++++++++ tests/merge_cubes.json5 | 3 + tests/min.json5 | 45 +++++++++ tests/mod.json5 | 46 ++++++++++ tests/multiply.json5 | 25 +++++ tests/nan.json5 | 3 + tests/ndvi.json5 | 3 + tests/neq.json5 | 93 +++++++++++++++++++ tests/normalized_difference.json5 | 3 + tests/not.json5 | 22 +++++ tests/or.json5 | 39 ++++++++ tests/order.json5 | 127 ++++++++++++++++++++++++++ tests/pi.json5 | 3 + tests/power.json5 | 53 +++++++++++ tests/product.json5 | 56 ++++++++++++ tests/quantiles.json5 | 99 ++++++++++++++++++++ tests/rearrange.json5 | 66 +++++++++++++ tests/reduce_dimension.json5 | 3 + tests/reduce_spatial.json5 | 3 + tests/rename_dimension.json5 | 3 + tests/rename_labels.json5 | 24 +++++ tests/resample_cube_spatial.json5 | 3 + tests/resample_cube_temporal.json5 | 3 + tests/resample_spatial.json5 | 3 + tests/round.json5 | 57 ++++++++++++ tests/sd.json5 | 34 +++++++ tests/sgn.json5 | 28 ++++++ tests/sin.json5 | 10 ++ tests/sinh.json5 | 10 ++ tests/sort.json5 | 64 +++++++++++++ tests/sqrt.json5 | 28 ++++++ tests/subtract.json5 | 25 +++++ tests/sum.json5 | 56 ++++++++++++ tests/tan.json5 | 10 ++ tests/tanh.json5 | 10 ++ tests/text_begins.json5 | 48 ++++++++++ tests/text_concat.json5 | 61 +++++++++++++ tests/text_contains.json5 | 48 ++++++++++ tests/text_ends.json5 | 48 ++++++++++ tests/trim_cube.json5 | 3 + tests/unflatten_dimension.json5 | 3 + tests/variance.json5 | 47 ++++++++++ tests/vector_buffer.json5 | 3 + tests/vector_reproject.json5 | 3 + tests/vector_to_regular_points.json5 | 3 + tests/xor.json5 | 39 ++++++++ 137 files changed, 4045 insertions(+) create mode 100644 tests/README.md create mode 100644 tests/absolute.json5 create mode 100644 tests/add.json5 create mode 100644 tests/add_dimension.json5 create mode 100644 tests/aggregate_spatial.json5 create mode 100644 tests/aggregate_spatial_window.json5 create mode 100644 tests/aggregate_temporal.json5 create mode 100644 tests/aggregate_temporal_period.json5 create mode 100644 tests/all.json5 create mode 100644 tests/and.json5 create mode 100644 tests/anomaly.json5 create mode 100644 tests/any.json5 create mode 100644 tests/apply.json5 create mode 100644 tests/apply_dimension.json5 create mode 100644 tests/apply_kernel.json5 create mode 100644 tests/apply_neighborhood.json5 create mode 100644 tests/apply_polygon.json5 create mode 100644 tests/arccos.json5 create mode 100644 tests/arcosh.json5 create mode 100644 tests/arcsin.json5 create mode 100644 tests/arctan.json5 create mode 100644 tests/arctan2.json5 create mode 100644 tests/array_append.json5 create mode 100644 tests/array_apply.json5 create mode 100644 tests/array_concat.json5 create mode 100644 tests/array_contains.json5 create mode 100644 tests/array_create.json5 create mode 100644 tests/array_create_labeled.json5 create mode 100644 tests/array_element.json5 create mode 100644 tests/array_filter.json5 create mode 100644 tests/array_find.json5 create mode 100644 tests/array_find_label.json5 create mode 100644 tests/array_interpolate_linear.json5 create mode 100644 tests/array_labels.json5 create mode 100644 tests/array_modify.json5 create mode 100644 tests/arsinh.json5 create mode 100644 tests/artanh.json5 create mode 100644 tests/between.json5 create mode 100644 tests/ceil.json5 create mode 100644 tests/climatological_normal.json5 create mode 100644 tests/clip.json5 create mode 100644 tests/constant.json5 create mode 100644 tests/cos.json5 create mode 100644 tests/cosh.json5 create mode 100644 tests/count.json5 create mode 100644 tests/create_data_cube.json5 create mode 100644 tests/cummax.json5 create mode 100644 tests/cummin.json5 create mode 100644 tests/cumproduct.json5 create mode 100644 tests/cumsum.json5 create mode 100644 tests/date_between.json5 create mode 100644 tests/date_difference.json5 create mode 100644 tests/date_shift.json5 create mode 100644 tests/dimension_labels.json5 create mode 100644 tests/divide.json5 create mode 100644 tests/drop_dimension.json5 create mode 100644 tests/e.json5 create mode 100644 tests/eq.json5 create mode 100644 tests/exp.json5 create mode 100644 tests/extrema.json5 create mode 100644 tests/filter_bands.json5 create mode 100644 tests/filter_bbox.json5 create mode 100644 tests/filter_labels.json5 create mode 100644 tests/filter_spatial.json5 create mode 100644 tests/filter_temporal.json5 create mode 100644 tests/filter_vector.json5 create mode 100644 tests/first.json5 create mode 100644 tests/flatten_dimensions.json5 create mode 100644 tests/floor.json5 create mode 100644 tests/gt.json5 create mode 100644 tests/gte.json5 create mode 100644 tests/if.json5 create mode 100644 tests/int.json5 create mode 100644 tests/is_infinite.json5 create mode 100644 tests/is_nan.json5 create mode 100644 tests/is_nodata.json5 create mode 100644 tests/is_valid.json5 create mode 100644 tests/last.json5 create mode 100644 tests/linear_scale_range.json5 create mode 100644 tests/ln.json5 create mode 100644 tests/load_geojson.json5 create mode 100644 tests/load_stac.json5 create mode 100644 tests/load_uploaded_files.json5 create mode 100644 tests/load_url.json5 create mode 100644 tests/log.json5 create mode 100644 tests/lt.json5 create mode 100644 tests/lte.json5 create mode 100644 tests/mask.json5 create mode 100644 tests/mask_polygon.json5 create mode 100644 tests/max.json5 create mode 100644 tests/mean.json5 create mode 100644 tests/median.json5 create mode 100644 tests/merge_cubes.json5 create mode 100644 tests/min.json5 create mode 100644 tests/mod.json5 create mode 100644 tests/multiply.json5 create mode 100644 tests/nan.json5 create mode 100644 tests/ndvi.json5 create mode 100644 tests/neq.json5 create mode 100644 tests/normalized_difference.json5 create mode 100644 tests/not.json5 create mode 100644 tests/or.json5 create mode 100644 tests/order.json5 create mode 100644 tests/pi.json5 create mode 100644 tests/power.json5 create mode 100644 tests/product.json5 create mode 100644 tests/quantiles.json5 create mode 100644 tests/rearrange.json5 create mode 100644 tests/reduce_dimension.json5 create mode 100644 tests/reduce_spatial.json5 create mode 100644 tests/rename_dimension.json5 create mode 100644 tests/rename_labels.json5 create mode 100644 tests/resample_cube_spatial.json5 create mode 100644 tests/resample_cube_temporal.json5 create mode 100644 tests/resample_spatial.json5 create mode 100644 tests/round.json5 create mode 100644 tests/sd.json5 create mode 100644 tests/sgn.json5 create mode 100644 tests/sin.json5 create mode 100644 tests/sinh.json5 create mode 100644 tests/sort.json5 create mode 100644 tests/sqrt.json5 create mode 100644 tests/subtract.json5 create mode 100644 tests/sum.json5 create mode 100644 tests/tan.json5 create mode 100644 tests/tanh.json5 create mode 100644 tests/text_begins.json5 create mode 100644 tests/text_concat.json5 create mode 100644 tests/text_contains.json5 create mode 100644 tests/text_ends.json5 create mode 100644 tests/trim_cube.json5 create mode 100644 tests/unflatten_dimension.json5 create mode 100644 tests/variance.json5 create mode 100644 tests/vector_buffer.json5 create mode 100644 tests/vector_reproject.json5 create mode 100644 tests/vector_to_regular_points.json5 create mode 100644 tests/xor.json5 diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..c124b15e --- /dev/null +++ b/tests/README.md @@ -0,0 +1,25 @@ +# Tests + +This folder contains test cases for the openEO processes. +To allow for more data types (e.g. infinity and nan for numbers), all the files are encoded in **JSON5**. + +## Missing processes + +The following processes have no test cases as the results heavily depend on the underlying implementation +or need an external services to be available for testing (e.g. loading files from the user workspace or a UDF server). +We don't expect that we can provide meaningful test cases for these processes. + +- ard_normalized_radar_backscatter +- ard_surface_reflectance +- atmospheric_correction +- cloud_detection +- fit_curve +- inspect +- load_collection +- load_uploaded_files +- predict_curve +- run_udf +- run_udf_externally +- sar_backscatter +- save_result +- vector_to_random_points \ No newline at end of file diff --git a/tests/absolute.json5 b/tests/absolute.json5 new file mode 100644 index 00000000..e7f17c42 --- /dev/null +++ b/tests/absolute.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": 3.5 + }, + "returns": 3.5 + }, + { + "arguments": { + "x": -0.4 + }, + "returns": 0.4 + }, + { + "arguments": { + "x": -3.5 + }, + "returns": 3.5 + } + ] +} \ No newline at end of file diff --git a/tests/add.json5 b/tests/add.json5 new file mode 100644 index 00000000..1b0c998c --- /dev/null +++ b/tests/add.json5 @@ -0,0 +1,25 @@ +{ + "tests": [ + { + "arguments": { + "x": 5, + "y": 2.5 + }, + "returns": 7.5 + }, + { + "arguments": { + "x": -2, + "y": -4 + }, + "returns": -6 + }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/add_dimension.json5 b/tests/add_dimension.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/add_dimension.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/aggregate_spatial.json5 b/tests/aggregate_spatial.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/aggregate_spatial.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/aggregate_spatial_window.json5 b/tests/aggregate_spatial_window.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/aggregate_spatial_window.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/aggregate_temporal.json5 b/tests/aggregate_temporal.json5 new file mode 100644 index 00000000..48aedb62 --- /dev/null +++ b/tests/aggregate_temporal.json5 @@ -0,0 +1,53 @@ +{ + "tests": [ + { + "arguments": { + "data": { + "from_parameter": "data" + }, + "intervals": [ + [ + "2015-01-01", + "2016-01-01" + ], + [ + "2016-01-01", + "2017-01-01" + ], + [ + "2017-01-01", + "2018-01-01" + ], + [ + "2018-01-01", + "2019-01-01" + ], + [ + "2019-01-01", + "2020-01-01" + ] + ], + "labels": [ + "2015", + "2016", + "2017", + "2018", + "2019" + ], + "reducer": { + "process_graph": { + "mean1": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + } + } + ] +} \ No newline at end of file diff --git a/tests/aggregate_temporal_period.json5 b/tests/aggregate_temporal_period.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/aggregate_temporal_period.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/all.json5 b/tests/all.json5 new file mode 100644 index 00000000..3d2a96a0 --- /dev/null +++ b/tests/all.json5 @@ -0,0 +1,94 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + false, + null + ] + }, + "returns": false + }, + { + "arguments": { + "data": [ + true, + null + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + false, + null + ], + "ignore_nodata": false + }, + "returns": false + }, + { + "arguments": { + "data": [ + true, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [ + true, + false, + true, + false + ] + }, + "returns": false + }, + { + "arguments": { + "data": [ + true, + false + ] + }, + "returns": false + }, + { + "arguments": { + "data": [ + true, + true + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + true + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/and.json5 b/tests/and.json5 new file mode 100644 index 00000000..6e2c8eb8 --- /dev/null +++ b/tests/and.json5 @@ -0,0 +1,39 @@ +{ + "tests": [ + { + "arguments": { + "x": true, + "y": true + }, + "returns": true + }, + { + "arguments": { + "x": true, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": false, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": false, + "y": null + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/anomaly.json5 b/tests/anomaly.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/anomaly.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/any.json5 b/tests/any.json5 new file mode 100644 index 00000000..952782b3 --- /dev/null +++ b/tests/any.json5 @@ -0,0 +1,94 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + false, + null + ] + }, + "returns": false + }, + { + "arguments": { + "data": [ + true, + null + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + false, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [ + true, + null + ], + "ignore_nodata": false + }, + "returns": true + }, + { + "arguments": { + "data": [ + true, + false, + true, + false + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + true, + false + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + false, + false + ] + }, + "returns": false + }, + { + "arguments": { + "data": [ + true + ] + }, + "returns": true + }, + { + "arguments": { + "data": [ + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/apply.json5 b/tests/apply.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/apply.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/apply_dimension.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/apply_kernel.json5 b/tests/apply_kernel.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/apply_kernel.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/apply_neighborhood.json5 b/tests/apply_neighborhood.json5 new file mode 100644 index 00000000..e8ecd477 --- /dev/null +++ b/tests/apply_neighborhood.json5 @@ -0,0 +1,58 @@ +{ + "tests": [ + { + "arguments": { + "data": { + "from_parameter": "data" + }, + "process": { + "process_graph": { + "udf": { + "process_id": "run_udf", + "arguments": { + "data": { + "from_parameter": "data" + }, + "udf": "ml.py", + "runtime": "Python" + }, + "result": true + } + } + }, + "size": [ + { + "dimension": "x", + "value": 128, + "unit": "px" + }, + { + "dimension": "y", + "value": 128, + "unit": "px" + }, + { + "dimension": "t", + "value": "P5D" + } + ], + "overlap": [ + { + "dimension": "x", + "value": 16, + "unit": "px" + }, + { + "dimension": "y", + "value": 16, + "unit": "px" + }, + { + "dimension": "t", + "value": "P3D" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/tests/apply_polygon.json5 b/tests/apply_polygon.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/apply_polygon.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/arccos.json5 b/tests/arccos.json5 new file mode 100644 index 00000000..beee54a9 --- /dev/null +++ b/tests/arccos.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 1 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/arcosh.json5 b/tests/arcosh.json5 new file mode 100644 index 00000000..beee54a9 --- /dev/null +++ b/tests/arcosh.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 1 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/arcsin.json5 b/tests/arcsin.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/arcsin.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/arctan.json5 b/tests/arctan.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/arctan.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/arctan2.json5 b/tests/arctan2.json5 new file mode 100644 index 00000000..2c885ef2 --- /dev/null +++ b/tests/arctan2.json5 @@ -0,0 +1,18 @@ +{ + "tests": [ + { + "arguments": { + "y": 0, + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "y": null, + "x": 1.5 + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/array_append.json5 b/tests/array_append.json5 new file mode 100644 index 00000000..c42b176f --- /dev/null +++ b/tests/array_append.json5 @@ -0,0 +1,18 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 2 + ], + "value": 3 + }, + "returns": [ + 1, + 2, + 3 + ] + } + ] +} \ No newline at end of file diff --git a/tests/array_apply.json5 b/tests/array_apply.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/array_apply.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 new file mode 100644 index 00000000..af0c6263 --- /dev/null +++ b/tests/array_concat.json5 @@ -0,0 +1,40 @@ +{ + "tests": [ + { + "description": "Concatenates two numerical arrays.", + "arguments": { + "array1": [ + 1.5, + 2.5 + ], + "array2": [ + 5 + ] + }, + "returns": [ + 1.5, + 2.5, + 5 + ] + }, + { + "description": "Concatenates two arrays containing different data type, may not always be supported.", + "arguments": { + "array1": [ + "a", + "b" + ], + "array2": [ + 1, + 2 + ] + }, + "returns": [ + "a", + "b", + 1, + 2 + ] + } + ] +} \ No newline at end of file diff --git a/tests/array_contains.json5 b/tests/array_contains.json5 new file mode 100644 index 00000000..402977a2 --- /dev/null +++ b/tests/array_contains.json5 @@ -0,0 +1,64 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 2, + 3 + ], + "value": 2 + }, + "returns": true + }, + { + "arguments": { + "data": [ + "A", + "B", + "C" + ], + "value": "b" + }, + "returns": false + }, + { + "arguments": { + "data": [ + 1, + 2, + 3 + ], + "value": "2" + }, + "returns": false + }, + { + "arguments": { + "data": [ + 1, + 2, + null + ], + "value": null + }, + "returns": false + }, + { + "arguments": { + "data": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ] + ], + "value": 2 + }, + "returns": false + } + ] +} \ No newline at end of file diff --git a/tests/array_create.json5 b/tests/array_create.json5 new file mode 100644 index 00000000..41475587 --- /dev/null +++ b/tests/array_create.json5 @@ -0,0 +1,55 @@ +{ + "tests": [ + { + "arguments": {}, + "returns": [] + }, + { + "arguments": { + "data": [ + "this", + "is", + "a", + "test" + ] + }, + "returns": [ + "this", + "is", + "a", + "test" + ] + }, + { + "arguments": { + "data": [ + null + ], + "repeat": 3 + }, + "returns": [ + null, + null, + null + ] + }, + { + "arguments": { + "data": [ + 1, + 2, + 3 + ], + "repeat": 2 + }, + "returns": [ + 1, + 2, + 3, + 1, + 2, + 3 + ] + } + ] +} \ No newline at end of file diff --git a/tests/array_create_labeled.json5 b/tests/array_create_labeled.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/array_create_labeled.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/array_element.json5 b/tests/array_element.json5 new file mode 100644 index 00000000..4d543ef6 --- /dev/null +++ b/tests/array_element.json5 @@ -0,0 +1,36 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 9, + 8, + 7, + 6, + 5 + ], + "index": 2 + }, + "returns": 7 + }, + { + "arguments": { + "data": [ + "A", + "B", + "C" + ], + "index": 0 + }, + "returns": "A" + }, + { + "arguments": { + "data": [], + "index": 0, + "return_nodata": true + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/array_filter.json5 b/tests/array_filter.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/array_filter.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/array_find.json5 b/tests/array_find.json5 new file mode 100644 index 00000000..aad20aa6 --- /dev/null +++ b/tests/array_find.json5 @@ -0,0 +1,116 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 2, + 3, + 2, + 3 + ], + "value": 2 + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + 2, + 3 + ], + "value": 2, + "reverse": true + }, + "returns": 3 + }, + { + "arguments": { + "data": [ + "A", + "B", + "C" + ], + "value": "b" + }, + "returns": null + }, + { + "arguments": { + "data": [ + 1, + 2, + 3 + ], + "value": "2" + }, + "returns": null + }, + { + "arguments": { + "data": [ + 1, + null, + 2, + null + ], + "value": null + }, + "returns": null + }, + { + "arguments": { + "data": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ] + ], + "value": [ + 1, + 2 + ] + }, + "returns": null + }, + { + "arguments": { + "data": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ] + ], + "value": 2 + }, + "returns": null + }, + { + "arguments": { + "data": [ + { + "a": "b" + }, + { + "c": "d" + } + ], + "value": { + "a": "b" + } + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/array_find_label.json5 b/tests/array_find_label.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/array_find_label.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/array_interpolate_linear.json5 b/tests/array_interpolate_linear.json5 new file mode 100644 index 00000000..6e3b6aa0 --- /dev/null +++ b/tests/array_interpolate_linear.json5 @@ -0,0 +1,40 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + null, + 1, + null, + 6, + null, + -8 + ] + }, + "returns": [ + null, + 1, + 3.5, + 6, + -1, + -8 + ] + }, + { + "arguments": { + "data": [ + null, + 1, + null, + null + ] + }, + "returns": [ + null, + 1, + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/array_labels.json5 b/tests/array_labels.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/array_labels.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/array_modify.json5 b/tests/array_modify.json5 new file mode 100644 index 00000000..c5686dcd --- /dev/null +++ b/tests/array_modify.json5 @@ -0,0 +1,121 @@ +{ + "tests": [ + { + "description": "Replace a single value in the array.", + "arguments": { + "data": [ + "a", + "d", + "c" + ], + "values": [ + "b" + ], + "index": 1, + "length": 1 + }, + "returns": [ + "a", + "b", + "c" + ] + }, + { + "description": "Replace multiple values in the array.", + "arguments": { + "data": [ + "a", + "b", + 4, + 5 + ], + "values": [ + 1, + 2, + 3 + ], + "index": 0, + "length": 2 + }, + "returns": [ + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "description": "Insert a value to the array at a given position.", + "arguments": { + "data": [ + "a", + "c" + ], + "values": [ + "b" + ], + "index": 1 + }, + "returns": [ + "a", + "b", + "c" + ] + }, + { + "description": "Remove a single value from the array.", + "arguments": { + "data": [ + "a", + "b", + null, + "c" + ], + "values": [], + "index": 2 + }, + "returns": [ + "a", + "b", + "c" + ] + }, + { + "description": "Remove multiple values from the array.", + "arguments": { + "data": [ + null, + null, + "a", + "b", + "c" + ], + "values": [], + "index": 0, + "length": 2 + }, + "returns": [ + "a", + "b", + "c" + ] + }, + { + "description": "Remove multiple values from the end of the array and ignore that the given length is exceeding the size of the array.", + "arguments": { + "data": [ + "a", + "b", + "c" + ], + "values": [], + "index": 1, + "length": 10 + }, + "returns": [ + "a" + ] + } + ] +} \ No newline at end of file diff --git a/tests/arsinh.json5 b/tests/arsinh.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/arsinh.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/artanh.json5 b/tests/artanh.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/artanh.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/between.json5 b/tests/between.json5 new file mode 100644 index 00000000..1834bf2e --- /dev/null +++ b/tests/between.json5 @@ -0,0 +1,46 @@ +{ + "tests": [ + { + "arguments": { + "x": null, + "min": 0, + "max": 1 + }, + "returns": null + }, + { + "arguments": { + "x": 1, + "min": 0, + "max": 1 + }, + "returns": true + }, + { + "arguments": { + "x": 1, + "min": 0, + "max": 1, + "exclude_max": true + }, + "returns": false + }, + { + "description": "Swapped bounds (min is greater than max) MUST always return `false`.", + "arguments": { + "x": 0.5, + "min": 1, + "max": 0 + }, + "returns": false + }, + { + "arguments": { + "x": -0.5, + "min": -1, + "max": 0 + }, + "returns": true + } + ] +} \ No newline at end of file diff --git a/tests/ceil.json5 b/tests/ceil.json5 new file mode 100644 index 00000000..582819cd --- /dev/null +++ b/tests/ceil.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": 3.5 + }, + "returns": 4 + }, + { + "arguments": { + "x": -0.4 + }, + "returns": 0 + }, + { + "arguments": { + "x": -3.5 + }, + "returns": -3 + } + ] +} \ No newline at end of file diff --git a/tests/climatological_normal.json5 b/tests/climatological_normal.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/climatological_normal.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/clip.json5 b/tests/clip.json5 new file mode 100644 index 00000000..422f2596 --- /dev/null +++ b/tests/clip.json5 @@ -0,0 +1,36 @@ +{ + "tests": [ + { + "arguments": { + "x": -5, + "min": -1, + "max": 1 + }, + "returns": -1 + }, + { + "arguments": { + "x": 10.001, + "min": 1, + "max": 10 + }, + "returns": 10 + }, + { + "arguments": { + "x": 0.000001, + "min": 0, + "max": 0.02 + }, + "returns": 0.000001 + }, + { + "arguments": { + "x": null, + "min": 0, + "max": 1 + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/constant.json5 b/tests/constant.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/constant.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/cos.json5 b/tests/cos.json5 new file mode 100644 index 00000000..aeeca727 --- /dev/null +++ b/tests/cos.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 1 + } + ] +} \ No newline at end of file diff --git a/tests/cosh.json5 b/tests/cosh.json5 new file mode 100644 index 00000000..aeeca727 --- /dev/null +++ b/tests/cosh.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 1 + } + ] +} \ No newline at end of file diff --git a/tests/count.json5 b/tests/count.json5 new file mode 100644 index 00000000..4cde763a --- /dev/null +++ b/tests/count.json5 @@ -0,0 +1,66 @@ +{ + "tests": [ + { + "arguments": { + "data": [] + }, + "returns": 0 + }, + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": 4 + }, + { + "arguments": { + "data": [ + "ABC", + null + ] + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + false, + null + ], + "condition": true + }, + "returns": 2 + }, + { + "arguments": { + "data": [ + 0, + 1, + 2, + 3, + 4, + 5, + null + ], + "condition": { + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_parameter": "element" + }, + "y": 2 + }, + "result": true + } + } + }, + "returns": 3 + } + ] +} \ No newline at end of file diff --git a/tests/create_data_cube.json5 b/tests/create_data_cube.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/create_data_cube.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/cummax.json5 b/tests/cummax.json5 new file mode 100644 index 00000000..3c8de96f --- /dev/null +++ b/tests/cummax.json5 @@ -0,0 +1,59 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 3, + 5, + 3, + 1 + ] + }, + "returns": [ + 1, + 3, + 5, + 5, + 5 + ] + }, + { + "arguments": { + "data": [ + 1, + 3, + null, + 5, + 1 + ] + }, + "returns": [ + 1, + 3, + null, + 5, + 5 + ] + }, + { + "arguments": { + "data": [ + 1, + 3, + null, + 5, + 1 + ], + "ignore_nodata": false + }, + "returns": [ + 1, + 3, + null, + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/cummin.json5 b/tests/cummin.json5 new file mode 100644 index 00000000..63dfd7a3 --- /dev/null +++ b/tests/cummin.json5 @@ -0,0 +1,59 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 5, + 3, + 1, + 3, + 5 + ] + }, + "returns": [ + 5, + 3, + 1, + 1, + 1 + ] + }, + { + "arguments": { + "data": [ + 5, + 3, + null, + 1, + 5 + ] + }, + "returns": [ + 5, + 3, + null, + 1, + 1 + ] + }, + { + "arguments": { + "data": [ + 5, + 3, + null, + 1, + 5 + ], + "ignore_nodata": false + }, + "returns": [ + 5, + 3, + null, + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/cumproduct.json5 b/tests/cumproduct.json5 new file mode 100644 index 00000000..ef14e4f3 --- /dev/null +++ b/tests/cumproduct.json5 @@ -0,0 +1,63 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 3, + 5, + 3, + 1 + ] + }, + "returns": [ + 1, + 3, + 15, + 45, + 45 + ] + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + null, + 3, + 1 + ] + }, + "returns": [ + 1, + 2, + 6, + null, + 18, + 18 + ] + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + null, + 3, + 1 + ], + "ignore_nodata": false + }, + "returns": [ + 1, + 2, + 6, + null, + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/cumsum.json5 b/tests/cumsum.json5 new file mode 100644 index 00000000..b05bd200 --- /dev/null +++ b/tests/cumsum.json5 @@ -0,0 +1,59 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 3, + 5, + 3, + 1 + ] + }, + "returns": [ + 1, + 4, + 9, + 12, + 13 + ] + }, + { + "arguments": { + "data": [ + 1, + 3, + null, + 3, + 1 + ] + }, + "returns": [ + 1, + 4, + null, + 7, + 8 + ] + }, + { + "arguments": { + "data": [ + 1, + 3, + null, + 3, + 1 + ], + "ignore_nodata": false + }, + "returns": [ + 1, + 4, + null, + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/date_between.json5 b/tests/date_between.json5 new file mode 100644 index 00000000..6f3ab4c9 --- /dev/null +++ b/tests/date_between.json5 @@ -0,0 +1,12 @@ +{ + "tests": [ + { + "arguments": { + "x": "2020-01-01", + "min": "2021-01-01", + "max": "2022-01-01" + }, + "returns": false + } + ] +} \ No newline at end of file diff --git a/tests/date_difference.json5 b/tests/date_difference.json5 new file mode 100644 index 00000000..e36b1b55 --- /dev/null +++ b/tests/date_difference.json5 @@ -0,0 +1,33 @@ +{ + "tests": [ + { + "arguments": { + "date1": "2020-01-01T00:00:00.0Z", + "date2": "2020-01-01T00:00:15.5Z" + }, + "returns": 15.5 + }, + { + "arguments": { + "date1": "2020-01-01T00:00:00Z", + "date2": "2020-01-01T01:00:00+01:00" + }, + "returns": 0 + }, + { + "arguments": { + "date1": "2020-01-02", + "date2": "2020-01-01" + }, + "returns": -86400 + }, + { + "arguments": { + "date1": "2020-01-02", + "date2": "2020-01-01", + "unit": "day" + }, + "returns": -1 + } + ] +} \ No newline at end of file diff --git a/tests/date_shift.json5 b/tests/date_shift.json5 new file mode 100644 index 00000000..1606cec3 --- /dev/null +++ b/tests/date_shift.json5 @@ -0,0 +1,72 @@ +{ + "tests": [ + { + "arguments": { + "date": "2020-02-01T17:22:45Z", + "value": 6, + "unit": "month" + }, + "returns": "2020-08-01T17:22:45Z" + }, + { + "arguments": { + "date": "2021-03-31T00:00:00+02:00", + "value": -7, + "unit": "day" + }, + "returns": "2021-03-24T00:00:00+02:00" + }, + { + "description": "Adding a year to February 29th in a leap year will result in February 28th in the next (non-leap) year.", + "arguments": { + "date": "2020-02-29T17:22:45Z", + "value": 1, + "unit": "year" + }, + "returns": "2021-02-28T17:22:45Z" + }, + { + "description": "Adding a month to January 31th will result in February 29th in leap years.", + "arguments": { + "date": "2020-01-31", + "value": 1, + "unit": "month" + }, + "returns": "2020-02-29" + }, + { + "description": "The process skips over the leap second `2016-12-31T23:59:60Z`.", + "arguments": { + "date": "2016-12-31T23:59:59Z", + "value": 1, + "unit": "second" + }, + "returns": "2017-01-01T00:00:00Z" + }, + { + "description": "Milliseconds can be added or subtracted. If not given, the default value is `0`.", + "arguments": { + "date": "2018-12-31T17:22:45Z", + "value": 1150, + "unit": "millisecond" + }, + "returns": "2018-12-31T17:22:46.150Z" + }, + { + "arguments": { + "date": "2018-01-01", + "value": 25, + "unit": "hour" + }, + "returns": "2018-01-02" + }, + { + "arguments": { + "date": "2018-01-01", + "value": -1, + "unit": "hour" + }, + "returns": "2017-12-31" + } + ] +} \ No newline at end of file diff --git a/tests/dimension_labels.json5 b/tests/dimension_labels.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/dimension_labels.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/divide.json5 b/tests/divide.json5 new file mode 100644 index 00000000..571a4891 --- /dev/null +++ b/tests/divide.json5 @@ -0,0 +1,25 @@ +{ + "tests": [ + { + "arguments": { + "x": 5, + "y": 2.5 + }, + "returns": 2 + }, + { + "arguments": { + "x": -2, + "y": 4 + }, + "returns": -0.5 + }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/drop_dimension.json5 b/tests/drop_dimension.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/drop_dimension.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/e.json5 b/tests/e.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/e.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/eq.json5 b/tests/eq.json5 new file mode 100644 index 00000000..99742372 --- /dev/null +++ b/tests/eq.json5 @@ -0,0 +1,100 @@ +{ + "tests": [ + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": 1, + "y": 1 + }, + "returns": true + }, + { + "arguments": { + "x": 1, + "y": "1" + }, + "returns": false + }, + { + "arguments": { + "x": 0, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": 1.02, + "y": 1, + "delta": 0.01 + }, + "returns": false + }, + { + "arguments": { + "x": -1, + "y": -1.001, + "delta": 0.01 + }, + "returns": true + }, + { + "arguments": { + "x": 115, + "y": 110, + "delta": 10 + }, + "returns": true + }, + { + "arguments": { + "x": "Test", + "y": "test" + }, + "returns": false + }, + { + "arguments": { + "x": "Test", + "y": "test", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "x": "Ä", + "y": "ä", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "x": "2018-01-01T00:00:00Z", + "y": "2018-01-01T00:00:00+00:00" + }, + "returns": false + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/exp.json5 b/tests/exp.json5 new file mode 100644 index 00000000..14da6e26 --- /dev/null +++ b/tests/exp.json5 @@ -0,0 +1,16 @@ +{ + "tests": [ + { + "arguments": { + "p": 0 + }, + "returns": 1 + }, + { + "arguments": { + "p": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/extrema.json5 b/tests/extrema.json5 new file mode 100644 index 00000000..94fdce69 --- /dev/null +++ b/tests/extrema.json5 @@ -0,0 +1,58 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": [ + 0, + 3 + ] + }, + { + "arguments": { + "data": [ + 5, + 2.5, + null, + -0.7 + ] + }, + "returns": [ + -0.7, + 5 + ] + }, + { + "arguments": { + "data": [ + 1, + 0, + 3, + null, + 2 + ], + "ignore_nodata": false + }, + "returns": [ + null, + null + ] + }, + { + "description": "The input array is empty: return two `null` values.", + "arguments": { + "data": [] + }, + "returns": [ + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/filter_bands.json5 b/tests/filter_bands.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/filter_bands.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/filter_bbox.json5 b/tests/filter_bbox.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/filter_bbox.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/filter_labels.json5 b/tests/filter_labels.json5 new file mode 100644 index 00000000..849670cd --- /dev/null +++ b/tests/filter_labels.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "description": "Filters the data cube to only contain data from platform Sentinel-2A. This example assumes that the data cube has a dimension `platform` so that computations can distinguish between Sentinel-2A and Sentinel-2B data.", + "arguments": { + "data": { + "from_parameter": "sentinel2_data" + }, + "condition": { + "process_graph": { + "eq": { + "process_id": "eq", + "arguments": { + "x": { + "from_parameter": "value" + }, + "y": "Sentinel-2A", + "case_sensitive": false + }, + "result": true + } + } + }, + "dimension": "platform" + } + } + ] +} \ No newline at end of file diff --git a/tests/filter_spatial.json5 b/tests/filter_spatial.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/filter_spatial.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/filter_temporal.json5 b/tests/filter_temporal.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/filter_temporal.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/filter_vector.json5 b/tests/filter_vector.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/filter_vector.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/first.json5 b/tests/first.json5 new file mode 100644 index 00000000..f2c3243a --- /dev/null +++ b/tests/first.json5 @@ -0,0 +1,43 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + null, + "A", + "B" + ] + }, + "returns": "A" + }, + { + "arguments": { + "data": [ + null, + 2, + 3 + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/flatten_dimensions.json5 b/tests/flatten_dimensions.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/flatten_dimensions.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/floor.json5 b/tests/floor.json5 new file mode 100644 index 00000000..d7d4c059 --- /dev/null +++ b/tests/floor.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": 3.5 + }, + "returns": 3 + }, + { + "arguments": { + "x": -0.4 + }, + "returns": -1 + }, + { + "arguments": { + "x": -3.5 + }, + "returns": -4 + } + ] +} \ No newline at end of file diff --git a/tests/gt.json5 b/tests/gt.json5 new file mode 100644 index 00000000..03a09497 --- /dev/null +++ b/tests/gt.json5 @@ -0,0 +1,60 @@ +{ + "tests": [ + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": false + }, + { + "arguments": { + "x": 2, + "y": 1 + }, + "returns": true + }, + { + "arguments": { + "x": -0.5, + "y": -0.6 + }, + "returns": true + }, + { + "arguments": { + "x": "2018-01-02T00:00:00Z", + "y": "2018-01-01T00:00:00Z" + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": 0 + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/gte.json5 b/tests/gte.json5 new file mode 100644 index 00000000..642d0ed3 --- /dev/null +++ b/tests/gte.json5 @@ -0,0 +1,53 @@ +{ + "tests": [ + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": true + }, + { + "arguments": { + "x": 1, + "y": 2 + }, + "returns": false + }, + { + "arguments": { + "x": -0.5, + "y": -0.6 + }, + "returns": true + }, + { + "arguments": { + "x": "2018-01-01T00:00:00Z", + "y": "2018-01-01T00:00:00+00:00" + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/if.json5 b/tests/if.json5 new file mode 100644 index 00000000..1e3ecc27 --- /dev/null +++ b/tests/if.json5 @@ -0,0 +1,54 @@ +{ + "tests": [ + { + "arguments": { + "value": true, + "accept": "A", + "reject": "B" + }, + "returns": "A" + }, + { + "arguments": { + "value": null, + "accept": "A", + "reject": "B" + }, + "returns": "B" + }, + { + "arguments": { + "value": false, + "accept": [ + 1, + 2, + 3 + ], + "reject": [ + 4, + 5, + 6 + ] + }, + "returns": [ + 4, + 5, + 6 + ] + }, + { + "arguments": { + "value": true, + "accept": 123 + }, + "returns": 123 + }, + { + "arguments": { + "value": false, + "accept": 1 + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/int.json5 b/tests/int.json5 new file mode 100644 index 00000000..886dd8b1 --- /dev/null +++ b/tests/int.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": 3.5 + }, + "returns": 3 + }, + { + "arguments": { + "x": -0.4 + }, + "returns": 0 + }, + { + "arguments": { + "x": -3.5 + }, + "returns": -3 + } + ] +} \ No newline at end of file diff --git a/tests/is_infinite.json5 b/tests/is_infinite.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/is_infinite.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/is_nan.json5 b/tests/is_nan.json5 new file mode 100644 index 00000000..7aa14245 --- /dev/null +++ b/tests/is_nan.json5 @@ -0,0 +1,22 @@ +{ + "tests": [ + { + "arguments": { + "x": 1 + }, + "returns": false + }, + { + "arguments": { + "x": "Test" + }, + "returns": true + }, + { + "arguments": { + "x": null + }, + "returns": true + } + ] +} \ No newline at end of file diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 new file mode 100644 index 00000000..d316a73a --- /dev/null +++ b/tests/is_nodata.json5 @@ -0,0 +1,31 @@ +{ + "tests": [ + { + "arguments": { + "x": 1 + }, + "returns": false + }, + { + "arguments": { + "x": "Test" + }, + "returns": false + }, + { + "arguments": { + "x": null + }, + "returns": true + }, + { + "arguments": { + "x": [ + null, + null + ] + }, + "returns": false + } + ] +} \ No newline at end of file diff --git a/tests/is_valid.json5 b/tests/is_valid.json5 new file mode 100644 index 00000000..520042f4 --- /dev/null +++ b/tests/is_valid.json5 @@ -0,0 +1,31 @@ +{ + "tests": [ + { + "arguments": { + "x": 1 + }, + "returns": true + }, + { + "arguments": { + "x": "Test" + }, + "returns": true + }, + { + "arguments": { + "x": null + }, + "returns": false + }, + { + "arguments": { + "x": [ + null, + null + ] + }, + "returns": true + } + ] +} \ No newline at end of file diff --git a/tests/last.json5 b/tests/last.json5 new file mode 100644 index 00000000..8da4ff66 --- /dev/null +++ b/tests/last.json5 @@ -0,0 +1,43 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": 2 + }, + { + "arguments": { + "data": [ + "A", + "B", + null + ] + }, + "returns": "B" + }, + { + "arguments": { + "data": [ + 0, + 1, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 new file mode 100644 index 00000000..ed964c81 --- /dev/null +++ b/tests/linear_scale_range.json5 @@ -0,0 +1,41 @@ +{ + "tests": [ + { + "arguments": { + "x": 0.3, + "inputMin": -1, + "inputMax": 1, + "outputMin": 0, + "outputMax": 255 + }, + "returns": 165.75 + }, + { + "arguments": { + "x": 25.5, + "inputMin": 0, + "inputMax": 255 + }, + "returns": 0.1 + }, + { + "arguments": { + "x": null, + "inputMin": 0, + "inputMax": 100 + }, + "returns": null + }, + { + "description": "Shows that the input data is clipped.", + "arguments": { + "x": 1.12, + "inputMin": 0, + "inputMax": 1, + "outputMin": 0, + "outputMax": 255 + }, + "returns": 255 + } + ] +} \ No newline at end of file diff --git a/tests/ln.json5 b/tests/ln.json5 new file mode 100644 index 00000000..beee54a9 --- /dev/null +++ b/tests/ln.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 1 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/load_geojson.json5 b/tests/load_geojson.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/load_geojson.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/load_stac.json5 b/tests/load_stac.json5 new file mode 100644 index 00000000..0e44535d --- /dev/null +++ b/tests/load_stac.json5 @@ -0,0 +1,58 @@ +{ + "tests": [ + { + "title": "Load from a static STAC / batch job result", + "arguments": { + "url": "https://example.com/api/v1.0/jobs/123/results" + } + }, + { + "title": "Load from a STAC API", + "arguments": { + "url": "https://example.com/collections/SENTINEL2", + "spatial_extent": { + "west": 16.1, + "east": 16.6, + "north": 48.6, + "south": 47.2 + }, + "temporal_extent": [ + "2018-01-01", + "2019-01-01" + ], + "properties": { + "eo:cloud_cover": { + "process_graph": { + "cc": { + "process_id": "between", + "arguments": { + "x": { + "from_parameter": "value" + }, + "min": 0, + "max": 50 + }, + "result": true + } + } + }, + "platform": { + "process_graph": { + "pf": { + "process_id": "eq", + "arguments": { + "x": { + "from_parameter": "value" + }, + "y": "Sentinel-2B", + "case_sensitive": false + }, + "result": true + } + } + } + } + } + } + ] +} \ No newline at end of file diff --git a/tests/load_uploaded_files.json5 b/tests/load_uploaded_files.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/load_uploaded_files.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/load_url.json5 b/tests/load_url.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/load_url.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/log.json5 b/tests/log.json5 new file mode 100644 index 00000000..dce412d8 --- /dev/null +++ b/tests/log.json5 @@ -0,0 +1,32 @@ +{ + "tests": [ + { + "arguments": { + "x": 10, + "base": 10 + }, + "returns": 1 + }, + { + "arguments": { + "x": 2, + "base": 2 + }, + "returns": 1 + }, + { + "arguments": { + "x": 4, + "base": 2 + }, + "returns": 2 + }, + { + "arguments": { + "x": 1, + "base": 16 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/lt.json5 b/tests/lt.json5 new file mode 100644 index 00000000..d654e422 --- /dev/null +++ b/tests/lt.json5 @@ -0,0 +1,60 @@ +{ + "tests": [ + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": false + }, + { + "arguments": { + "x": 1, + "y": 2 + }, + "returns": true + }, + { + "arguments": { + "x": -0.5, + "y": -0.6 + }, + "returns": false + }, + { + "arguments": { + "x": "2018-01-01T00:00:00Z", + "y": "2018-01-02T00:00:00Z" + }, + "returns": false + }, + { + "arguments": { + "x": 0, + "y": true + }, + "returns": false + }, + { + "arguments": { + "x": false, + "y": true + }, + "returns": false + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/lte.json5 b/tests/lte.json5 new file mode 100644 index 00000000..94726885 --- /dev/null +++ b/tests/lte.json5 @@ -0,0 +1,53 @@ +{ + "tests": [ + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": true + }, + { + "arguments": { + "x": 1, + "y": 2 + }, + "returns": true + }, + { + "arguments": { + "x": -0.5, + "y": -0.6 + }, + "returns": false + }, + { + "arguments": { + "x": "2018-01-01T00:00:00Z", + "y": "2018-01-01T00:00:00+00:00" + }, + "returns": false + }, + { + "arguments": { + "x": false, + "y": true + }, + "returns": false + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/mask.json5 b/tests/mask.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/mask.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/mask_polygon.json5 b/tests/mask_polygon.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/mask_polygon.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/max.json5 b/tests/max.json5 new file mode 100644 index 00000000..bef35016 --- /dev/null +++ b/tests/max.json5 @@ -0,0 +1,46 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": 3 + }, + { + "arguments": { + "data": [ + 5, + 2.5, + null, + -0.7 + ] + }, + "returns": 5 + }, + { + "arguments": { + "data": [ + 1, + 0, + 3, + null, + 2 + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/mean.json5 b/tests/mean.json5 new file mode 100644 index 00000000..fc997cd6 --- /dev/null +++ b/tests/mean.json5 @@ -0,0 +1,53 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": 1.5 + }, + { + "arguments": { + "data": [ + 9, + 2.5, + null, + -2.5 + ] + }, + "returns": 3 + }, + { + "arguments": { + "data": [ + 1, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + }, + { + "description": "The input array has only `null` elements: return `null`.", + "arguments": { + "data": [ + null, + null + ] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/median.json5 b/tests/median.json5 new file mode 100644 index 00000000..ad549d23 --- /dev/null +++ b/tests/median.json5 @@ -0,0 +1,73 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 3, + 3, + 6, + 7, + 8, + 9 + ] + }, + "returns": 6 + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 9 + ] + }, + "returns": 4.5 + }, + { + "arguments": { + "data": [ + -1, + -0.5, + null, + 1 + ] + }, + "returns": -0.5 + }, + { + "arguments": { + "data": [ + -1, + 0, + null, + 1 + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + }, + { + "description": "The input array has only `null` elements: return `null`.", + "arguments": { + "data": [ + null, + null + ] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/merge_cubes.json5 b/tests/merge_cubes.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/merge_cubes.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/min.json5 b/tests/min.json5 new file mode 100644 index 00000000..b3a0f973 --- /dev/null +++ b/tests/min.json5 @@ -0,0 +1,45 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 1, + 0, + 3, + 2 + ] + }, + "returns": 0 + }, + { + "arguments": { + "data": [ + 5, + 2.5, + null, + -0.7 + ] + }, + "returns": -0.7 + }, + { + "arguments": { + "data": [ + 1, + 0, + 3, + null, + 2 + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/mod.json5 b/tests/mod.json5 new file mode 100644 index 00000000..d969df41 --- /dev/null +++ b/tests/mod.json5 @@ -0,0 +1,46 @@ +{ + "tests": [ + { + "arguments": { + "x": 27, + "y": 5 + }, + "returns": 2 + }, + { + "arguments": { + "x": -27, + "y": 5 + }, + "returns": 3 + }, + { + "arguments": { + "x": 3.14, + "y": -2 + }, + "returns": -0.86 + }, + { + "arguments": { + "x": -27, + "y": -5 + }, + "returns": -2 + }, + { + "arguments": { + "x": 27, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": 5 + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/multiply.json5 b/tests/multiply.json5 new file mode 100644 index 00000000..c208c85b --- /dev/null +++ b/tests/multiply.json5 @@ -0,0 +1,25 @@ +{ + "tests": [ + { + "arguments": { + "x": 5, + "y": 2.5 + }, + "returns": 12.5 + }, + { + "arguments": { + "x": -2, + "y": -4 + }, + "returns": 8 + }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/nan.json5 b/tests/nan.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/nan.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/ndvi.json5 b/tests/ndvi.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/ndvi.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/neq.json5 b/tests/neq.json5 new file mode 100644 index 00000000..6d90e2e8 --- /dev/null +++ b/tests/neq.json5 @@ -0,0 +1,93 @@ +{ + "tests": [ + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": 1, + "y": 1 + }, + "returns": false + }, + { + "arguments": { + "x": 1, + "y": "1" + }, + "returns": true + }, + { + "arguments": { + "x": 0, + "y": false + }, + "returns": true + }, + { + "arguments": { + "x": 1.02, + "y": 1, + "delta": 0.01 + }, + "returns": true + }, + { + "arguments": { + "x": -1, + "y": -1.001, + "delta": 0.01 + }, + "returns": false + }, + { + "arguments": { + "x": 115, + "y": 110, + "delta": 10 + }, + "returns": false + }, + { + "arguments": { + "x": "Test", + "y": "test" + }, + "returns": true + }, + { + "arguments": { + "x": "Test", + "y": "test", + "case_sensitive": false + }, + "returns": false + }, + { + "arguments": { + "x": "Ä", + "y": "ä", + "case_sensitive": false + }, + "returns": false + }, + { + "arguments": { + "x": "2018-01-01T00:00:00Z", + "y": "2018-01-01T00:00:00+00:00" + }, + "returns": true + }, + { + "arguments": { + "x": null, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/normalized_difference.json5 b/tests/normalized_difference.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/normalized_difference.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/not.json5 b/tests/not.json5 new file mode 100644 index 00000000..a6ec96d1 --- /dev/null +++ b/tests/not.json5 @@ -0,0 +1,22 @@ +{ + "tests": [ + { + "arguments": { + "x": null + }, + "returns": null + }, + { + "arguments": { + "x": false + }, + "returns": true + }, + { + "arguments": { + "x": true + }, + "returns": false + } + ] +} \ No newline at end of file diff --git a/tests/or.json5 b/tests/or.json5 new file mode 100644 index 00000000..4a51e098 --- /dev/null +++ b/tests/or.json5 @@ -0,0 +1,39 @@ +{ + "tests": [ + { + "arguments": { + "x": true, + "y": true + }, + "returns": true + }, + { + "arguments": { + "x": false, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": null + }, + "returns": true + }, + { + "arguments": { + "x": null, + "y": true + }, + "returns": true + }, + { + "arguments": { + "x": false, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/order.json5 b/tests/order.json5 new file mode 100644 index 00000000..bbb7efd0 --- /dev/null +++ b/tests/order.json5 @@ -0,0 +1,127 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 6, + -1, + 2, + null, + 7, + 4, + null, + 8, + 3, + 9, + 9 + ] + }, + "returns": [ + 1, + 2, + 8, + 5, + 0, + 4, + 7, + 9, + 10 + ] + }, + { + "arguments": { + "data": [ + 6, + -1, + 2, + null, + 7, + 4, + null, + 8, + 3, + 9, + 9 + ], + "nodata": true + }, + "returns": [ + 1, + 2, + 8, + 5, + 0, + 4, + 7, + 9, + 10, + 3, + 6 + ] + }, + { + "arguments": { + "data": [ + 6, + -1, + 2, + null, + 7, + 4, + null, + 8, + 3, + 9, + 9 + ], + "asc": false, + "nodata": true + }, + "returns": [ + 9, + 10, + 7, + 4, + 0, + 5, + 8, + 2, + 1, + 3, + 6 + ] + }, + { + "arguments": { + "data": [ + 6, + -1, + 2, + null, + 7, + 4, + null, + 8, + 3, + 9, + 9 + ], + "asc": false, + "nodata": false + }, + "returns": [ + 3, + 6, + 9, + 10, + 7, + 4, + 0, + 5, + 8, + 2, + 1 + ] + } + ] +} \ No newline at end of file diff --git a/tests/pi.json5 b/tests/pi.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/pi.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/power.json5 b/tests/power.json5 new file mode 100644 index 00000000..dbf78a0d --- /dev/null +++ b/tests/power.json5 @@ -0,0 +1,53 @@ +{ + "tests": [ + { + "arguments": { + "base": 0, + "p": 2 + }, + "returns": 0 + }, + { + "arguments": { + "base": 2.5, + "p": 0 + }, + "returns": 1 + }, + { + "arguments": { + "base": 3, + "p": 3 + }, + "returns": 27 + }, + { + "arguments": { + "base": 5, + "p": -1 + }, + "returns": 0.2 + }, + { + "arguments": { + "base": 1, + "p": 0.5 + }, + "returns": 1 + }, + { + "arguments": { + "base": 1, + "p": null + }, + "returns": null + }, + { + "arguments": { + "base": null, + "p": 2 + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/product.json5 b/tests/product.json5 new file mode 100644 index 00000000..a9bfdee6 --- /dev/null +++ b/tests/product.json5 @@ -0,0 +1,56 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 5, + 0 + ] + }, + "returns": 0 + }, + { + "arguments": { + "data": [ + -2, + 4, + 2.5 + ] + }, + "returns": -20 + }, + { + "arguments": { + "data": [ + 1, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [ + -1 + ] + }, + "returns": -1 + }, + { + "arguments": { + "data": [ + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/quantiles.json5 b/tests/quantiles.json5 new file mode 100644 index 00000000..d9f5c702 --- /dev/null +++ b/tests/quantiles.json5 @@ -0,0 +1,99 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 2, + 4, + 4, + 4, + 5, + 5, + 7, + 9 + ], + "probabilities": [ + 0.005, + 0.01, + 0.02, + 0.05, + 0.1, + 0.5 + ] + }, + "returns": [ + 2.07, + 2.14, + 2.28, + 2.7, + 3.4, + 4.5 + ] + }, + { + "arguments": { + "data": [ + 2, + 4, + 4, + 4, + 5, + 5, + 7, + 9 + ], + "probabilities": 4 + }, + "returns": [ + 4, + 4.5, + 5.5 + ] + }, + { + "arguments": { + "data": [ + -1, + -0.5, + null, + 1 + ], + "probabilities": 2 + }, + "returns": [ + -0.5 + ] + }, + { + "arguments": { + "data": [ + -1, + -0.5, + null, + 1 + ], + "probabilities": 4, + "ignore_nodata": false + }, + "returns": [ + null, + null, + null + ] + }, + { + "title": "Empty array", + "arguments": { + "data": [], + "probabilities": [ + 0.1, + 0.5 + ] + }, + "returns": [ + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/rearrange.json5 b/tests/rearrange.json5 new file mode 100644 index 00000000..2084a9ca --- /dev/null +++ b/tests/rearrange.json5 @@ -0,0 +1,66 @@ +{ + "tests": [ + { + "title": "Reverse a list", + "arguments": { + "data": [ + 5, + 4, + 3 + ], + "order": [ + 2, + 1, + 0 + ] + }, + "returns": [ + 3, + 4, + 5 + ] + }, + { + "title": "Remove two elements", + "arguments": { + "data": [ + 5, + 4, + 3, + 2 + ], + "order": [ + 1, + 3 + ] + }, + "returns": [ + 4, + 2 + ] + }, + { + "title": "Swap two elements", + "arguments": { + "data": [ + 5, + 4, + 3, + 2 + ], + "order": [ + 0, + 2, + 1, + 3 + ] + }, + "returns": [ + 5, + 3, + 4, + 2 + ] + } + ] +} \ No newline at end of file diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/reduce_dimension.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/reduce_spatial.json5 b/tests/reduce_spatial.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/reduce_spatial.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/rename_dimension.json5 b/tests/rename_dimension.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/rename_dimension.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 new file mode 100644 index 00000000..1999ce6f --- /dev/null +++ b/tests/rename_labels.json5 @@ -0,0 +1,24 @@ +{ + "tests": [ + { + "title": "Rename named labels", + "description": "Renaming the bands from `B1` to `red`, from `B2` to `green` and from `B3` to `blue`.", + "arguments": { + "data": { + "from_parameter": "data" + }, + "dimension": "bands", + "source": [ + "B1", + "B2", + "B3" + ], + "target": [ + "red", + "green", + "blue" + ] + } + } + ] +} \ No newline at end of file diff --git a/tests/resample_cube_spatial.json5 b/tests/resample_cube_spatial.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/resample_cube_spatial.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/resample_cube_temporal.json5 b/tests/resample_cube_temporal.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/resample_cube_temporal.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/resample_spatial.json5 b/tests/resample_spatial.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/resample_spatial.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/round.json5 b/tests/round.json5 new file mode 100644 index 00000000..f755a907 --- /dev/null +++ b/tests/round.json5 @@ -0,0 +1,57 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": 3.56, + "p": 1 + }, + "returns": 3.6 + }, + { + "arguments": { + "x": -0.4444444, + "p": 2 + }, + "returns": -0.44 + }, + { + "arguments": { + "x": -2.5 + }, + "returns": -2 + }, + { + "arguments": { + "x": -3.5 + }, + "returns": -4 + }, + { + "arguments": { + "x": 0.25, + "p": 1 + }, + "returns": 0.2 + }, + { + "arguments": { + "x": 0.35, + "p": 1 + }, + "returns": 0.4 + }, + { + "arguments": { + "x": 1234.5, + "p": -2 + }, + "returns": 1200 + } + ] +} \ No newline at end of file diff --git a/tests/sd.json5 b/tests/sd.json5 new file mode 100644 index 00000000..3f8cd496 --- /dev/null +++ b/tests/sd.json5 @@ -0,0 +1,34 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + -1, + 1, + 3, + null + ] + }, + "returns": 2 + }, + { + "arguments": { + "data": [ + -1, + 1, + 3, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/sgn.json5 b/tests/sgn.json5 new file mode 100644 index 00000000..cae51c4c --- /dev/null +++ b/tests/sgn.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "arguments": { + "x": -2 + }, + "returns": -1 + }, + { + "arguments": { + "x": 3.5 + }, + "returns": 1 + }, + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/sin.json5 b/tests/sin.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/sin.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/sinh.json5 b/tests/sinh.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/sinh.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/sort.json5 b/tests/sort.json5 new file mode 100644 index 00000000..aaec668f --- /dev/null +++ b/tests/sort.json5 @@ -0,0 +1,64 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 6, + -1, + 2, + null, + 7, + 4, + null, + 8, + 3, + 9, + 9 + ] + }, + "returns": [ + -1, + 2, + 3, + 4, + 6, + 7, + 8, + 9, + 9 + ] + }, + { + "arguments": { + "data": [ + 6, + -1, + 2, + null, + 7, + 4, + null, + 8, + 3, + 9, + 9 + ], + "asc": false, + "nodata": true + }, + "returns": [ + 9, + 9, + 8, + 7, + 6, + 4, + 3, + 2, + -1, + null, + null + ] + } + ] +} \ No newline at end of file diff --git a/tests/sqrt.json5 b/tests/sqrt.json5 new file mode 100644 index 00000000..0baf8236 --- /dev/null +++ b/tests/sqrt.json5 @@ -0,0 +1,28 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 1 + }, + { + "arguments": { + "x": 9 + }, + "returns": 3 + }, + { + "arguments": { + "x": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/subtract.json5 b/tests/subtract.json5 new file mode 100644 index 00000000..7a9f82d6 --- /dev/null +++ b/tests/subtract.json5 @@ -0,0 +1,25 @@ +{ + "tests": [ + { + "arguments": { + "x": 5, + "y": 2.5 + }, + "returns": 2.5 + }, + { + "arguments": { + "x": -2, + "y": 4 + }, + "returns": -6 + }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/sum.json5 b/tests/sum.json5 new file mode 100644 index 00000000..19ca3e7e --- /dev/null +++ b/tests/sum.json5 @@ -0,0 +1,56 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + 5, + 1 + ] + }, + "returns": 6 + }, + { + "arguments": { + "data": [ + -2, + 4, + 2.5 + ] + }, + "returns": 4.5 + }, + { + "arguments": { + "data": [ + 1, + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [ + 100 + ] + }, + "returns": 100 + }, + { + "arguments": { + "data": [ + null + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/tan.json5 b/tests/tan.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/tan.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/tanh.json5 b/tests/tanh.json5 new file mode 100644 index 00000000..4e1c0017 --- /dev/null +++ b/tests/tanh.json5 @@ -0,0 +1,10 @@ +{ + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + } + ] +} \ No newline at end of file diff --git a/tests/text_begins.json5 b/tests/text_begins.json5 new file mode 100644 index 00000000..5cfaef65 --- /dev/null +++ b/tests/text_begins.json5 @@ -0,0 +1,48 @@ +{ + "tests": [ + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "amet" + }, + "returns": false + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "Lorem" + }, + "returns": true + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "lorem" + }, + "returns": false + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "lorem", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "data": "Ä", + "pattern": "ä", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "data": null, + "pattern": "null" + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/text_concat.json5 b/tests/text_concat.json5 new file mode 100644 index 00000000..e20fffa1 --- /dev/null +++ b/tests/text_concat.json5 @@ -0,0 +1,61 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + "Hello", + "World" + ], + "separator": " " + }, + "returns": "Hello World" + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 0 + ] + }, + "returns": "1234567890" + }, + { + "arguments": { + "data": [ + null, + true, + false, + 1, + -1.5, + "ß" + ], + "separator": "\n" + }, + "returns": "null\ntrue\nfalse\n1\n-1.5\nß" + }, + { + "arguments": { + "data": [ + 2, + 0 + ], + "separator": 1 + }, + "returns": "210" + }, + { + "arguments": { + "data": [] + }, + "returns": "" + } + ] +} \ No newline at end of file diff --git a/tests/text_contains.json5 b/tests/text_contains.json5 new file mode 100644 index 00000000..8328cbe0 --- /dev/null +++ b/tests/text_contains.json5 @@ -0,0 +1,48 @@ +{ + "tests": [ + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "openEO" + }, + "returns": false + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "ipsum dolor" + }, + "returns": true + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "Ipsum Dolor" + }, + "returns": false + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "SIT", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "data": "ÄÖÜ", + "pattern": "ö", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "data": null, + "pattern": "null" + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/text_ends.json5 b/tests/text_ends.json5 new file mode 100644 index 00000000..67b24421 --- /dev/null +++ b/tests/text_ends.json5 @@ -0,0 +1,48 @@ +{ + "tests": [ + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "amet" + }, + "returns": true + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "AMET" + }, + "returns": false + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "Lorem" + }, + "returns": false + }, + { + "arguments": { + "data": "Lorem ipsum dolor sit amet", + "pattern": "AMET", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "data": "Ä", + "pattern": "ä", + "case_sensitive": false + }, + "returns": true + }, + { + "arguments": { + "data": null, + "pattern": "null" + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/trim_cube.json5 b/tests/trim_cube.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/trim_cube.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/unflatten_dimension.json5 b/tests/unflatten_dimension.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/unflatten_dimension.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/variance.json5 b/tests/variance.json5 new file mode 100644 index 00000000..1fa210e1 --- /dev/null +++ b/tests/variance.json5 @@ -0,0 +1,47 @@ +{ + "tests": [ + { + "arguments": { + "data": [ + -1, + 1, + 3 + ] + }, + "returns": 4 + }, + { + "arguments": { + "data": [ + 2, + 3, + 3, + null, + 4, + 4, + 5 + ] + }, + "returns": 1.1 + }, + { + "arguments": { + "data": [ + -1, + 1, + null, + 3 + ], + "ignore_nodata": false + }, + "returns": null + }, + { + "description": "The input array is empty: return `null`.", + "arguments": { + "data": [] + }, + "returns": null + } + ] +} \ No newline at end of file diff --git a/tests/vector_buffer.json5 b/tests/vector_buffer.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/vector_buffer.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/vector_reproject.json5 b/tests/vector_reproject.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/vector_reproject.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/vector_to_regular_points.json5 b/tests/vector_to_regular_points.json5 new file mode 100644 index 00000000..308e1aa1 --- /dev/null +++ b/tests/vector_to_regular_points.json5 @@ -0,0 +1,3 @@ +{ + "tests": [] +} \ No newline at end of file diff --git a/tests/xor.json5 b/tests/xor.json5 new file mode 100644 index 00000000..0cb12326 --- /dev/null +++ b/tests/xor.json5 @@ -0,0 +1,39 @@ +{ + "tests": [ + { + "arguments": { + "x": true, + "y": true + }, + "returns": false + }, + { + "arguments": { + "x": false, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": false + }, + "returns": true + }, + { + "arguments": { + "x": true, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": false, + "y": null + }, + "returns": null + } + ] +} \ No newline at end of file From 1beb1df80d7f286d0812bf5e81192089c14331fc Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 13 Oct 2023 14:13:26 +0200 Subject: [PATCH 05/39] Add tests and docs --- absolute.json | 12 -- tests/README.md | 241 +++++++++++++++++++++++++++++++-- tests/absolute.json5 | 32 ++++- tests/add.json5 | 84 ++++++++++++ tests/array_concat.json5 | 4 +- tests/array_modify.json5 | 12 +- tests/between.json5 | 2 +- tests/constant.json5 | 101 +++++++++++++- tests/date_shift.json5 | 8 +- tests/e.json5 | 8 +- tests/extrema.json5 | 2 +- tests/filter_labels.json5 | 2 +- tests/first.json5 | 2 +- tests/is_infinite.json5 | 111 ++++++++++++++- tests/is_nan.json5 | 68 +++++++++- tests/is_nodata.json5 | 12 +- tests/last.json5 | 2 +- tests/linear_scale_range.json5 | 2 +- tests/max.json5 | 2 +- tests/mean.json5 | 4 +- tests/median.json5 | 4 +- tests/nan.json5 | 7 +- tests/pi.json5 | 8 +- tests/rename_labels.json5 | 2 +- tests/sd.json5 | 2 +- tests/subtract.json5 | 84 ++++++++++++ tests/variance.json5 | 2 +- 27 files changed, 752 insertions(+), 68 deletions(-) diff --git a/absolute.json b/absolute.json index 3b83437a..ee8d6098 100644 --- a/absolute.json +++ b/absolute.json @@ -28,12 +28,6 @@ } }, "examples": [ - { - "arguments": { - "x": 0 - }, - "returns": 0 - }, { "arguments": { "x": 3.5 @@ -45,12 +39,6 @@ "x": -0.4 }, "returns": 0.4 - }, - { - "arguments": { - "x": -3.5 - }, - "returns": 3.5 } ], "links": [ diff --git a/tests/README.md b/tests/README.md index c124b15e..81dda3a0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,7 +1,148 @@ # Tests This folder contains test cases for the openEO processes. -To allow for more data types (e.g. infinity and nan for numbers), all the files are encoded in **JSON5**. + +## Supported processes + +- [x] absolute +- [x] add +- [ ] add_dimension +- [ ] aggregate_spatial +- [ ] aggregate_spatial_window +- [ ] aggregate_temporal +- [ ] aggregate_temporal_period +- [x] all +- [x] and +- [ ] anomaly +- [x] any +- [ ] apply +- [ ] apply_dimension +- [ ] apply_kernel +- [ ] apply_neighborhood +- [ ] apply_polygon +- [ ] arccos +- [ ] arcosh +- [ ] arcsin +- [ ] arctan +- [ ] arctan2 +- [ ] array_append +- [ ] array_apply +- [ ] array_concat +- [ ] array_contains +- [ ] array_create +- [ ] array_create_labeled +- [ ] array_element +- [ ] array_filter +- [ ] array_find +- [ ] array_find_label +- [ ] array_interpolate_linear +- [ ] array_labels +- [ ] array_modify +- [ ] arsinh +- [ ] artanh +- [ ] between +- [ ] ceil +- [ ] climatological_normal +- [ ] clip +- [x] constant +- [ ] cos +- [ ] cosh +- [ ] count +- [ ] create_data_cube +- [ ] cummax +- [ ] cummin +- [ ] cumproduct +- [ ] cumsum +- [ ] date_between +- [ ] date_difference +- [ ] date_shift +- [ ] dimension_labels +- [ ] divide +- [ ] drop_dimension +- [x] e +- [ ] eq +- [ ] exp +- [ ] extrema +- [ ] filter_bands +- [ ] filter_bbox +- [ ] filter_labels +- [ ] filter_spatial +- [ ] filter_temporal +- [ ] filter_vector +- [ ] first +- [ ] flatten_dimensions +- [ ] floor +- [ ] gt +- [ ] gte +- [ ] if +- [ ] int +- [ ] is_infinite +- [x] is_nan +- [ ] is_valid +- [ ] last +- [ ] linear_scale_range +- [ ] ln +- [ ] load_geojson +- [ ] load_stac +- [ ] load_uploaded_files +- [ ] load_url +- [ ] log +- [ ] lt +- [ ] lte +- [ ] mask +- [ ] mask_polygon +- [ ] max +- [ ] mean +- [ ] median +- [ ] merge_cubes +- [ ] min +- [ ] mod +- [ ] multiply +- [x] nan +- [ ] ndvi +- [ ] neq +- [ ] normalized_difference +- [x] not +- [x] or +- [ ] order +- [x] pi +- [ ] power +- [ ] product +- [ ] quantiles +- [ ] rearrange +- [ ] reduce_dimension +- [ ] reduce_spatial +- [ ] rename_dimension +- [ ] rename_labels +- [ ] resample_cube_spatial +- [ ] resample_cube_temporal +- [ ] resample_spatial +- [ ] round +- [ ] sd +- [ ] sgn +- [ ] sin +- [ ] sinh +- [ ] sort +- [ ] sqrt +- [x] subtract +- [ ] sum +- [ ] tan +- [ ] tanh +- [x] text_begins +- [x] text_concat +- [x] text_contains +- [x] text_ends +- [ ] trim_cube +- [ ] unflatten_dimension +- [ ] variance +- [ ] vector_buffer +- [ ] vector_reproject +- [ ] vector_to_regular_points +- [x] xor + +## Incomplete processes + +- [x] is_nodata - actual no-data values depends on context / metadata ## Missing processes @@ -9,17 +150,87 @@ The following processes have no test cases as the results heavily depend on the or need an external services to be available for testing (e.g. loading files from the user workspace or a UDF server). We don't expect that we can provide meaningful test cases for these processes. -- ard_normalized_radar_backscatter -- ard_surface_reflectance -- atmospheric_correction -- cloud_detection -- fit_curve -- inspect -- load_collection -- load_uploaded_files -- predict_curve -- run_udf -- run_udf_externally -- sar_backscatter -- save_result -- vector_to_random_points \ No newline at end of file +- [ ] ard_normalized_radar_backscatter +- [ ] ard_surface_reflectance +- [ ] atmospheric_correction +- [ ] cloud_detection +- [ ] fit_curve +- [ ] inspect +- [ ] load_collection +- [ ] load_uploaded_files +- [ ] predict_curve +- [ ] run_udf +- [ ] run_udf_externally +- [ ] sar_backscatter +- [ ] save_result +- [ ] vector_to_random_points + +## Assumptions + +The test cases assume a couple of things as they are an abstraction and not bound to specific implementations: +- The JSON Schema type `number` explicitly includes the values `+Infinity`, `-Infinity` and `NaN`. +- The input and output values for no-data values are `null`, so there's no mapping to e.g. `0` as no-data value. +- Input that is not valid according to the schemas, will be rejected upfront and will not be checked on. For example, the absolute process only tests against the data types `number` and `null`. There are no tests for a boolean or string input. +- Numerical data types such as uint8 don't matter, i.e. tests don't check for overflows etc. This suite can't provide such tests as the underlying data type is not known. + +## Test Files + +To allow for more data types (e.g. infinity and nan for numbers), all the files are encoded in **JSON5** instead of JSON. + +The test files have the following schema: + +```yaml +description: A document with test cases for a specific openEO process +type: object +required: + - tests +properties: + tests: + description: A list of test cases without a specific order + type: array + items: + description: A test case with a set of arguments and a specific return value or exception + type: object + required: + - arguments + properties: + arguments: + description: A key-value pair for an argument. Key = Parameter name, Value = Argument value + type: object + additionalProperties: + description: An argument, can be of any type + oneOf: + - required: + - returns + properties: + returns: + description: The return value, can be of any type + delta: + description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy. + type: number + - required: + - throws + properties: + throws: + oneOf: + - description: Specify an exception name from the process specification + type: string + minLength: 1 + - description: Use true if the type of exception is unknown + type: boolean + const: true +``` + +Arguments and return values can point to external files, e.g. +```json +{ + "$ref": "https://host.example/file.nc" +} +``` + +### Assets + +Additional assets will be provided for the test cases. + +- Raster data cubes will be provided as CoverageJSON. +- Multi-dimensional vector data cubes can't be provided right now, we use GeoJSON whenever possible. diff --git a/tests/absolute.json5 b/tests/absolute.json5 index e7f17c42..fbd1f53e 100644 --- a/tests/absolute.json5 +++ b/tests/absolute.json5 @@ -1,5 +1,29 @@ { "tests": [ + { + "arguments": { + "x": -Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null + }, { "arguments": { "x": 0 @@ -8,15 +32,15 @@ }, { "arguments": { - "x": 3.5 + "x": -1 }, - "returns": 3.5 + "returns": 1 }, { "arguments": { - "x": -0.4 + "x": 3.5 }, - "returns": 0.4 + "returns": 3.5 }, { "arguments": { diff --git a/tests/add.json5 b/tests/add.json5 index 1b0c998c..4ceab658 100644 --- a/tests/add.json5 +++ b/tests/add.json5 @@ -1,5 +1,68 @@ { "tests": [ + { + "arguments": { + "x": Infinity, + "y": -1 + }, + "returns": Infinity + }, + { + "arguments": { + "x": 1, + "y": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity, + "y": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": Infinity, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": -Infinity + }, + "returns": null + }, { "arguments": { "x": 5, @@ -14,12 +77,33 @@ }, "returns": -6 }, + { + "arguments": { + "x": 5.25, + "y": 0 + }, + "returns": 5.25 + }, + { + "arguments": { + "x": 250, + "y": 10 + }, + "returns": 260 + }, { "arguments": { "x": 1, "y": null }, "returns": null + }, + { + "arguments": { + "x": null, + "y": -1 + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 index af0c6263..11174ee0 100644 --- a/tests/array_concat.json5 +++ b/tests/array_concat.json5 @@ -1,7 +1,7 @@ { "tests": [ { - "description": "Concatenates two numerical arrays.", + // Concatenates two numerical arrays. "arguments": { "array1": [ 1.5, @@ -18,7 +18,7 @@ ] }, { - "description": "Concatenates two arrays containing different data type, may not always be supported.", + // Concatenates two arrays containing different data type, may not always be supported. "arguments": { "array1": [ "a", diff --git a/tests/array_modify.json5 b/tests/array_modify.json5 index c5686dcd..ec8f134c 100644 --- a/tests/array_modify.json5 +++ b/tests/array_modify.json5 @@ -1,7 +1,7 @@ { "tests": [ { - "description": "Replace a single value in the array.", + // Replace a single value in the array. "arguments": { "data": [ "a", @@ -21,7 +21,7 @@ ] }, { - "description": "Replace multiple values in the array.", + // Replace multiple values in the array. "arguments": { "data": [ "a", @@ -46,7 +46,7 @@ ] }, { - "description": "Insert a value to the array at a given position.", + // Insert a value to the array at a given position. "arguments": { "data": [ "a", @@ -64,7 +64,7 @@ ] }, { - "description": "Remove a single value from the array.", + // Remove a single value from the array. "arguments": { "data": [ "a", @@ -82,7 +82,7 @@ ] }, { - "description": "Remove multiple values from the array.", + // Remove multiple values from the array. "arguments": { "data": [ null, @@ -102,7 +102,7 @@ ] }, { - "description": "Remove multiple values from the end of the array and ignore that the given length is exceeding the size of the array.", + // Remove multiple values from the end of the array and ignore that the given length is exceeding the size of the array. "arguments": { "data": [ "a", diff --git a/tests/between.json5 b/tests/between.json5 index 1834bf2e..6aab5faf 100644 --- a/tests/between.json5 +++ b/tests/between.json5 @@ -26,7 +26,7 @@ "returns": false }, { - "description": "Swapped bounds (min is greater than max) MUST always return `false`.", + // Swapped bounds (min is greater than max) MUST always return `false` "arguments": { "x": 0.5, "min": 1, diff --git a/tests/constant.json5 b/tests/constant.json5 index 308e1aa1..664fd424 100644 --- a/tests/constant.json5 +++ b/tests/constant.json5 @@ -1,3 +1,102 @@ { - "tests": [] + "tests": [ + { + "arguments": { + "x": 0 + }, + "returns": 0 + }, + { + "arguments": { + "x": -260 + }, + "returns": -260 + }, + { + "arguments": { + "x": 66666 + }, + "returns": 66666 + }, + { + "arguments": { + "x": 0.123456789 + }, + "returns": 0.123456789 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": true + }, + "returns": true + }, + { + "arguments": { + "x": false + }, + "returns": false + }, + { + "arguments": { + "x": null + }, + "returns": null + }, + { + "arguments": { + "x": "test" + }, + "returns": "test" + }, + { + "arguments": { + "x": [] + }, + "returns": [] + }, + { + "arguments": { + "x": [1,2,3,-4] + }, + "returns": [1,2,3,-4] + }, + { + "arguments": { + "x": [0,NaN,null,false,""] + }, + "returns": [0,NaN,null,false,""] + }, + { + "arguments": { + "x": { + "a": "b", + "b": 123, + "c": [] + } + }, + "returns": { + "a": "b", + "b": 123, + "c": [] + } + } + ] } \ No newline at end of file diff --git a/tests/date_shift.json5 b/tests/date_shift.json5 index 1606cec3..4e792fba 100644 --- a/tests/date_shift.json5 +++ b/tests/date_shift.json5 @@ -17,7 +17,7 @@ "returns": "2021-03-24T00:00:00+02:00" }, { - "description": "Adding a year to February 29th in a leap year will result in February 28th in the next (non-leap) year.", + // Adding a year to February 29th in a leap year will result in February 28th in the next (non-leap) year. "arguments": { "date": "2020-02-29T17:22:45Z", "value": 1, @@ -26,7 +26,7 @@ "returns": "2021-02-28T17:22:45Z" }, { - "description": "Adding a month to January 31th will result in February 29th in leap years.", + // Adding a month to January 31th will result in February 29th in leap years. "arguments": { "date": "2020-01-31", "value": 1, @@ -35,7 +35,7 @@ "returns": "2020-02-29" }, { - "description": "The process skips over the leap second `2016-12-31T23:59:60Z`.", + // The process skips over the leap second `2016-12-31T23:59:60Z`. "arguments": { "date": "2016-12-31T23:59:59Z", "value": 1, @@ -44,7 +44,7 @@ "returns": "2017-01-01T00:00:00Z" }, { - "description": "Milliseconds can be added or subtracted. If not given, the default value is `0`.", + // Milliseconds can be added or subtracted. If not given, the default value is `0`. "arguments": { "date": "2018-12-31T17:22:45Z", "value": 1150, diff --git a/tests/e.json5 b/tests/e.json5 index 308e1aa1..2a02d4d8 100644 --- a/tests/e.json5 +++ b/tests/e.json5 @@ -1,3 +1,9 @@ { - "tests": [] + "tests": [ + { + "arguments": {}, + "returns": 2.718281828459, + "delta": 0.000000000001 + } + ] } \ No newline at end of file diff --git a/tests/extrema.json5 b/tests/extrema.json5 index 94fdce69..87f1bb62 100644 --- a/tests/extrema.json5 +++ b/tests/extrema.json5 @@ -45,7 +45,7 @@ ] }, { - "description": "The input array is empty: return two `null` values.", + // The input array is empty: return two `null` values. "arguments": { "data": [] }, diff --git a/tests/filter_labels.json5 b/tests/filter_labels.json5 index 849670cd..f0460bb1 100644 --- a/tests/filter_labels.json5 +++ b/tests/filter_labels.json5 @@ -1,7 +1,7 @@ { "tests": [ { - "description": "Filters the data cube to only contain data from platform Sentinel-2A. This example assumes that the data cube has a dimension `platform` so that computations can distinguish between Sentinel-2A and Sentinel-2B data.", + // Filters the data cube to only contain data from platform Sentinel-2A. This example assumes that the data cube has a dimension `platform` so that computations can distinguish between Sentinel-2A and Sentinel-2B data. "arguments": { "data": { "from_parameter": "sentinel2_data" diff --git a/tests/first.json5 b/tests/first.json5 index f2c3243a..ec0d70ad 100644 --- a/tests/first.json5 +++ b/tests/first.json5 @@ -33,7 +33,7 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, diff --git a/tests/is_infinite.json5 b/tests/is_infinite.json5 index 308e1aa1..2c6ac1cf 100644 --- a/tests/is_infinite.json5 +++ b/tests/is_infinite.json5 @@ -1,3 +1,112 @@ { - "tests": [] + "tests": [ + { + "arguments": { + "x": Infinity + }, + "returns": true + }, + { + "arguments": { + "x": -Infinity + }, + "returns": true + }, + { + "arguments": { + "x": 1 + }, + "returns": false + }, + { + "arguments": { + "x": -123456789.0 + }, + "returns": false + }, + { + "arguments": { + "x": NaN + }, + "returns": false + }, + { + "arguments": { + "x": true + }, + "returns": false + }, + { + "arguments": { + "x": false + }, + "returns": false + }, + { + "arguments": { + "x": [Infinity] + }, + "returns": false + }, + { + "arguments": { + "x": [] + }, + "returns": false + }, + { + "arguments": { + "x": {} + }, + "returns": false + }, + { + "arguments": { + "x": {"inf": Infinity} + }, + "returns": false + }, + { + "arguments": { + "x": "-infinity" + }, + "returns": false + }, + { + "arguments": { + "x": "-Infinity" + }, + "returns": false + }, + { + "arguments": { + "x": "-inf" + }, + "returns": false + }, + { + "arguments": { + "x": "infinity" + }, + "returns": false + }, + { + "arguments": { + "x": "Infinity" + }, + "returns": false + }, + { + "arguments": { + "x": "inf" + }, + "returns": false + }, + { + "arguments": { + "x": null + }, + "returns": false + } + ] } \ No newline at end of file diff --git a/tests/is_nan.json5 b/tests/is_nan.json5 index 7aa14245..a991a6d7 100644 --- a/tests/is_nan.json5 +++ b/tests/is_nan.json5 @@ -8,7 +8,73 @@ }, { "arguments": { - "x": "Test" + "x": -123456789.0 + }, + "returns": false + }, + { + "arguments": { + "x": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": -Infinity + }, + "returns": false + }, + { + "arguments": { + "x": NaN + }, + "returns": true + }, + { + "arguments": { + "x": true + }, + "returns": true + }, + { + "arguments": { + "x": false + }, + "returns": true + }, + { + "arguments": { + "x": [NaN] + }, + "returns": true + }, + { + "arguments": { + "x": [] + }, + "returns": true + }, + { + "arguments": { + "x": {} + }, + "returns": true + }, + { + "arguments": { + "x": {"nan": NaN} + }, + "returns": true + }, + { + "arguments": { + "x": "NaN" + }, + "returns": true + }, + { + "arguments": { + "x": "nan" }, "returns": true }, diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index d316a73a..dd81695c 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -1,22 +1,24 @@ { + // We can't check for other no-data values than `null` + // as it depends on the data cube / metadata / context, which can't influence "tests": [ { "arguments": { - "x": 1 + "x": null }, - "returns": false + "returns": true }, { "arguments": { - "x": "Test" + "x": 1 }, "returns": false }, { "arguments": { - "x": null + "x": "Test" }, - "returns": true + "returns": false }, { "arguments": { diff --git a/tests/last.json5 b/tests/last.json5 index 8da4ff66..795439d3 100644 --- a/tests/last.json5 +++ b/tests/last.json5 @@ -33,7 +33,7 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 index ed964c81..7e5d3a36 100644 --- a/tests/linear_scale_range.json5 +++ b/tests/linear_scale_range.json5 @@ -27,7 +27,7 @@ "returns": null }, { - "description": "Shows that the input data is clipped.", + // Shows that the input data is clipped. "arguments": { "x": 1.12, "inputMin": 0, diff --git a/tests/max.json5 b/tests/max.json5 index bef35016..1b8c6902 100644 --- a/tests/max.json5 +++ b/tests/max.json5 @@ -36,7 +36,7 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, diff --git a/tests/mean.json5 b/tests/mean.json5 index fc997cd6..5dece9dd 100644 --- a/tests/mean.json5 +++ b/tests/mean.json5 @@ -33,14 +33,14 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, "returns": null }, { - "description": "The input array has only `null` elements: return `null`.", + // The input array has only `null` elements: return `null`. "arguments": { "data": [ null, diff --git a/tests/median.json5 b/tests/median.json5 index ad549d23..949c3f3e 100644 --- a/tests/median.json5 +++ b/tests/median.json5 @@ -53,14 +53,14 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, "returns": null }, { - "description": "The input array has only `null` elements: return `null`.", + // The input array has only `null` elements: return `null`. "arguments": { "data": [ null, diff --git a/tests/nan.json5 b/tests/nan.json5 index 308e1aa1..6e0a71c4 100644 --- a/tests/nan.json5 +++ b/tests/nan.json5 @@ -1,3 +1,8 @@ { - "tests": [] + "tests": [ + { + "arguments": {}, + "returns": NaN + } + ] } \ No newline at end of file diff --git a/tests/pi.json5 b/tests/pi.json5 index 308e1aa1..19c411a7 100644 --- a/tests/pi.json5 +++ b/tests/pi.json5 @@ -1,3 +1,9 @@ { - "tests": [] + "tests": [ + { + "arguments": {}, + "returns": 3.14159265, + "delta": 0.00000001 + } + ] } \ No newline at end of file diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 index 1999ce6f..10e45a68 100644 --- a/tests/rename_labels.json5 +++ b/tests/rename_labels.json5 @@ -2,7 +2,7 @@ "tests": [ { "title": "Rename named labels", - "description": "Renaming the bands from `B1` to `red`, from `B2` to `green` and from `B3` to `blue`.", + // Renaming the bands from `B1` to `red`, from `B2` to `green` and from `B3` to `blue`. "arguments": { "data": { "from_parameter": "data" diff --git a/tests/sd.json5 b/tests/sd.json5 index 3f8cd496..1858b004 100644 --- a/tests/sd.json5 +++ b/tests/sd.json5 @@ -24,7 +24,7 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, diff --git a/tests/subtract.json5 b/tests/subtract.json5 index 7a9f82d6..e2c77377 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -1,5 +1,68 @@ { "tests": [ + { + "arguments": { + "x": Infinity, + "y": -1 + }, + "returns": Infinity + }, + { + "arguments": { + "x": 1, + "y": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity, + "y": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": Infinity, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": -Infinity + }, + "returns": null + }, { "arguments": { "x": 5, @@ -13,6 +76,20 @@ "y": 4 }, "returns": -6 + } + { + "arguments": { + "x": 5.25, + "y": 0 + }, + "returns": 5.25 + }, + { + "arguments": { + "x": -250, + "y": 10 + }, + "returns": -260 }, { "arguments": { @@ -20,6 +97,13 @@ "y": null }, "returns": null + }, + { + "arguments": { + "x": null, + "y": -1 + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/variance.json5 b/tests/variance.json5 index 1fa210e1..dc4bc830 100644 --- a/tests/variance.json5 +++ b/tests/variance.json5 @@ -37,7 +37,7 @@ "returns": null }, { - "description": "The input array is empty: return `null`.", + // The input array is empty: return `null`. "arguments": { "data": [] }, From 79462066b1f9edefea6661f8ce3272169947add8 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 24 Oct 2023 18:08:42 +0200 Subject: [PATCH 06/39] Add more tests --- tests/README.md | 99 +++++++++++++++------------- tests/absolute.json5 | 38 ++++++----- tests/add.json5 | 109 ++++++++++++++++++++++--------- tests/arccos.json5 | 60 +++++++++++++++++ tests/arcosh.json5 | 54 +++++++++++++++ tests/arcsin.json5 | 60 +++++++++++++++++ tests/arctan.json5 | 60 +++++++++++++++++ tests/arctan2.json5 | 135 +++++++++++++++++++++++++++++++++++++- tests/arsinh.json5 | 48 ++++++++++++++ tests/artanh.json5 | 60 +++++++++++++++++ tests/ceil.json5 | 48 ++++++++++++-- tests/clip.json5 | 124 ++++++++++++++++++++++++++++++++--- tests/cos.json5 | 42 ++++++++++++ tests/cosh.json5 | 48 ++++++++++++++ tests/divide.json5 | 82 +++++++++++++++++++++-- tests/e.json5 | 3 +- tests/exp.json5 | 46 ++++++++++++- tests/floor.json5 | 46 +++++++++++-- tests/int.json5 | 67 ++++++++++++++++++- tests/ln.json5 | 55 ++++++++++++++++ tests/log.json5 | 93 +++++++++++++++++++++++++- tests/mod.json5 | 126 ++++++++++++++++++++++++++++++++++- tests/multiply.json5 | 152 +++++++++++++++++++++++++++++++++++++++++-- tests/pi.json5 | 3 +- tests/round.json5 | 24 +++++++ tests/sgn.json5 | 20 +++++- tests/sin.json5 | 42 ++++++++++++ tests/sinh.json5 | 48 ++++++++++++++ tests/sqrt.json5 | 26 +++++++- tests/subtract.json5 | 90 ++++++++++++++++--------- tests/tan.json5 | 42 ++++++++++++ tests/tanh.json5 | 42 ++++++++++++ 32 files changed, 1823 insertions(+), 169 deletions(-) diff --git a/tests/README.md b/tests/README.md index 81dda3a0..2d18fddc 100644 --- a/tests/README.md +++ b/tests/README.md @@ -20,11 +20,11 @@ This folder contains test cases for the openEO processes. - [ ] apply_kernel - [ ] apply_neighborhood - [ ] apply_polygon -- [ ] arccos -- [ ] arcosh -- [ ] arcsin -- [ ] arctan -- [ ] arctan2 +- [x] arccos - +- [x] arcosh - +- [x] arcsin - +- [x] arctan +- [x] arctan2 - [ ] array_append - [ ] array_apply - [ ] array_concat @@ -38,15 +38,15 @@ This folder contains test cases for the openEO processes. - [ ] array_interpolate_linear - [ ] array_labels - [ ] array_modify -- [ ] arsinh -- [ ] artanh +- [x] arsinh +- [x] artanh - - [ ] between -- [ ] ceil +- [x] ceil - [ ] climatological_normal -- [ ] clip +- [x] clip - missing: - [x] constant -- [ ] cos -- [ ] cosh +- [x] cos - +- [x] cosh - - [ ] count - [ ] create_data_cube - [ ] cummax @@ -57,11 +57,11 @@ This folder contains test cases for the openEO processes. - [ ] date_difference - [ ] date_shift - [ ] dimension_labels -- [ ] divide +- [x] divide - - [ ] drop_dimension - [x] e - [ ] eq -- [ ] exp +- [x] exp - [ ] extrema - [ ] filter_bands - [ ] filter_bbox @@ -71,22 +71,22 @@ This folder contains test cases for the openEO processes. - [ ] filter_vector - [ ] first - [ ] flatten_dimensions -- [ ] floor +- [x] floor - [ ] gt - [ ] gte - [ ] if -- [ ] int +- [x] int - [ ] is_infinite - [x] is_nan - [ ] is_valid - [ ] last - [ ] linear_scale_range -- [ ] ln +- [x] ln - - [ ] load_geojson - [ ] load_stac - [ ] load_uploaded_files - [ ] load_url -- [ ] log +- [x] log - - [ ] lt - [ ] lte - [ ] mask @@ -96,7 +96,7 @@ This folder contains test cases for the openEO processes. - [ ] median - [ ] merge_cubes - [ ] min -- [ ] mod +- [x] mod - - [ ] multiply - [x] nan - [ ] ndvi @@ -117,17 +117,17 @@ This folder contains test cases for the openEO processes. - [ ] resample_cube_spatial - [ ] resample_cube_temporal - [ ] resample_spatial -- [ ] round +- [x] round - [ ] sd -- [ ] sgn -- [ ] sin -- [ ] sinh +- [x] sgn +- [x] sin - +- [x] sinh - [ ] sort -- [ ] sqrt +- [x] sqrt - missing: - [x] subtract - [ ] sum -- [ ] tan -- [ ] tanh +- [x] tan - +- [x] tanh - - [x] text_begins - [x] text_concat - [x] text_contains @@ -172,6 +172,7 @@ The test cases assume a couple of things as they are an abstraction and not boun - The input and output values for no-data values are `null`, so there's no mapping to e.g. `0` as no-data value. - Input that is not valid according to the schemas, will be rejected upfront and will not be checked on. For example, the absolute process only tests against the data types `number` and `null`. There are no tests for a boolean or string input. - Numerical data types such as uint8 don't matter, i.e. tests don't check for overflows etc. This suite can't provide such tests as the underlying data type is not known. +- If not otherwise specified for numbers, a precision of 10 decimals is checked so return values should have at least 11 decimals. ## Test Files @@ -189,36 +190,42 @@ properties: description: A list of test cases without a specific order type: array items: - description: A test case with a set of arguments and a specific return value or exception + description: |- + A test case with a set of arguments and a specific return value or exception + + If both `returns` and `throws` are provided, it means that either of it should be true. + So either the process retuens as specified or throws the specified error. type: object required: - arguments + oneOf: + - required: + - returns + - required: + - throws properties: arguments: description: A key-value pair for an argument. Key = Parameter name, Value = Argument value type: object additionalProperties: description: An argument, can be of any type - oneOf: - - required: - - returns - properties: - returns: - description: The return value, can be of any type - delta: - description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy. - type: number - - required: - - throws - properties: - throws: - oneOf: - - description: Specify an exception name from the process specification - type: string - minLength: 1 - - description: Use true if the type of exception is unknown - type: boolean - const: true + optional: + description: Marks optional test so a failure produces only a warning. + type: boolean + default: false + returns: + description: The return value, can be of any type + delta: + description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy. + type: number + throws: + oneOf: + - description: Specify an exception name from the process specification + type: string + minLength: 1 + - description: Use true if the type of exception is unknown + type: boolean + const: true ``` Arguments and return values can point to external files, e.g. diff --git a/tests/absolute.json5 b/tests/absolute.json5 index fbd1f53e..e905c586 100644 --- a/tests/absolute.json5 +++ b/tests/absolute.json5 @@ -2,51 +2,57 @@ "tests": [ { "arguments": { - "x": -Infinity + "x": 0 }, - "returns": Infinity + "returns": 0 }, { "arguments": { - "x": Infinity + "x": 1 }, - "returns": Infinity + "returns": 1 }, { "arguments": { - "x": NaN + "x": -1 }, - "returns": NaN + "returns": 1 }, { "arguments": { - "x": null + "x": 2.5 }, - "returns": null + "returns": 2.5 }, { "arguments": { - "x": 0 + "x": -2.5 }, - "returns": 0 + "returns": 2.5 }, { "arguments": { - "x": -1 + "x": NaN }, - "returns": 1 + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity }, { "arguments": { - "x": 3.5 + "x": -Infinity }, - "returns": 3.5 + "returns": Infinity }, { "arguments": { - "x": -3.5 + "x": null }, - "returns": 3.5 + "returns": null } ] } \ No newline at end of file diff --git a/tests/add.json5 b/tests/add.json5 index 4ceab658..f1661d6b 100644 --- a/tests/add.json5 +++ b/tests/add.json5 @@ -2,38 +2,66 @@ "tests": [ { "arguments": { - "x": Infinity, - "y": -1 + "x": 0, + "y": 0 }, - "returns": Infinity + "returns": 0 }, { "arguments": { "x": 1, - "y": -Infinity + "y": 2 }, - "returns": -Infinity + "returns": 3 }, { "arguments": { - "x": Infinity, - "y": -Infinity + "x": -1, + "y": 2 + }, + "returns": 1 + }, + { + "arguments": { + "x": 2.5, + "y": 3.5 + }, + "returns": 6 + }, + { + "arguments": { + "x": -2.5, + "y": 3.5 + }, + "returns": 1 + }, + { + "arguments": { + "x": 250, + "y": 10 + }, + "returns": 260 + }, + { + "arguments": { + "x": NaN, + "y": 1 }, "returns": NaN }, { "arguments": { - "x": -Infinity, - "y": -Infinity + "x": 1, + "y": NaN }, - "returns": -Infinity + "returns": NaN }, { "arguments": { - "x": Infinity, - "y": Infinity + "x": NaN, + "y": NaN }, - "returns": Infinity + "returns": NaN }, { "arguments": { @@ -49,47 +77,68 @@ }, "returns": NaN }, + { + "arguments": { + "x": -1, + "y": Infinity + }, + "returns": Infinity + }, { "arguments": { "x": Infinity, - "y": null + "y": 1 }, - "returns": null + "returns": Infinity }, { "arguments": { - "x": null, + "x": Infinity, + "y": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity, + "y": 1 + }, + "returns": -Infinity + }, + { + "arguments": { + "x": 1, "y": -Infinity }, - "returns": null + "returns": -Infinity }, { "arguments": { - "x": 5, - "y": 2.5 + "x": -Infinity, + "y": -Infinity }, - "returns": 7.5 + "returns": -Infinity }, { "arguments": { - "x": -2, - "y": -4 + "x": -Infinity, + "y": null }, - "returns": -6 + "returns": null }, { "arguments": { - "x": 5.25, - "y": 0 + "x": null, + "y": Infinity }, - "returns": 5.25 + "returns": null }, { "arguments": { - "x": 250, - "y": 10 + "x": null, + "y": 1 }, - "returns": 260 + "returns": null }, { "arguments": { @@ -101,7 +150,7 @@ { "arguments": { "x": null, - "y": -1 + "y": null }, "returns": null } diff --git a/tests/arccos.json5 b/tests/arccos.json5 index beee54a9..fe600c38 100644 --- a/tests/arccos.json5 +++ b/tests/arccos.json5 @@ -5,6 +5,66 @@ "x": 1 }, "returns": 0 + }, + { + "arguments": { + "x": 0 + }, + "returns": 1.57079632679 + }, + { + "arguments": { + "x": -1 + }, + "returns": 3.14159265359 + }, + { + "arguments": { + "x": 0.5 + }, + "returns": 1.0471975512 + }, + { + "arguments": { + "x": -0.5 + }, + "returns": 2.09439510239 + }, + { + "arguments": { + "x": 2 + }, + "returns": NaN + }, + { + "arguments": { + "x": -2 + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/arcosh.json5 b/tests/arcosh.json5 index beee54a9..b36472be 100644 --- a/tests/arcosh.json5 +++ b/tests/arcosh.json5 @@ -5,6 +5,60 @@ "x": 1 }, "returns": 0 + }, + { + "arguments": { + "x": 2 + }, + "returns": 1.31695789692 + }, + { + "arguments": { + "x": 10 + }, + "returns": 2.99322284613 + }, + { + "arguments": { + "x": 0.5 + }, + "returns": 0.96242365012 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -1 + }, + "returns": NaN + }, + { + "arguments": { + "x": -0.5 + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/arcsin.json5 b/tests/arcsin.json5 index 4e1c0017..ddcde9df 100644 --- a/tests/arcsin.json5 +++ b/tests/arcsin.json5 @@ -5,6 +5,66 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 1.57079632679 + }, + { + "arguments": { + "x": -1 + }, + "returns": -1.57079632679 + }, + { + "arguments": { + "x": 0.5 + }, + "returns": 0.52359877559 + }, + { + "arguments": { + "x": -0.5 + }, + "returns": -0.52359877559 + }, + { + "arguments": { + "x": 2 + }, + "returns": NaN + }, + { + "arguments": { + "x": -2 + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/arctan.json5 b/tests/arctan.json5 index 4e1c0017..bee4f575 100644 --- a/tests/arctan.json5 +++ b/tests/arctan.json5 @@ -5,6 +5,66 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 0.7853981634 + }, + { + "arguments": { + "x": -1 + }, + "returns": -0.7853981634 + }, + { + "arguments": { + "x": 0.5 + }, + "returns": 0.463647609 + }, + { + "arguments": { + "x": -0.5 + }, + "returns": -0.463647609 + }, + { + "arguments": { + "x": 2 + }, + "returns": 1.1071487178 + }, + { + "arguments": { + "x": -2 + }, + "returns": -1.1071487178 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": 1.57079632679 + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -1.57079632679 + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/arctan2.json5 b/tests/arctan2.json5 index 2c885ef2..ffd00c72 100644 --- a/tests/arctan2.json5 +++ b/tests/arctan2.json5 @@ -7,10 +7,143 @@ }, "returns": 0 }, + { + "arguments": { + "y": 1, + "x": 1 + }, + "returns": 0.7853981634 + }, + { + "arguments": { + "y": 1, + "x": -1 + }, + "returns": 2.3561944902 + }, + { + "arguments": { + "y": -1, + "x": 1 + }, + "returns": -0.7853981634 + }, + { + "arguments": { + "y": -1, + "x": -1 + }, + "returns": -2.3561944902 + }, + { + "arguments": { + "y": 0, + "x": 1 + }, + "returns": 0 + }, + { + "arguments": { + "y": 0, + "x": -1 + }, + "returns": 3.1415926536 + }, + { + "arguments": { + "y": 1, + "x": 0 + }, + "returns": 1.5707963268 + }, + { + "arguments": { + "y": -1, + "x": 0 + }, + "returns": -1.5707963268 + }, + { + "arguments": { + "y": NaN, + "x": 1 + }, + "returns": NaN + }, + { + "arguments": { + "y": 1, + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "y": NaN, + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "y": Infinity, + "x": 1 + }, + "returns": 1.5707963268 + }, + { + "arguments": { + "y": 1, + "x": Infinity + }, + "returns": 0 + }, + { + "arguments": { + "y": Infinity, + "x": Infinity + }, + "returns": 0.7853981634 + }, + { + "arguments": { + "y": -Infinity, + "x": 1 + }, + "returns": -1.5707963268 + }, + { + "arguments": { + "y": 1, + "x": -Infinity + }, + "returns": 3.1415926536 + }, + { + "arguments": { + "y": -Infinity, + "x": -Infinity + }, + "returns": -2.3561944902 + }, + { + "arguments": { + "y": null, + "x": 1 + }, + "returns": null + }, + { + "arguments": { + "y": 1, + "x": null + }, + "returns": null + }, { "arguments": { "y": null, - "x": 1.5 + "x": null }, "returns": null } diff --git a/tests/arsinh.json5 b/tests/arsinh.json5 index 4e1c0017..50243508 100644 --- a/tests/arsinh.json5 +++ b/tests/arsinh.json5 @@ -5,6 +5,54 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 0.88137358702 + }, + { + "arguments": { + "x": -1 + }, + "returns": -0.88137358702 + }, + { + "arguments": { + "x": 2 + }, + "returns": 1.44363547518 + }, + { + "arguments": { + "x": -2 + }, + "returns": -1.44363547518 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/artanh.json5 b/tests/artanh.json5 index 4e1c0017..cebf4a2a 100644 --- a/tests/artanh.json5 +++ b/tests/artanh.json5 @@ -5,6 +5,66 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 0.5 + }, + "returns": 0.54930614433 + }, + { + "arguments": { + "x": -0.5 + }, + "returns": -0.54930614433 + }, + { + "arguments": { + "x": 1 + }, + "returns": Infinity + }, + { + "arguments": { + "x": -1 + }, + "returns": -Infinity + }, + { + "arguments": { + "x": 2 + }, + "returns": NaN + }, + { + "arguments": { + "x": -2 + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/ceil.json5 b/tests/ceil.json5 index 582819cd..19b4a5e7 100644 --- a/tests/ceil.json5 +++ b/tests/ceil.json5 @@ -8,21 +8,57 @@ }, { "arguments": { - "x": 3.5 + "x": 1 }, - "returns": 4 + "returns": 1 }, { "arguments": { - "x": -0.4 + "x": -1 }, - "returns": 0 + "returns": -1 + }, + { + "arguments": { + "x": 1.5 + }, + "returns": 2 + }, + { + "arguments": { + "x": -1.5 + }, + "returns": -1 + }, + { + "arguments": { + "x": -999.99999999999 + }, + "returns": -999 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN }, { "arguments": { - "x": -3.5 + "x": null }, - "returns": -3 + "returns": null } ] } \ No newline at end of file diff --git a/tests/clip.json5 b/tests/clip.json5 index 422f2596..29c19688 100644 --- a/tests/clip.json5 +++ b/tests/clip.json5 @@ -2,32 +2,136 @@ "tests": [ { "arguments": { - "x": -5, - "min": -1, - "max": 1 + "x": 0, + "min": -10, + "max": 10 + }, + "returns": 0 + }, + { + "arguments": { + "x": 1, + "min": -10, + "max": 10 + }, + "returns": 1 + }, + { + "arguments": { + "x": -1, + "min": -10, + "max": 10 }, "returns": -1 }, { "arguments": { - "x": 10.001, - "min": 1, + "x": 20, + "min": -10, "max": 10 }, "returns": 10 }, { "arguments": { - "x": 0.000001, - "min": 0, - "max": 0.02 + "x": -20, + "min": -10, + "max": 10 + }, + "returns": -10 + }, + { + "arguments": { + "x": 1.5, + "min": 1, + "max": 2 + }, + "returns": 1.5 + }, + { + "arguments": { + "x": -2.5, + "min": 1, + "max": 2 + }, + "returns": 1 + }, + { + "arguments": { + "x": -1.5, + "min": -2, + "max": -1 + }, + "returns": -1.5 + }, + { + "arguments": { + "x": -0.5, + "min": -2, + "max": -1 + }, + "returns": -1 + }, + { + "arguments": { + "x": Infinity, + "min": -1, + "max": 1 + }, + "returns": 1 + }, + { + "arguments": { + "x": -Infinity, + "min": -1, + "max": 1 }, - "returns": 0.000001 + "returns": -1 + }, + { + "arguments": { + "x": -2, + "min": -1, + "max": Infinity + }, + "returns": -2 + }, + { + "arguments": { + "x": 2, + "min": -Infinity, + "max": 1 + }, + "returns": 2 + }, + { + "arguments": { + "x": 2, + "min": NaN, + "max": 1 + }, + "returns": NaN + }, + { + "arguments": { + "x": 2, + "min": -1, + "max": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "min": -1, + "max": 1 + }, + "returns": NaN }, { "arguments": { "x": null, - "min": 0, + "min": -1, "max": 1 }, "returns": null diff --git a/tests/cos.json5 b/tests/cos.json5 index aeeca727..4b9f3b0b 100644 --- a/tests/cos.json5 +++ b/tests/cos.json5 @@ -5,6 +5,48 @@ "x": 0 }, "returns": 1 + }, + { + "arguments": { + "x": 1 + }, + "returns": 0.54030230586 + }, + { + "arguments": { + "x": 10 + }, + "returns": -0.83907152908 + }, + { + "arguments": { + "x": -1 + }, + "returns": 0.54030230586 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/cosh.json5 b/tests/cosh.json5 index aeeca727..d79b0170 100644 --- a/tests/cosh.json5 +++ b/tests/cosh.json5 @@ -5,6 +5,54 @@ "x": 0 }, "returns": 1 + }, + { + "arguments": { + "x": 1 + }, + "returns": 1.54308063482 + }, + { + "arguments": { + "x": -1 + }, + "returns": 1.54308063482 + }, + { + "arguments": { + "x": 2 + }, + "returns": 3.76219569108 + }, + { + "arguments": { + "x": -2 + }, + "returns": 3.76219569108 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/divide.json5 b/tests/divide.json5 index 571a4891..8f0f3f27 100644 --- a/tests/divide.json5 +++ b/tests/divide.json5 @@ -2,22 +2,94 @@ "tests": [ { "arguments": { - "x": 5, - "y": 2.5 + "x": 0, + "y": 1 + }, + "returns": 0 + }, + { + "arguments": { + "x": 1, + "y": 1 + }, + "returns": 1 + }, + { + "arguments": { + "x": -1, + "y": 1 + }, + "returns": -1 + }, + { + "arguments": { + "x": 2, + "y": 1 }, "returns": 2 }, { "arguments": { "x": -2, - "y": 4 + "y": 1 }, - "returns": -0.5 + "returns": -2 }, { "arguments": { "x": 1, - "y": null + "y": 0 + }, + "returns": Infinity, + "throws": "DivisionByZero" + }, + { + "arguments": { + "x": -1, + "y": 0 + }, + "returns": -Infinity, + "throws": "DivisionByZero" + }, + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": 1 + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity, + "y": 1 + }, + "returns": -Infinity + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": 1 + }, + "returns": NaN + }, + { + "arguments": { + "x": null, + "y": 1 }, "returns": null } diff --git a/tests/e.json5 b/tests/e.json5 index 2a02d4d8..d4a0420a 100644 --- a/tests/e.json5 +++ b/tests/e.json5 @@ -2,8 +2,7 @@ "tests": [ { "arguments": {}, - "returns": 2.718281828459, - "delta": 0.000000000001 + "returns": 2.718281828459 } ] } \ No newline at end of file diff --git a/tests/exp.json5 b/tests/exp.json5 index 14da6e26..a514429f 100644 --- a/tests/exp.json5 +++ b/tests/exp.json5 @@ -2,13 +2,55 @@ "tests": [ { "arguments": { - "p": 0 + "x": 0 }, "returns": 1 }, { "arguments": { - "p": null + "x": 1 + }, + "returns": 2.71828182846 + }, + { + "arguments": { + "x": -1 + }, + "returns": 0.36787944117 + }, + { + "arguments": { + "x": 2 + }, + "returns": 7.38905609893 + }, + { + "arguments": { + "x": -2 + }, + "returns": 0.13533528324 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": 0 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null }, "returns": null } diff --git a/tests/floor.json5 b/tests/floor.json5 index d7d4c059..d5e39540 100644 --- a/tests/floor.json5 +++ b/tests/floor.json5 @@ -8,21 +8,57 @@ }, { "arguments": { - "x": 3.5 + "x": 1 }, - "returns": 3 + "returns": 1 }, { "arguments": { - "x": -0.4 + "x": -1 }, "returns": -1 }, { "arguments": { - "x": -3.5 + "x": 1.5 }, - "returns": -4 + "returns": 1 + }, + { + "arguments": { + "x": -1.5 + }, + "returns": -2 + }, + { + "arguments": { + "x": 999.99999999999 + }, + "returns": 999 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/int.json5 b/tests/int.json5 index 886dd8b1..b53d6ff4 100644 --- a/tests/int.json5 +++ b/tests/int.json5 @@ -6,12 +6,30 @@ }, "returns": 0 }, + { + "arguments": { + "x": 1 + }, + "returns": 1 + }, + { + "arguments": { + "x": -1 + }, + "returns": -1 + }, { "arguments": { "x": 3.5 }, "returns": 3 }, + { + "arguments": { + "x": -3.5 + }, + "returns": -3 + }, { "arguments": { "x": -0.4 @@ -20,9 +38,54 @@ }, { "arguments": { - "x": -3.5 + "x": 0.1234567890 }, - "returns": -3 + "returns": 0 + }, + { + // Supports more than byte-sized unsigned integers + "arguments": { + "x": 256 + }, + "returns": 256 + }, + { + // Supports more than 2 byte-sized unsigned integers + "arguments": { + "x": 65536 + }, + "returns": 65536 + }, + { + // Supports more than 4 byte-sized unsigned integers + "arguments": { + "x": 4294967296 + }, + "returns": 4294967296 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": NaN + }, + "returns": null + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/ln.json5 b/tests/ln.json5 index beee54a9..d57888ee 100644 --- a/tests/ln.json5 +++ b/tests/ln.json5 @@ -5,6 +5,61 @@ "x": 1 }, "returns": 0 + }, + { + "arguments": { + "x": 2.71828182846 + }, + "returns": 1 + }, + { + "arguments": { + "x": 10 + }, + "returns": 2.30258509301 + }, + { + "arguments": { + "x": 0.5 + }, + "returns": -0.69314718056 + }, + { + "arguments": { + "x": 0 + }, + "returns": -Infinity, + "throws": true + }, + { + "arguments": { + "x": -1 + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/log.json5 b/tests/log.json5 index dce412d8..505b4b45 100644 --- a/tests/log.json5 +++ b/tests/log.json5 @@ -1,5 +1,41 @@ { "tests": [ + { + "arguments": { + "x": -1, + "base": 10 + }, + "returns": NaN + }, + { + "arguments": { + "x": 0, + "base": 10 + }, + "returns": -Infinity, + "throws": true + }, + { + "arguments": { + "x": 0.5, + "base": 10 + }, + "returns": -0.69314718056 + }, + { + "arguments": { + "x": 1, + "base": 10 + }, + "returns": 0 + }, + { + "arguments": { + "x": 2.71828182846, + "base": 10 + }, + "returns": 0.99999999999 + }, { "arguments": { "x": 10, @@ -7,6 +43,27 @@ }, "returns": 1 }, + { + "arguments": { + "x": 100, + "base": 10 + }, + "returns": 2 + }, + { + "arguments": { + "x": 1000, + "base": 10 + }, + "returns": 3 + }, + { + "arguments": { + "x": 12345678990, + "base": 10 + }, + "returns": 10.09151498033 + }, { "arguments": { "x": 2, @@ -27,6 +84,40 @@ "base": 16 }, "returns": 0 + }, + { + "arguments": { + "x": 16, + "base": 16 + }, + "returns": 1 + }, + { + "arguments": { + "x": Infinity, + "base": 10 + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity, + "base": 10 + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "base": 10 + }, + "returns": NaN + }, + { + "arguments": { + "x": null, + "base": 10 + }, + "returns": null } - ] } \ No newline at end of file diff --git a/tests/mod.json5 b/tests/mod.json5 index d969df41..234f390b 100644 --- a/tests/mod.json5 +++ b/tests/mod.json5 @@ -1,5 +1,19 @@ { "tests": [ + { + "arguments": { + "x": 0, + "y": 1 + }, + "returns": 0 + }, + { + "arguments": { + "x": 1, + "y": 1 + }, + "returns": 0 + }, { "arguments": { "x": 27, @@ -30,7 +44,94 @@ }, { "arguments": { - "x": 27, + "x": 2, + "y": 0 + }, + "returns": Infinity, + "throws": "DivisionByZero" + }, + { + "arguments": { + "x": -2, + "y": 0 + }, + "returns": -Infinity, + "throws": "DivisionByZero" + }, + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": NaN, + "throws": "DivisionByZero" + }, + { + "arguments": { + "x": NaN, + "y": 2 + }, + "returns": NaN + }, + { + "arguments": { + "x": 2, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": 2 + }, + "returns": NaN + }, + { + "arguments": { + "x": 2, + "y": Infinity + }, + "returns": 2 + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity, + "y": 2 + }, + "returns": NaN + }, + { + "arguments": { + "x": 2, + "y": -Infinity + }, + "returns": -2 + }, + { + "arguments": { + "x": -Infinity, + "y": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity, "y": null }, "returns": null @@ -38,7 +139,28 @@ { "arguments": { "x": null, - "y": 5 + "y": Infinity + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": 2 + }, + "returns": null + }, + { + "arguments": { + "x": 2, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": null }, "returns": null } diff --git a/tests/multiply.json5 b/tests/multiply.json5 index c208c85b..840fd2ab 100644 --- a/tests/multiply.json5 +++ b/tests/multiply.json5 @@ -2,21 +2,161 @@ "tests": [ { "arguments": { - "x": 5, - "y": 2.5 + "x": 0, + "y": 0 }, - "returns": 12.5 + "returns": 0 }, { "arguments": { - "x": -2, - "y": -4 + "x": 100, + "y": 0 }, - "returns": 8 + "returns": 0 }, { "arguments": { "x": 1, + "y": 2 + }, + "returns": 2 + }, + { + "arguments": { + "x": -1, + "y": 2 + }, + "returns": -2 + }, + { + "arguments": { + "x": 2.5, + "y": 3.5 + }, + "returns": 8.75 + }, + { + "arguments": { + "x": -2.5, + "y": 3.5 + }, + "returns": -8.75 + }, + { + "arguments": { + "x": -250, + "y": -10 + }, + "returns": -2500 + }, + { + "arguments": { + "x": NaN, + "y": 1 + }, + "returns": NaN + }, + { + "arguments": { + "x": 1, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -1, + "y": Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": Infinity, + "y": 1 + }, + "returns": Infinity + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity, + "y": 1 + }, + "returns": -Infinity + }, + { + "arguments": { + "x": 1, + "y": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": -Infinity, + "y": -Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": Infinity + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": 1 + }, + "returns": null + }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, "y": null }, "returns": null diff --git a/tests/pi.json5 b/tests/pi.json5 index 19c411a7..40a6eb8a 100644 --- a/tests/pi.json5 +++ b/tests/pi.json5 @@ -2,8 +2,7 @@ "tests": [ { "arguments": {}, - "returns": 3.14159265, - "delta": 0.00000001 + "returns": 3.14159265359 } ] } \ No newline at end of file diff --git a/tests/round.json5 b/tests/round.json5 index f755a907..7d82f877 100644 --- a/tests/round.json5 +++ b/tests/round.json5 @@ -52,6 +52,30 @@ "p": -2 }, "returns": 1200 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -Infinity + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/sgn.json5 b/tests/sgn.json5 index cae51c4c..82a6550e 100644 --- a/tests/sgn.json5 +++ b/tests/sgn.json5 @@ -23,6 +23,24 @@ "x": null }, "returns": null - } + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": 1 + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -1 + }, ] } \ No newline at end of file diff --git a/tests/sin.json5 b/tests/sin.json5 index 4e1c0017..f716d168 100644 --- a/tests/sin.json5 +++ b/tests/sin.json5 @@ -5,6 +5,48 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 0.8414709848 + }, + { + "arguments": { + "x": 10 + }, + "returns": -0.54402111089 + }, + { + "arguments": { + "x": -1 + }, + "returns": -0.8414709848 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/sinh.json5 b/tests/sinh.json5 index 4e1c0017..770ea313 100644 --- a/tests/sinh.json5 +++ b/tests/sinh.json5 @@ -5,6 +5,54 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 1.17520119364 + }, + { + "arguments": { + "x": -1 + }, + "returns": -1.17520119364 + }, + { + "arguments": { + "x": 2 + }, + "returns": 3.62686040785 + }, + { + "arguments": { + "x": -2 + }, + "returns": -3.62686040785 + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/sqrt.json5 b/tests/sqrt.json5 index 0baf8236..598d681c 100644 --- a/tests/sqrt.json5 +++ b/tests/sqrt.json5 @@ -18,11 +18,35 @@ }, "returns": 3 }, + { + "arguments": { + "x": -1 + }, + "returns": NaN + }, { "arguments": { "x": null }, "returns": null - } + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, ] } \ No newline at end of file diff --git a/tests/subtract.json5 b/tests/subtract.json5 index e2c77377..b5c10b33 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -2,38 +2,59 @@ "tests": [ { "arguments": { - "x": Infinity, - "y": -1 + "x": 0, + "y": 0 }, - "returns": Infinity + "returns": 0 }, { "arguments": { - "x": 1, - "y": -Infinity + "x": 5, + "y": 2.5 }, - "returns": -Infinity + "returns": 2.5 }, { "arguments": { - "x": Infinity, - "y": -Infinity + "x": -2, + "y": 4 }, - "returns": Infinity + "returns": -6 + } + { + "arguments": { + "x": 5.25, + "y": 0 + }, + "returns": 5.25 }, { "arguments": { - "x": -Infinity, - "y": -Infinity + "x": -250, + "y": 10 + }, + "returns": -260 + }, + { + "arguments": { + "x": NaN, + "y": 1 }, "returns": NaN }, { "arguments": { - "x": Infinity, - "y": Infinity + "x": 1, + "y": NaN }, - "returns": Infinity + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": NaN }, { "arguments": { @@ -52,44 +73,51 @@ { "arguments": { "x": Infinity, - "y": null + "y": -1 }, - "returns": null + "returns": Infinity }, { "arguments": { - "x": null, + "x": 1, "y": -Infinity }, - "returns": null + "returns": -Infinity }, { "arguments": { - "x": 5, - "y": 2.5 + "x": Infinity, + "y": -Infinity }, - "returns": 2.5 + "returns": Infinity }, { "arguments": { - "x": -2, - "y": 4 + "x": -Infinity, + "y": -Infinity }, - "returns": -6 - } + "returns": NaN + }, { "arguments": { - "x": 5.25, - "y": 0 + "x": Infinity, + "y": Infinity }, - "returns": 5.25 + "returns": Infinity }, { "arguments": { - "x": -250, - "y": 10 + "x": Infinity, + "y": null }, - "returns": -260 + "returns": null + }, + { + "arguments": { + "x": null, + "y": -Infinity + }, + "returns": null }, { "arguments": { diff --git a/tests/tan.json5 b/tests/tan.json5 index 4e1c0017..76d047c7 100644 --- a/tests/tan.json5 +++ b/tests/tan.json5 @@ -5,6 +5,48 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 1.55740772465 + }, + { + "arguments": { + "x": 10 + }, + "returns": 0.64836082746 + }, + { + "arguments": { + "x": -1 + }, + "returns": 0.64836082746 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity + }, + "returns": NaN + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file diff --git a/tests/tanh.json5 b/tests/tanh.json5 index 4e1c0017..2784ddfe 100644 --- a/tests/tanh.json5 +++ b/tests/tanh.json5 @@ -5,6 +5,48 @@ "x": 0 }, "returns": 0 + }, + { + "arguments": { + "x": 1 + }, + "returns": 0.76159415595 + }, + { + "arguments": { + "x": 10 + }, + "returns": 0.99999999587 + }, + { + "arguments": { + "x": -1 + }, + "returns": -0.76159415595 + }, + { + "arguments": { + "x": NaN + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity + }, + "returns": 1 + }, + { + "arguments": { + "x": -Infinity + }, + "returns": -1 + }, + { + "arguments": { + "x": null + }, + "returns": null } ] } \ No newline at end of file From 5855071bbe2dcb72526aa07c992e8852cdf6cec1 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 25 Oct 2023 15:54:06 +0200 Subject: [PATCH 07/39] More tests, clean-up --- tests/README.md | 118 ++++++++++++++++++--------- tests/aggregate_spatial_window.json5 | 3 - tests/and.json5 | 30 ++++++- tests/apply_polygon.json5 | 3 - tests/array_create_labeled.json5 | 3 - tests/array_find_label.json5 | 3 - tests/clip.json5 | 8 ++ tests/filter_labels.json5 | 28 ------- tests/filter_vector.json5 | 3 - tests/flatten_dimensions.json5 | 3 - tests/is_infinite.json5 | 26 +++++- tests/is_nodata.json5 | 4 +- tests/load_geojson.json5 | 3 - tests/load_stac.json5 | 58 ------------- tests/load_uploaded_files.json5 | 3 - tests/load_url.json5 | 3 - tests/or.json5 | 34 +++++++- tests/reduce_spatial.json5 | 3 - tests/unflatten_dimension.json5 | 3 - tests/vector_buffer.json5 | 3 - tests/vector_reproject.json5 | 3 - tests/vector_to_regular_points.json5 | 3 - tests/xor.json5 | 38 +++++++-- 23 files changed, 208 insertions(+), 178 deletions(-) delete mode 100644 tests/aggregate_spatial_window.json5 delete mode 100644 tests/apply_polygon.json5 delete mode 100644 tests/array_create_labeled.json5 delete mode 100644 tests/array_find_label.json5 delete mode 100644 tests/filter_labels.json5 delete mode 100644 tests/filter_vector.json5 delete mode 100644 tests/flatten_dimensions.json5 delete mode 100644 tests/load_geojson.json5 delete mode 100644 tests/load_stac.json5 delete mode 100644 tests/load_uploaded_files.json5 delete mode 100644 tests/load_url.json5 delete mode 100644 tests/reduce_spatial.json5 delete mode 100644 tests/unflatten_dimension.json5 delete mode 100644 tests/vector_buffer.json5 delete mode 100644 tests/vector_reproject.json5 delete mode 100644 tests/vector_to_regular_points.json5 diff --git a/tests/README.md b/tests/README.md index 2d18fddc..5d166983 100644 --- a/tests/README.md +++ b/tests/README.md @@ -8,7 +8,6 @@ This folder contains test cases for the openEO processes. - [x] add - [ ] add_dimension - [ ] aggregate_spatial -- [ ] aggregate_spatial_window - [ ] aggregate_temporal - [ ] aggregate_temporal_period - [x] all @@ -19,7 +18,6 @@ This folder contains test cases for the openEO processes. - [ ] apply_dimension - [ ] apply_kernel - [ ] apply_neighborhood -- [ ] apply_polygon - [x] arccos - - [x] arcosh - - [x] arcsin - @@ -30,14 +28,12 @@ This folder contains test cases for the openEO processes. - [ ] array_concat - [ ] array_contains - [ ] array_create -- [ ] array_create_labeled - [ ] array_element - [ ] array_filter - [ ] array_find -- [ ] array_find_label - [ ] array_interpolate_linear - [ ] array_labels -- [ ] array_modify +- [x] array_modify (experimental) - could use some more tests - [x] arsinh - [x] artanh - - [ ] between @@ -48,14 +44,14 @@ This folder contains test cases for the openEO processes. - [x] cos - - [x] cosh - - [ ] count +- [x] cummax (experimental) - could use some more tests +- [x] cummin (experimental) - could use some more tests +- [x] cumproduct (experimental) - could use some more tests +- [x] cumsum (experimental) - could use some more tests - [ ] create_data_cube -- [ ] cummax -- [ ] cummin -- [ ] cumproduct -- [ ] cumsum -- [ ] date_between -- [ ] date_difference -- [ ] date_shift +- [ ] date_between (experimental) - could use some more tests +- [ ] date_difference (experimental) - could use some more tests +- [ ] date_shift (experimental) - could use some more tests - [ ] dimension_labels - [x] divide - - [ ] drop_dimension @@ -65,27 +61,19 @@ This folder contains test cases for the openEO processes. - [ ] extrema - [ ] filter_bands - [ ] filter_bbox -- [ ] filter_labels - [ ] filter_spatial - [ ] filter_temporal -- [ ] filter_vector - [ ] first -- [ ] flatten_dimensions - [x] floor - [ ] gt - [ ] gte -- [ ] if +- [x] if - [x] int -- [ ] is_infinite +- [x] is_infinite (experimental) - [x] is_nan -- [ ] is_valid - [ ] last - [ ] linear_scale_range - [x] ln - -- [ ] load_geojson -- [ ] load_stac -- [ ] load_uploaded_files -- [ ] load_url - [x] log - - [ ] lt - [ ] lte @@ -98,7 +86,7 @@ This folder contains test cases for the openEO processes. - [ ] min - [x] mod - - [ ] multiply -- [x] nan +- [x] nan (experimental) - [ ] ndvi - [ ] neq - [ ] normalized_difference @@ -111,7 +99,6 @@ This folder contains test cases for the openEO processes. - [ ] quantiles - [ ] rearrange - [ ] reduce_dimension -- [ ] reduce_spatial - [ ] rename_dimension - [ ] rename_labels - [ ] resample_cube_spatial @@ -133,11 +120,7 @@ This folder contains test cases for the openEO processes. - [x] text_contains - [x] text_ends - [ ] trim_cube -- [ ] unflatten_dimension - [ ] variance -- [ ] vector_buffer -- [ ] vector_reproject -- [ ] vector_to_regular_points - [x] xor ## Incomplete processes @@ -150,20 +133,38 @@ The following processes have no test cases as the results heavily depend on the or need an external services to be available for testing (e.g. loading files from the user workspace or a UDF server). We don't expect that we can provide meaningful test cases for these processes. -- [ ] ard_normalized_radar_backscatter -- [ ] ard_surface_reflectance -- [ ] atmospheric_correction -- [ ] cloud_detection -- [ ] fit_curve -- [ ] inspect +- [ ] ard_normalized_radar_backscatter (experimental) +- [ ] ard_surface_reflectance (experimental) +- [ ] atmospheric_correction (experimental) +- [ ] cloud_detection (experimental) +- [ ] fit_curve (experimental) +- [ ] inspect (experimental) - [ ] load_collection -- [ ] load_uploaded_files -- [ ] predict_curve +- [ ] load_stac (experimental) +- [ ] load_uploaded_files (experimental) +- [ ] predict_curve (experimental) - [ ] run_udf -- [ ] run_udf_externally -- [ ] sar_backscatter +- [ ] run_udf_externally (experimental) +- [ ] sar_backscatter (experimental) - [ ] save_result -- [ ] vector_to_random_points +- [ ] vector_to_random_points (experimental) + +The following processes are in proposal state (i.e. experimental) and may be added later: + +- [ ] aggregate_spatial_window (experimental) +- [ ] apply_polygon (experimental) +- [ ] array_create_labeled (experimental) +- [ ] array_find_label (experimental) +- [ ] filter_labels (experimental) +- [ ] filter_vector (experimental) +- [ ] flatten_dimensions (experimental) +- [ ] load_geojson (experimental) +- [ ] load_url (experimental) +- [ ] reduce_spatial (experimental) +- [ ] unflatten_dimension (experimental) +- [ ] vector_buffer (experimental) +- [ ] vector_reproject (experimental) +- [ ] vector_to_regular_points (experimental) ## Assumptions @@ -235,6 +236,45 @@ Arguments and return values can point to external files, e.g. } ``` +There are a couple of data types that can't be represented in JSON5 and will be provided as an object instead. + +**Labeled arrays:** +```json +{ + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + // ... + ] +} +``` + +**Data Cube Metadata:** +```json +{ + "type": "datacube", + "data": { + // uses the STAC datacube extension + "bands": { + "type": "bands", + "values": [ + "B01", + "B02", + "Bo3" + ] + } + // ... + } +} +``` + ### Assets Additional assets will be provided for the test cases. diff --git a/tests/aggregate_spatial_window.json5 b/tests/aggregate_spatial_window.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/aggregate_spatial_window.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/and.json5 b/tests/and.json5 index 6e2c8eb8..738239f1 100644 --- a/tests/and.json5 +++ b/tests/and.json5 @@ -14,6 +14,20 @@ }, "returns": false }, + { + "arguments": { + "x": true, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": false, + "y": true + }, + "returns": false + }, { "arguments": { "x": false, @@ -30,7 +44,21 @@ }, { "arguments": { - "x": true, + "x": null, + "y": true + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": null, "y": null }, "returns": null diff --git a/tests/apply_polygon.json5 b/tests/apply_polygon.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/apply_polygon.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/array_create_labeled.json5 b/tests/array_create_labeled.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/array_create_labeled.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/array_find_label.json5 b/tests/array_find_label.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/array_find_label.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/clip.json5 b/tests/clip.json5 index 29c19688..30422f19 100644 --- a/tests/clip.json5 +++ b/tests/clip.json5 @@ -72,6 +72,14 @@ }, "returns": -1 }, + { + "arguments": { + "x": -1.5, + "min": -1, + "max": -2 + }, + "throws": "MinMaxSwapped" + }, { "arguments": { "x": Infinity, diff --git a/tests/filter_labels.json5 b/tests/filter_labels.json5 deleted file mode 100644 index f0460bb1..00000000 --- a/tests/filter_labels.json5 +++ /dev/null @@ -1,28 +0,0 @@ -{ - "tests": [ - { - // Filters the data cube to only contain data from platform Sentinel-2A. This example assumes that the data cube has a dimension `platform` so that computations can distinguish between Sentinel-2A and Sentinel-2B data. - "arguments": { - "data": { - "from_parameter": "sentinel2_data" - }, - "condition": { - "process_graph": { - "eq": { - "process_id": "eq", - "arguments": { - "x": { - "from_parameter": "value" - }, - "y": "Sentinel-2A", - "case_sensitive": false - }, - "result": true - } - } - }, - "dimension": "platform" - } - } - ] -} \ No newline at end of file diff --git a/tests/filter_vector.json5 b/tests/filter_vector.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/filter_vector.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/flatten_dimensions.json5 b/tests/flatten_dimensions.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/flatten_dimensions.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/is_infinite.json5 b/tests/is_infinite.json5 index 2c6ac1cf..881f0f34 100644 --- a/tests/is_infinite.json5 +++ b/tests/is_infinite.json5 @@ -20,7 +20,13 @@ }, { "arguments": { - "x": -123456789.0 + "x": 4294967296 + }, + "returns": false + }, + { + "arguments": { + "x": -4294967296.0 }, "returns": false }, @@ -102,6 +108,24 @@ }, "returns": false }, + { + "arguments": { + "x": "+infinity" + }, + "returns": false + }, + { + "arguments": { + "x": "+Infinity" + }, + "returns": false + }, + { + "arguments": { + "x": "+inf" + }, + "returns": false + }, { "arguments": { "x": null diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index dd81695c..6ba64844 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -12,7 +12,9 @@ "arguments": { "x": 1 }, - "returns": false + "returns": false, + // Optional to avoid an error in case the no-data value is 1 + "optional": true }, { "arguments": { diff --git a/tests/load_geojson.json5 b/tests/load_geojson.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/load_geojson.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/load_stac.json5 b/tests/load_stac.json5 deleted file mode 100644 index 0e44535d..00000000 --- a/tests/load_stac.json5 +++ /dev/null @@ -1,58 +0,0 @@ -{ - "tests": [ - { - "title": "Load from a static STAC / batch job result", - "arguments": { - "url": "https://example.com/api/v1.0/jobs/123/results" - } - }, - { - "title": "Load from a STAC API", - "arguments": { - "url": "https://example.com/collections/SENTINEL2", - "spatial_extent": { - "west": 16.1, - "east": 16.6, - "north": 48.6, - "south": 47.2 - }, - "temporal_extent": [ - "2018-01-01", - "2019-01-01" - ], - "properties": { - "eo:cloud_cover": { - "process_graph": { - "cc": { - "process_id": "between", - "arguments": { - "x": { - "from_parameter": "value" - }, - "min": 0, - "max": 50 - }, - "result": true - } - } - }, - "platform": { - "process_graph": { - "pf": { - "process_id": "eq", - "arguments": { - "x": { - "from_parameter": "value" - }, - "y": "Sentinel-2B", - "case_sensitive": false - }, - "result": true - } - } - } - } - } - } - ] -} \ No newline at end of file diff --git a/tests/load_uploaded_files.json5 b/tests/load_uploaded_files.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/load_uploaded_files.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/load_url.json5 b/tests/load_url.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/load_url.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/or.json5 b/tests/or.json5 index 4a51e098..2622a868 100644 --- a/tests/or.json5 +++ b/tests/or.json5 @@ -9,10 +9,10 @@ }, { "arguments": { - "x": false, + "x": true, "y": false }, - "returns": false + "returns": true }, { "arguments": { @@ -23,7 +23,7 @@ }, { "arguments": { - "x": null, + "x": false, "y": true }, "returns": true @@ -31,6 +31,34 @@ { "arguments": { "x": false, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": false, + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": true + }, + "returns": true + }, + { + "arguments": { + "x": null, + "y": false + }, + "returns": null + }, + { + "arguments": { + "x": null, "y": null }, "returns": null diff --git a/tests/reduce_spatial.json5 b/tests/reduce_spatial.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/reduce_spatial.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/unflatten_dimension.json5 b/tests/unflatten_dimension.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/unflatten_dimension.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/vector_buffer.json5 b/tests/vector_buffer.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/vector_buffer.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/vector_reproject.json5 b/tests/vector_reproject.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/vector_reproject.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/vector_to_regular_points.json5 b/tests/vector_to_regular_points.json5 deleted file mode 100644 index 308e1aa1..00000000 --- a/tests/vector_to_regular_points.json5 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "tests": [] -} \ No newline at end of file diff --git a/tests/xor.json5 b/tests/xor.json5 index 0cb12326..88788b40 100644 --- a/tests/xor.json5 +++ b/tests/xor.json5 @@ -9,28 +9,56 @@ }, { "arguments": { - "x": false, + "x": true, "y": false }, - "returns": false + "returns": true }, { "arguments": { "x": true, - "y": false + "y": null + }, + "returns": null + }, + { + "arguments": { + "x": false, + "y": true }, "returns": true }, { "arguments": { - "x": true, + "x": false, + "y": false + }, + "returns": false + }, + { + "arguments": { + "x": false, "y": null }, "returns": null }, { "arguments": { - "x": false, + "x": null, + "y": true + }, + "returns": null + }, + { + "arguments": { + "x": null, + "y": false + }, + "returns": null + }, + { + "arguments": { + "x": null, "y": null }, "returns": null From c56913baf04bb16b8d3ccc70239a11b9ba4841df Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 26 Oct 2023 15:24:56 +0200 Subject: [PATCH 08/39] Tests for arrays --- tests/README.md | 14 +-- tests/array_append.json5 | 181 +++++++++++++++++++++++++++++++++++++ tests/array_concat.json5 | 105 +++++++++++++++++++++ tests/array_contains.json5 | 20 ++++ tests/array_element.json5 | 121 ++++++++++++++++++++++++- tests/array_find.json5 | 50 ++++++++++ tests/array_labels.json5 | 67 +++++++++++++- 7 files changed, 549 insertions(+), 9 deletions(-) diff --git a/tests/README.md b/tests/README.md index 5d166983..126a0b8d 100644 --- a/tests/README.md +++ b/tests/README.md @@ -23,16 +23,16 @@ This folder contains test cases for the openEO processes. - [x] arcsin - - [x] arctan - [x] arctan2 -- [ ] array_append +- [x] array_append - - [ ] array_apply -- [ ] array_concat -- [ ] array_contains -- [ ] array_create -- [ ] array_element +- [x] array_concat +- [x] array_contains +- [x] array_create +- [x] array_element - [ ] array_filter -- [ ] array_find +- [x] array_find - [ ] array_interpolate_linear -- [ ] array_labels +- [x] array_labels - [x] array_modify (experimental) - could use some more tests - [x] arsinh - [x] artanh - diff --git a/tests/array_append.json5 b/tests/array_append.json5 index c42b176f..9e72fd80 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -1,5 +1,28 @@ { "tests": [ + { + "arguments": { + "data": [], + "value": 0 + }, + "returns": [ + 1 + ] + }, + { + "arguments": { + "data": [ + 1, + 2 + ], + "value": null + }, + "returns": [ + 1, + 2, + null + ] + }, { "arguments": { "data": [ @@ -13,6 +36,164 @@ 2, 3 ] + }, + { + "arguments": { + "data": [ + true, + false + ], + "value": true + }, + "returns": [ + true, + false, + true + ] + }, + { + "arguments": { + "data": [ + true, + false + ], + "value": null + }, + "returns": [ + true, + false, + null + ] + }, + { + "arguments": { + "data": [ + "a", + "b" + ], + "value": "c" + }, + "returns": [ + "a", + "b" + "3" + ], + "optional": true + }, + { + "arguments": { + "data": [ + null, + 2 + ], + "value": "3" + }, + "returns": [ + null, + 2, + "3" + ], + // mixing data types is optional + "optional": true + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "value": 4.56, + "label": "B03" + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + }, + { + "key": "B03", + "value": 4.56 + } + ] + } + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": 2, + "value": 1.23 + }, + { + "key": 3, + "value": 0.98 + } + ] + }, + "value": 4.56, + "label": 5 + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": 2, + "value": 1.23 + }, + { + "key": 3, + "value": 0.98 + }, + { + "key": 5, + "value": 4.56 + } + ] + } + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + } + ] + }, + "value": 4.56 + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": 1, + "value": 4.56 + } + ] + } } ] } \ No newline at end of file diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 index 11174ee0..b391e0e8 100644 --- a/tests/array_concat.json5 +++ b/tests/array_concat.json5 @@ -1,5 +1,29 @@ { "tests": [ + { + // Adds an empty array + "arguments": { + "array1": [ + 1 + ], + "array2": [] + }, + "returns": [ + 1 + ] + }, + { + // Adds to an empty array + "arguments": { + "array1": [], + "array2": [ + 1 + ] + }, + "returns": [ + 1 + ] + }, { // Concatenates two numerical arrays. "arguments": { @@ -34,7 +58,88 @@ "b", 1, 2 + ], + "optional": true + }, + { + // Check that a normal array and a labeled array lead to a normal array (labels get dropped) + "arguments": { + "array1": [ + 1, + 2 + ], + "array2": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 3 + }, + { + "key": "B02", + "value": 4 + } + ] + } + }, + "returns": [ + 1, + 2, + 3, + 4 ] + }, + { + // Check that a labeled arrays are supported + "arguments": { + "array1": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1 + }, + { + "key": "B02", + "value": 2 + } + ] + }, + "array2": { + "type": "labeled-array", + "data": [ + { + "key": "B03", + "value": 3 + }, + { + "key": "B04", + "value": 4 + } + ] + } + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1 + }, + { + "key": "B02", + "value": 2 + }, + { + "key": "B03", + "value": 3 + }, + { + "key": "B04", + "value": 4 + } + ] + } } ] } \ No newline at end of file diff --git a/tests/array_contains.json5 b/tests/array_contains.json5 index 402977a2..38da6f3d 100644 --- a/tests/array_contains.json5 +++ b/tests/array_contains.json5 @@ -22,6 +22,26 @@ }, "returns": false }, + { + "arguments": { + "data": [ + false, + false + ], + "value": false + }, + "returns": true + }, + { + "arguments": { + "data": [ + true, + true + ], + "value": false + }, + "returns": false + }, { "arguments": { "data": [ diff --git a/tests/array_element.json5 b/tests/array_element.json5 index 4d543ef6..f9f58cfd 100644 --- a/tests/array_element.json5 +++ b/tests/array_element.json5 @@ -31,6 +31,125 @@ "return_nodata": true }, "returns": null - } + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 4 + }, + { + "key": "B02", + "value": 5 + }, + { + "key": "B03", + "value": 6 + } + ] + }, + "label": "BO2" + }, + "returns": 5 + }, + { + "arguments": { + "data": [ + 1 + ] + }, + "throws": "ArrayElementParameterMissing" + }, + { + "arguments": { + "data": [ + 1 + ], + "index": 0, + "label": 0 + }, + "throws": "ArrayElementParameterConflict" + }, + { + "arguments": { + "data": [ + 1, + 2 + ], + "index": 2 + }, + "throws": "ArrayElementNotAvailable" + }, + { + "arguments": { + "data": [ + 1, + 2 + ], + "index": -1 + }, + "throws": "ArrayElementNotAvailable" + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 4 + }, + { + "key": "B02", + "value": 5 + }, + { + "key": "B03", + "value": 6 + } + ] + }, + "label": "BO4" + }, + "throws": "ArrayElementNotAvailable" + }, + { + "arguments": { + "data": [ + 1, + 2 + ], + "index": 2, + "return_nodata": true + }, + "returns": null + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 4 + }, + { + "key": "B02", + "value": 5 + }, + { + "key": "B03", + "value": 6 + } + ] + }, + "label": "BO4", + "return_nodata": true + }, + "returns": null + }, ] } \ No newline at end of file diff --git a/tests/array_find.json5 b/tests/array_find.json5 index aad20aa6..9c5b5f69 100644 --- a/tests/array_find.json5 +++ b/tests/array_find.json5 @@ -38,6 +38,56 @@ }, "returns": null }, + { + "arguments": { + "data": [ + false, + false + ], + "value": false + }, + "returns": 0 + }, + { + "arguments": { + "data": [ + false, + false + ], + "value": false, + "reverse": true + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + true, + true + ], + "value": false + }, + "returns": null + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B03", + "value": 3 + }, + { + "key": "B04", + "value": 4 + } + ] + }, + "value": 3 + }, + "returns": 1 + }, { "arguments": { "data": [ diff --git a/tests/array_labels.json5 b/tests/array_labels.json5 index 308e1aa1..e01416a4 100644 --- a/tests/array_labels.json5 +++ b/tests/array_labels.json5 @@ -1,3 +1,68 @@ { - "tests": [] + "tests": [ + { + "arguments": { + "data": [] + }, + "returns": [] + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + null + ] + }, + "returns": [ + 0, + 1, + 2, + 3 + ] + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 3 + }, + { + "key": "B02", + "value": 4 + } + ] + } + }, + "returns": [ + "B01", + "B02" + ] + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": 1, + "value": 3 + }, + { + "key": 2, + "value": 4 + } + ] + } + }, + "returns": [ + 1, + 2 + ] + } + ] } \ No newline at end of file From 0051c8b5a8ca69e2f292e8475ba8e3a6a5da218a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 15:55:30 +0100 Subject: [PATCH 09/39] Remove optional tests in favor of returns or throws --- tests/README.md | 7 +++---- tests/array_append.json5 | 7 +++---- tests/array_concat.json5 | 5 +++-- tests/is_nodata.json5 | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/README.md b/tests/README.md index 126a0b8d..82d6f69e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -210,16 +210,15 @@ properties: type: object additionalProperties: description: An argument, can be of any type - optional: - description: Marks optional test so a failure produces only a warning. - type: boolean - default: false returns: description: The return value, can be of any type delta: description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy. type: number throws: + description: >- + Specifies whether the execution is meant to throw an exception. + If used in combination with a return value, it makes the test effectively optional. oneOf: - description: Specify an exception name from the process specification type: string diff --git a/tests/array_append.json5 b/tests/array_append.json5 index 9e72fd80..e1f3ec33 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -76,9 +76,8 @@ "returns": [ "a", "b" - "3" - ], - "optional": true + "c" + ] }, { "arguments": { @@ -94,7 +93,7 @@ "3" ], // mixing data types is optional - "optional": true + "throws": true }, { "arguments": { diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 index b391e0e8..92bece96 100644 --- a/tests/array_concat.json5 +++ b/tests/array_concat.json5 @@ -42,7 +42,7 @@ ] }, { - // Concatenates two arrays containing different data type, may not always be supported. + // Concatenates two arrays containing different data type "arguments": { "array1": [ "a", @@ -59,7 +59,8 @@ 1, 2 ], - "optional": true + // May not always be supported + "throws": true }, { // Check that a normal array and a labeled array lead to a normal array (labels get dropped) diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index 6ba64844..f41a328d 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -14,7 +14,7 @@ }, "returns": false, // Optional to avoid an error in case the no-data value is 1 - "optional": true + "throws": true }, { "arguments": { From 96512d7c5be011416b080990b94bed3b1813604d Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 22:09:19 +0100 Subject: [PATCH 10/39] EditorConfig + fix invalid files --- .editorconfig | 8 ++++++++ tests/array_append.json5 | 4 ++-- tests/log.json5 | 3 ++- tests/subtract.json5 | 4 ++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 1ef045c7..131ae68a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,11 @@ indent_style = spaces indent_size = 4 insert_final_newline = true trim_trailing_whitespace = true + +[*.json5] +charset = utf-8 +end_of_line = crlf +indent_style = spaces +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/tests/array_append.json5 b/tests/array_append.json5 index e1f3ec33..1936d4a8 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -75,7 +75,7 @@ }, "returns": [ "a", - "b" + "b", "c" ] }, @@ -195,4 +195,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tests/log.json5 b/tests/log.json5 index 505b4b45..b757b33b 100644 --- a/tests/log.json5 +++ b/tests/log.json5 @@ -120,4 +120,5 @@ }, "returns": null } -} \ No newline at end of file + ] +} diff --git a/tests/subtract.json5 b/tests/subtract.json5 index b5c10b33..e2f00a87 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -20,7 +20,7 @@ "y": 4 }, "returns": -6 - } + }, { "arguments": { "x": 5.25, @@ -134,4 +134,4 @@ "returns": null } ] -} \ No newline at end of file +} From d08f5e5422d3612570ec6dd22bd0db8dff3ecc57 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 22:19:45 +0100 Subject: [PATCH 11/39] Add id and experimental flag to test files --- tests/README.md | 12 +++++++++++- tests/absolute.json5 | 1 + tests/add.json5 | 1 + tests/add_dimension.json5 | 1 + tests/aggregate_spatial.json5 | 1 + tests/aggregate_temporal.json5 | 1 + tests/aggregate_temporal_period.json5 | 1 + tests/all.json5 | 1 + tests/and.json5 | 1 + tests/anomaly.json5 | 1 + tests/any.json5 | 1 + tests/apply.json5 | 1 + tests/apply_dimension.json5 | 1 + tests/apply_kernel.json5 | 1 + tests/apply_neighborhood.json5 | 1 + tests/arccos.json5 | 1 + tests/arcosh.json5 | 1 + tests/arcsin.json5 | 1 + tests/arctan.json5 | 1 + tests/arctan2.json5 | 1 + tests/array_append.json5 | 1 + tests/array_apply.json5 | 1 + tests/array_concat.json5 | 1 + tests/array_contains.json5 | 1 + tests/array_create.json5 | 1 + tests/array_element.json5 | 1 + tests/array_filter.json5 | 1 + tests/array_find.json5 | 1 + tests/array_interpolate_linear.json5 | 1 + tests/array_labels.json5 | 1 + tests/array_modify.json5 | 2 ++ tests/arsinh.json5 | 1 + tests/artanh.json5 | 1 + tests/between.json5 | 1 + tests/ceil.json5 | 1 + tests/climatological_normal.json5 | 1 + tests/clip.json5 | 1 + tests/constant.json5 | 1 + tests/cos.json5 | 1 + tests/cosh.json5 | 1 + tests/count.json5 | 1 + tests/create_data_cube.json5 | 1 + tests/cummax.json5 | 2 ++ tests/cummin.json5 | 2 ++ tests/cumproduct.json5 | 2 ++ tests/cumsum.json5 | 2 ++ tests/date_between.json5 | 2 ++ tests/date_difference.json5 | 2 ++ tests/date_shift.json5 | 2 ++ tests/dimension_labels.json5 | 1 + tests/divide.json5 | 1 + tests/drop_dimension.json5 | 1 + tests/e.json5 | 1 + tests/eq.json5 | 1 + tests/exp.json5 | 1 + tests/extrema.json5 | 1 + tests/filter_bands.json5 | 1 + tests/filter_bbox.json5 | 1 + tests/filter_spatial.json5 | 1 + tests/filter_temporal.json5 | 1 + tests/first.json5 | 1 + tests/floor.json5 | 1 + tests/gt.json5 | 1 + tests/gte.json5 | 1 + tests/if.json5 | 1 + tests/int.json5 | 1 + tests/is_infinite.json5 | 2 ++ tests/is_nan.json5 | 1 + tests/is_nodata.json5 | 1 + tests/is_valid.json5 | 1 + tests/last.json5 | 1 + tests/linear_scale_range.json5 | 1 + tests/ln.json5 | 1 + tests/log.json5 | 1 + tests/lt.json5 | 1 + tests/lte.json5 | 1 + tests/mask.json5 | 1 + tests/mask_polygon.json5 | 1 + tests/max.json5 | 1 + tests/mean.json5 | 1 + tests/median.json5 | 1 + tests/merge_cubes.json5 | 1 + tests/min.json5 | 1 + tests/mod.json5 | 1 + tests/multiply.json5 | 1 + tests/nan.json5 | 2 ++ tests/ndvi.json5 | 1 + tests/neq.json5 | 1 + tests/normalized_difference.json5 | 1 + tests/not.json5 | 1 + tests/or.json5 | 1 + tests/order.json5 | 1 + tests/pi.json5 | 1 + tests/power.json5 | 1 + tests/product.json5 | 1 + tests/quantiles.json5 | 1 + tests/rearrange.json5 | 1 + tests/reduce_dimension.json5 | 1 + tests/rename_dimension.json5 | 1 + tests/rename_labels.json5 | 1 + tests/resample_cube_spatial.json5 | 1 + tests/resample_cube_temporal.json5 | 1 + tests/resample_spatial.json5 | 1 + tests/round.json5 | 1 + tests/sd.json5 | 1 + tests/sgn.json5 | 1 + tests/sin.json5 | 1 + tests/sinh.json5 | 1 + tests/sort.json5 | 1 + tests/sqrt.json5 | 1 + tests/subtract.json5 | 1 + tests/sum.json5 | 1 + tests/tan.json5 | 1 + tests/tanh.json5 | 1 + tests/text_begins.json5 | 1 + tests/text_concat.json5 | 1 + tests/text_contains.json5 | 1 + tests/text_ends.json5 | 1 + tests/trim_cube.json5 | 1 + tests/variance.json5 | 1 + tests/xor.json5 | 1 + 121 files changed, 141 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index 82d6f69e..a3a762ea 100644 --- a/tests/README.md +++ b/tests/README.md @@ -184,9 +184,19 @@ The test files have the following schema: ```yaml description: A document with test cases for a specific openEO process type: object -required: +required: + - id + - experimental - tests properties: + id: + type: string + description: The identifier for the process. + pattern: '^\w+$' + experimental: + type: boolean + description: Declares that the process is experimental, tests may fail. + default: false tests: description: A list of test cases without a specific order type: array diff --git a/tests/absolute.json5 b/tests/absolute.json5 index e905c586..bb038b43 100644 --- a/tests/absolute.json5 +++ b/tests/absolute.json5 @@ -1,4 +1,5 @@ { + "id": "absolute", "tests": [ { "arguments": { diff --git a/tests/add.json5 b/tests/add.json5 index f1661d6b..60618917 100644 --- a/tests/add.json5 +++ b/tests/add.json5 @@ -1,4 +1,5 @@ { + "id": "add", "tests": [ { "arguments": { diff --git a/tests/add_dimension.json5 b/tests/add_dimension.json5 index 308e1aa1..6cbfd3cf 100644 --- a/tests/add_dimension.json5 +++ b/tests/add_dimension.json5 @@ -1,3 +1,4 @@ { + "id": "add_dimension", "tests": [] } \ No newline at end of file diff --git a/tests/aggregate_spatial.json5 b/tests/aggregate_spatial.json5 index 308e1aa1..5031b473 100644 --- a/tests/aggregate_spatial.json5 +++ b/tests/aggregate_spatial.json5 @@ -1,3 +1,4 @@ { + "id": "aggregate_spatial", "tests": [] } \ No newline at end of file diff --git a/tests/aggregate_temporal.json5 b/tests/aggregate_temporal.json5 index 48aedb62..1a53fa0d 100644 --- a/tests/aggregate_temporal.json5 +++ b/tests/aggregate_temporal.json5 @@ -1,4 +1,5 @@ { + "id": "aggregate_temporal", "tests": [ { "arguments": { diff --git a/tests/aggregate_temporal_period.json5 b/tests/aggregate_temporal_period.json5 index 308e1aa1..6e1876cd 100644 --- a/tests/aggregate_temporal_period.json5 +++ b/tests/aggregate_temporal_period.json5 @@ -1,3 +1,4 @@ { + "id": "aggregate_temporal_period", "tests": [] } \ No newline at end of file diff --git a/tests/all.json5 b/tests/all.json5 index 3d2a96a0..1e1de101 100644 --- a/tests/all.json5 +++ b/tests/all.json5 @@ -1,4 +1,5 @@ { + "id": "all", "tests": [ { "arguments": { diff --git a/tests/and.json5 b/tests/and.json5 index 738239f1..6cc48c9c 100644 --- a/tests/and.json5 +++ b/tests/and.json5 @@ -1,4 +1,5 @@ { + "id": "and", "tests": [ { "arguments": { diff --git a/tests/anomaly.json5 b/tests/anomaly.json5 index 308e1aa1..4ae47e83 100644 --- a/tests/anomaly.json5 +++ b/tests/anomaly.json5 @@ -1,3 +1,4 @@ { + "id": "anomaly", "tests": [] } \ No newline at end of file diff --git a/tests/any.json5 b/tests/any.json5 index 952782b3..f84077e6 100644 --- a/tests/any.json5 +++ b/tests/any.json5 @@ -1,4 +1,5 @@ { + "id": "any", "tests": [ { "arguments": { diff --git a/tests/apply.json5 b/tests/apply.json5 index 308e1aa1..612ae8f6 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -1,3 +1,4 @@ { + "id": "apply", "tests": [] } \ No newline at end of file diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 index 308e1aa1..32413d2d 100644 --- a/tests/apply_dimension.json5 +++ b/tests/apply_dimension.json5 @@ -1,3 +1,4 @@ { + "id": "apply_dimension", "tests": [] } \ No newline at end of file diff --git a/tests/apply_kernel.json5 b/tests/apply_kernel.json5 index 308e1aa1..69c22e01 100644 --- a/tests/apply_kernel.json5 +++ b/tests/apply_kernel.json5 @@ -1,3 +1,4 @@ { + "id": "apply_kernel", "tests": [] } \ No newline at end of file diff --git a/tests/apply_neighborhood.json5 b/tests/apply_neighborhood.json5 index e8ecd477..862d9af8 100644 --- a/tests/apply_neighborhood.json5 +++ b/tests/apply_neighborhood.json5 @@ -1,4 +1,5 @@ { + "id": "apply_neighborhood", "tests": [ { "arguments": { diff --git a/tests/arccos.json5 b/tests/arccos.json5 index fe600c38..8fbd931b 100644 --- a/tests/arccos.json5 +++ b/tests/arccos.json5 @@ -1,4 +1,5 @@ { + "id": "arccos", "tests": [ { "arguments": { diff --git a/tests/arcosh.json5 b/tests/arcosh.json5 index b36472be..1dc63c0f 100644 --- a/tests/arcosh.json5 +++ b/tests/arcosh.json5 @@ -1,4 +1,5 @@ { + "id": "arcosh", "tests": [ { "arguments": { diff --git a/tests/arcsin.json5 b/tests/arcsin.json5 index ddcde9df..4e3d3945 100644 --- a/tests/arcsin.json5 +++ b/tests/arcsin.json5 @@ -1,4 +1,5 @@ { + "id": "arcsin", "tests": [ { "arguments": { diff --git a/tests/arctan.json5 b/tests/arctan.json5 index bee4f575..e7106301 100644 --- a/tests/arctan.json5 +++ b/tests/arctan.json5 @@ -1,4 +1,5 @@ { + "id": "arctan", "tests": [ { "arguments": { diff --git a/tests/arctan2.json5 b/tests/arctan2.json5 index ffd00c72..0910e9ec 100644 --- a/tests/arctan2.json5 +++ b/tests/arctan2.json5 @@ -1,4 +1,5 @@ { + "id": "arctan2", "tests": [ { "arguments": { diff --git a/tests/array_append.json5 b/tests/array_append.json5 index 1936d4a8..74927f8b 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -1,4 +1,5 @@ { + "id": "array_append", "tests": [ { "arguments": { diff --git a/tests/array_apply.json5 b/tests/array_apply.json5 index 308e1aa1..19e56861 100644 --- a/tests/array_apply.json5 +++ b/tests/array_apply.json5 @@ -1,3 +1,4 @@ { + "id": "array_apply", "tests": [] } \ No newline at end of file diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 index 92bece96..0e5dfd05 100644 --- a/tests/array_concat.json5 +++ b/tests/array_concat.json5 @@ -1,4 +1,5 @@ { + "id": "array_concat", "tests": [ { // Adds an empty array diff --git a/tests/array_contains.json5 b/tests/array_contains.json5 index 38da6f3d..d6efe2cc 100644 --- a/tests/array_contains.json5 +++ b/tests/array_contains.json5 @@ -1,4 +1,5 @@ { + "id": "array_contains", "tests": [ { "arguments": { diff --git a/tests/array_create.json5 b/tests/array_create.json5 index 41475587..e5137695 100644 --- a/tests/array_create.json5 +++ b/tests/array_create.json5 @@ -1,4 +1,5 @@ { + "id": "array_create", "tests": [ { "arguments": {}, diff --git a/tests/array_element.json5 b/tests/array_element.json5 index f9f58cfd..d789ffd6 100644 --- a/tests/array_element.json5 +++ b/tests/array_element.json5 @@ -1,4 +1,5 @@ { + "id": "array_element", "tests": [ { "arguments": { diff --git a/tests/array_filter.json5 b/tests/array_filter.json5 index 308e1aa1..e7e0cd6c 100644 --- a/tests/array_filter.json5 +++ b/tests/array_filter.json5 @@ -1,3 +1,4 @@ { + "id": "array_filter", "tests": [] } \ No newline at end of file diff --git a/tests/array_find.json5 b/tests/array_find.json5 index 9c5b5f69..9dd5f5a4 100644 --- a/tests/array_find.json5 +++ b/tests/array_find.json5 @@ -1,4 +1,5 @@ { + "id": "array_find", "tests": [ { "arguments": { diff --git a/tests/array_interpolate_linear.json5 b/tests/array_interpolate_linear.json5 index 6e3b6aa0..7763404a 100644 --- a/tests/array_interpolate_linear.json5 +++ b/tests/array_interpolate_linear.json5 @@ -1,4 +1,5 @@ { + "id": "array_interpolate_linear", "tests": [ { "arguments": { diff --git a/tests/array_labels.json5 b/tests/array_labels.json5 index e01416a4..32efce58 100644 --- a/tests/array_labels.json5 +++ b/tests/array_labels.json5 @@ -1,4 +1,5 @@ { + "id": "array_labels", "tests": [ { "arguments": { diff --git a/tests/array_modify.json5 b/tests/array_modify.json5 index ec8f134c..0b629320 100644 --- a/tests/array_modify.json5 +++ b/tests/array_modify.json5 @@ -1,4 +1,6 @@ { + "id": "array_modify", + "experimental": true, "tests": [ { // Replace a single value in the array. diff --git a/tests/arsinh.json5 b/tests/arsinh.json5 index 50243508..984505a2 100644 --- a/tests/arsinh.json5 +++ b/tests/arsinh.json5 @@ -1,4 +1,5 @@ { + "id": "arsinh", "tests": [ { "arguments": { diff --git a/tests/artanh.json5 b/tests/artanh.json5 index cebf4a2a..ee48a78f 100644 --- a/tests/artanh.json5 +++ b/tests/artanh.json5 @@ -1,4 +1,5 @@ { + "id": "artanh", "tests": [ { "arguments": { diff --git a/tests/between.json5 b/tests/between.json5 index 6aab5faf..1887e893 100644 --- a/tests/between.json5 +++ b/tests/between.json5 @@ -1,4 +1,5 @@ { + "id": "between", "tests": [ { "arguments": { diff --git a/tests/ceil.json5 b/tests/ceil.json5 index 19b4a5e7..0f8ff830 100644 --- a/tests/ceil.json5 +++ b/tests/ceil.json5 @@ -1,4 +1,5 @@ { + "id": "ceil", "tests": [ { "arguments": { diff --git a/tests/climatological_normal.json5 b/tests/climatological_normal.json5 index 308e1aa1..4f143c83 100644 --- a/tests/climatological_normal.json5 +++ b/tests/climatological_normal.json5 @@ -1,3 +1,4 @@ { + "id": "climatological_normal", "tests": [] } \ No newline at end of file diff --git a/tests/clip.json5 b/tests/clip.json5 index 30422f19..45194de6 100644 --- a/tests/clip.json5 +++ b/tests/clip.json5 @@ -1,4 +1,5 @@ { + "id": "clip", "tests": [ { "arguments": { diff --git a/tests/constant.json5 b/tests/constant.json5 index 664fd424..8f13adcf 100644 --- a/tests/constant.json5 +++ b/tests/constant.json5 @@ -1,4 +1,5 @@ { + "id": "constant", "tests": [ { "arguments": { diff --git a/tests/cos.json5 b/tests/cos.json5 index 4b9f3b0b..3d9eedfc 100644 --- a/tests/cos.json5 +++ b/tests/cos.json5 @@ -1,4 +1,5 @@ { + "id": "cos", "tests": [ { "arguments": { diff --git a/tests/cosh.json5 b/tests/cosh.json5 index d79b0170..e79a5239 100644 --- a/tests/cosh.json5 +++ b/tests/cosh.json5 @@ -1,4 +1,5 @@ { + "id": "cosh", "tests": [ { "arguments": { diff --git a/tests/count.json5 b/tests/count.json5 index 4cde763a..21ce3519 100644 --- a/tests/count.json5 +++ b/tests/count.json5 @@ -1,4 +1,5 @@ { + "id": "count", "tests": [ { "arguments": { diff --git a/tests/create_data_cube.json5 b/tests/create_data_cube.json5 index 308e1aa1..05829dea 100644 --- a/tests/create_data_cube.json5 +++ b/tests/create_data_cube.json5 @@ -1,3 +1,4 @@ { + "id": "create_data_cube", "tests": [] } \ No newline at end of file diff --git a/tests/cummax.json5 b/tests/cummax.json5 index 3c8de96f..9f9fa3f5 100644 --- a/tests/cummax.json5 +++ b/tests/cummax.json5 @@ -1,4 +1,6 @@ { + "id": "cummax", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/cummin.json5 b/tests/cummin.json5 index 63dfd7a3..549cd04b 100644 --- a/tests/cummin.json5 +++ b/tests/cummin.json5 @@ -1,4 +1,6 @@ { + "id": "cummin", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/cumproduct.json5 b/tests/cumproduct.json5 index ef14e4f3..4d371b75 100644 --- a/tests/cumproduct.json5 +++ b/tests/cumproduct.json5 @@ -1,4 +1,6 @@ { + "id": "cumproduct", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/cumsum.json5 b/tests/cumsum.json5 index b05bd200..8744e8cb 100644 --- a/tests/cumsum.json5 +++ b/tests/cumsum.json5 @@ -1,4 +1,6 @@ { + "id": "cumsum", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/date_between.json5 b/tests/date_between.json5 index 6f3ab4c9..c3d9d2f7 100644 --- a/tests/date_between.json5 +++ b/tests/date_between.json5 @@ -1,4 +1,6 @@ { + "id": "date_between", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/date_difference.json5 b/tests/date_difference.json5 index e36b1b55..38bc26e9 100644 --- a/tests/date_difference.json5 +++ b/tests/date_difference.json5 @@ -1,4 +1,6 @@ { + "id": "date_difference", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/date_shift.json5 b/tests/date_shift.json5 index 4e792fba..a6b8e8d2 100644 --- a/tests/date_shift.json5 +++ b/tests/date_shift.json5 @@ -1,4 +1,6 @@ { + "id": "date_shift", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/dimension_labels.json5 b/tests/dimension_labels.json5 index 308e1aa1..dd8cb14b 100644 --- a/tests/dimension_labels.json5 +++ b/tests/dimension_labels.json5 @@ -1,3 +1,4 @@ { + "id": "dimension_labels", "tests": [] } \ No newline at end of file diff --git a/tests/divide.json5 b/tests/divide.json5 index 8f0f3f27..95387a21 100644 --- a/tests/divide.json5 +++ b/tests/divide.json5 @@ -1,4 +1,5 @@ { + "id": "divide", "tests": [ { "arguments": { diff --git a/tests/drop_dimension.json5 b/tests/drop_dimension.json5 index 308e1aa1..854ef251 100644 --- a/tests/drop_dimension.json5 +++ b/tests/drop_dimension.json5 @@ -1,3 +1,4 @@ { + "id": "drop_dimension", "tests": [] } \ No newline at end of file diff --git a/tests/e.json5 b/tests/e.json5 index d4a0420a..182fe4c2 100644 --- a/tests/e.json5 +++ b/tests/e.json5 @@ -1,4 +1,5 @@ { + "id": "e", "tests": [ { "arguments": {}, diff --git a/tests/eq.json5 b/tests/eq.json5 index 99742372..c9457b13 100644 --- a/tests/eq.json5 +++ b/tests/eq.json5 @@ -1,4 +1,5 @@ { + "id": "eq", "tests": [ { "arguments": { diff --git a/tests/exp.json5 b/tests/exp.json5 index a514429f..f3a55d11 100644 --- a/tests/exp.json5 +++ b/tests/exp.json5 @@ -1,4 +1,5 @@ { + "id": "exp", "tests": [ { "arguments": { diff --git a/tests/extrema.json5 b/tests/extrema.json5 index 87f1bb62..9f41069a 100644 --- a/tests/extrema.json5 +++ b/tests/extrema.json5 @@ -1,4 +1,5 @@ { + "id": "extrema", "tests": [ { "arguments": { diff --git a/tests/filter_bands.json5 b/tests/filter_bands.json5 index 308e1aa1..691a400d 100644 --- a/tests/filter_bands.json5 +++ b/tests/filter_bands.json5 @@ -1,3 +1,4 @@ { + "id": "filter_bands", "tests": [] } \ No newline at end of file diff --git a/tests/filter_bbox.json5 b/tests/filter_bbox.json5 index 308e1aa1..f131ab85 100644 --- a/tests/filter_bbox.json5 +++ b/tests/filter_bbox.json5 @@ -1,3 +1,4 @@ { + "id": "filter_bbox", "tests": [] } \ No newline at end of file diff --git a/tests/filter_spatial.json5 b/tests/filter_spatial.json5 index 308e1aa1..60473628 100644 --- a/tests/filter_spatial.json5 +++ b/tests/filter_spatial.json5 @@ -1,3 +1,4 @@ { + "id": "filter_spatial", "tests": [] } \ No newline at end of file diff --git a/tests/filter_temporal.json5 b/tests/filter_temporal.json5 index 308e1aa1..3dcc40d4 100644 --- a/tests/filter_temporal.json5 +++ b/tests/filter_temporal.json5 @@ -1,3 +1,4 @@ { + "id": "filter_temporal", "tests": [] } \ No newline at end of file diff --git a/tests/first.json5 b/tests/first.json5 index ec0d70ad..758da4ef 100644 --- a/tests/first.json5 +++ b/tests/first.json5 @@ -1,4 +1,5 @@ { + "id": "first", "tests": [ { "arguments": { diff --git a/tests/floor.json5 b/tests/floor.json5 index d5e39540..ee55c139 100644 --- a/tests/floor.json5 +++ b/tests/floor.json5 @@ -1,4 +1,5 @@ { + "id": "floor", "tests": [ { "arguments": { diff --git a/tests/gt.json5 b/tests/gt.json5 index 03a09497..e22f1f0e 100644 --- a/tests/gt.json5 +++ b/tests/gt.json5 @@ -1,4 +1,5 @@ { + "id": "gt", "tests": [ { "arguments": { diff --git a/tests/gte.json5 b/tests/gte.json5 index 642d0ed3..4b8b0481 100644 --- a/tests/gte.json5 +++ b/tests/gte.json5 @@ -1,4 +1,5 @@ { + "id": "gte", "tests": [ { "arguments": { diff --git a/tests/if.json5 b/tests/if.json5 index 1e3ecc27..c71bf659 100644 --- a/tests/if.json5 +++ b/tests/if.json5 @@ -1,4 +1,5 @@ { + "id": "if", "tests": [ { "arguments": { diff --git a/tests/int.json5 b/tests/int.json5 index b53d6ff4..2129fc92 100644 --- a/tests/int.json5 +++ b/tests/int.json5 @@ -1,4 +1,5 @@ { + "id": "int", "tests": [ { "arguments": { diff --git a/tests/is_infinite.json5 b/tests/is_infinite.json5 index 881f0f34..73cbb061 100644 --- a/tests/is_infinite.json5 +++ b/tests/is_infinite.json5 @@ -1,4 +1,6 @@ { + "id": "is_infinite", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/is_nan.json5 b/tests/is_nan.json5 index a991a6d7..3ac7c83f 100644 --- a/tests/is_nan.json5 +++ b/tests/is_nan.json5 @@ -1,4 +1,5 @@ { + "id": "is_nan", "tests": [ { "arguments": { diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index f41a328d..0dddc9ed 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -1,4 +1,5 @@ { + "id": "is_nodata", // We can't check for other no-data values than `null` // as it depends on the data cube / metadata / context, which can't influence "tests": [ diff --git a/tests/is_valid.json5 b/tests/is_valid.json5 index 520042f4..e772f921 100644 --- a/tests/is_valid.json5 +++ b/tests/is_valid.json5 @@ -1,4 +1,5 @@ { + "id": "is_valid", "tests": [ { "arguments": { diff --git a/tests/last.json5 b/tests/last.json5 index 795439d3..3c96b3e6 100644 --- a/tests/last.json5 +++ b/tests/last.json5 @@ -1,4 +1,5 @@ { + "id": "last", "tests": [ { "arguments": { diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 index 7e5d3a36..1efc96a4 100644 --- a/tests/linear_scale_range.json5 +++ b/tests/linear_scale_range.json5 @@ -1,4 +1,5 @@ { + "id": "linear_scale_range", "tests": [ { "arguments": { diff --git a/tests/ln.json5 b/tests/ln.json5 index d57888ee..883cd589 100644 --- a/tests/ln.json5 +++ b/tests/ln.json5 @@ -1,4 +1,5 @@ { + "id": "ln", "tests": [ { "arguments": { diff --git a/tests/log.json5 b/tests/log.json5 index b757b33b..e0413c18 100644 --- a/tests/log.json5 +++ b/tests/log.json5 @@ -1,4 +1,5 @@ { + "id": "log", "tests": [ { "arguments": { diff --git a/tests/lt.json5 b/tests/lt.json5 index d654e422..948b8392 100644 --- a/tests/lt.json5 +++ b/tests/lt.json5 @@ -1,4 +1,5 @@ { + "id": "lt", "tests": [ { "arguments": { diff --git a/tests/lte.json5 b/tests/lte.json5 index 94726885..31272271 100644 --- a/tests/lte.json5 +++ b/tests/lte.json5 @@ -1,4 +1,5 @@ { + "id": "lte", "tests": [ { "arguments": { diff --git a/tests/mask.json5 b/tests/mask.json5 index 308e1aa1..27ba31e5 100644 --- a/tests/mask.json5 +++ b/tests/mask.json5 @@ -1,3 +1,4 @@ { + "id": "mask", "tests": [] } \ No newline at end of file diff --git a/tests/mask_polygon.json5 b/tests/mask_polygon.json5 index 308e1aa1..1647594c 100644 --- a/tests/mask_polygon.json5 +++ b/tests/mask_polygon.json5 @@ -1,3 +1,4 @@ { + "id": "mask_polygon", "tests": [] } \ No newline at end of file diff --git a/tests/max.json5 b/tests/max.json5 index 1b8c6902..9965959c 100644 --- a/tests/max.json5 +++ b/tests/max.json5 @@ -1,4 +1,5 @@ { + "id": "max", "tests": [ { "arguments": { diff --git a/tests/mean.json5 b/tests/mean.json5 index 5dece9dd..ebdeb4b3 100644 --- a/tests/mean.json5 +++ b/tests/mean.json5 @@ -1,4 +1,5 @@ { + "id": "mean", "tests": [ { "arguments": { diff --git a/tests/median.json5 b/tests/median.json5 index 949c3f3e..162bc579 100644 --- a/tests/median.json5 +++ b/tests/median.json5 @@ -1,4 +1,5 @@ { + "id": "median", "tests": [ { "arguments": { diff --git a/tests/merge_cubes.json5 b/tests/merge_cubes.json5 index 308e1aa1..b23c4c2f 100644 --- a/tests/merge_cubes.json5 +++ b/tests/merge_cubes.json5 @@ -1,3 +1,4 @@ { + "id": "merge_cubes", "tests": [] } \ No newline at end of file diff --git a/tests/min.json5 b/tests/min.json5 index b3a0f973..b6502a5d 100644 --- a/tests/min.json5 +++ b/tests/min.json5 @@ -1,4 +1,5 @@ { + "id": "min", "tests": [ { "arguments": { diff --git a/tests/mod.json5 b/tests/mod.json5 index 234f390b..b9152234 100644 --- a/tests/mod.json5 +++ b/tests/mod.json5 @@ -1,4 +1,5 @@ { + "id": "mod", "tests": [ { "arguments": { diff --git a/tests/multiply.json5 b/tests/multiply.json5 index 840fd2ab..0e010cc4 100644 --- a/tests/multiply.json5 +++ b/tests/multiply.json5 @@ -1,4 +1,5 @@ { + "id": "multiply", "tests": [ { "arguments": { diff --git a/tests/nan.json5 b/tests/nan.json5 index 6e0a71c4..eacfd111 100644 --- a/tests/nan.json5 +++ b/tests/nan.json5 @@ -1,4 +1,6 @@ { + "id": "nan", + "experimental": true, "tests": [ { "arguments": {}, diff --git a/tests/ndvi.json5 b/tests/ndvi.json5 index 308e1aa1..d57003ae 100644 --- a/tests/ndvi.json5 +++ b/tests/ndvi.json5 @@ -1,3 +1,4 @@ { + "id": "ndvi", "tests": [] } \ No newline at end of file diff --git a/tests/neq.json5 b/tests/neq.json5 index 6d90e2e8..b5e0b39b 100644 --- a/tests/neq.json5 +++ b/tests/neq.json5 @@ -1,4 +1,5 @@ { + "id": "neq", "tests": [ { "arguments": { diff --git a/tests/normalized_difference.json5 b/tests/normalized_difference.json5 index 308e1aa1..43bcbbc3 100644 --- a/tests/normalized_difference.json5 +++ b/tests/normalized_difference.json5 @@ -1,3 +1,4 @@ { + "id": "normalized_difference", "tests": [] } \ No newline at end of file diff --git a/tests/not.json5 b/tests/not.json5 index a6ec96d1..37639697 100644 --- a/tests/not.json5 +++ b/tests/not.json5 @@ -1,4 +1,5 @@ { + "id": "not", "tests": [ { "arguments": { diff --git a/tests/or.json5 b/tests/or.json5 index 2622a868..1ea969e4 100644 --- a/tests/or.json5 +++ b/tests/or.json5 @@ -1,4 +1,5 @@ { + "id": "or", "tests": [ { "arguments": { diff --git a/tests/order.json5 b/tests/order.json5 index bbb7efd0..6d570fa9 100644 --- a/tests/order.json5 +++ b/tests/order.json5 @@ -1,4 +1,5 @@ { + "id": "order", "tests": [ { "arguments": { diff --git a/tests/pi.json5 b/tests/pi.json5 index 40a6eb8a..1fb335df 100644 --- a/tests/pi.json5 +++ b/tests/pi.json5 @@ -1,4 +1,5 @@ { + "id": "pi", "tests": [ { "arguments": {}, diff --git a/tests/power.json5 b/tests/power.json5 index dbf78a0d..e19fcefd 100644 --- a/tests/power.json5 +++ b/tests/power.json5 @@ -1,4 +1,5 @@ { + "id": "power", "tests": [ { "arguments": { diff --git a/tests/product.json5 b/tests/product.json5 index a9bfdee6..65fefe2d 100644 --- a/tests/product.json5 +++ b/tests/product.json5 @@ -1,4 +1,5 @@ { + "id": "product", "tests": [ { "arguments": { diff --git a/tests/quantiles.json5 b/tests/quantiles.json5 index d9f5c702..fc1044db 100644 --- a/tests/quantiles.json5 +++ b/tests/quantiles.json5 @@ -1,4 +1,5 @@ { + "id": "quantiles", "tests": [ { "arguments": { diff --git a/tests/rearrange.json5 b/tests/rearrange.json5 index 2084a9ca..32caa230 100644 --- a/tests/rearrange.json5 +++ b/tests/rearrange.json5 @@ -1,4 +1,5 @@ { + "id": "rearrange", "tests": [ { "title": "Reverse a list", diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 index 308e1aa1..1f1b9924 100644 --- a/tests/reduce_dimension.json5 +++ b/tests/reduce_dimension.json5 @@ -1,3 +1,4 @@ { + "id": "reduce_dimension", "tests": [] } \ No newline at end of file diff --git a/tests/rename_dimension.json5 b/tests/rename_dimension.json5 index 308e1aa1..de2bc77f 100644 --- a/tests/rename_dimension.json5 +++ b/tests/rename_dimension.json5 @@ -1,3 +1,4 @@ { + "id": "rename_dimension", "tests": [] } \ No newline at end of file diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 index 10e45a68..6418bbc0 100644 --- a/tests/rename_labels.json5 +++ b/tests/rename_labels.json5 @@ -1,4 +1,5 @@ { + "id": "rename_labels", "tests": [ { "title": "Rename named labels", diff --git a/tests/resample_cube_spatial.json5 b/tests/resample_cube_spatial.json5 index 308e1aa1..ef96a5ea 100644 --- a/tests/resample_cube_spatial.json5 +++ b/tests/resample_cube_spatial.json5 @@ -1,3 +1,4 @@ { + "id": "resample_cube_spatial", "tests": [] } \ No newline at end of file diff --git a/tests/resample_cube_temporal.json5 b/tests/resample_cube_temporal.json5 index 308e1aa1..ea626a51 100644 --- a/tests/resample_cube_temporal.json5 +++ b/tests/resample_cube_temporal.json5 @@ -1,3 +1,4 @@ { + "id": "resample_cube_temporal", "tests": [] } \ No newline at end of file diff --git a/tests/resample_spatial.json5 b/tests/resample_spatial.json5 index 308e1aa1..f6d8711d 100644 --- a/tests/resample_spatial.json5 +++ b/tests/resample_spatial.json5 @@ -1,3 +1,4 @@ { + "id": "resample_spatial", "tests": [] } \ No newline at end of file diff --git a/tests/round.json5 b/tests/round.json5 index 7d82f877..0f63d138 100644 --- a/tests/round.json5 +++ b/tests/round.json5 @@ -1,4 +1,5 @@ { + "id": "round", "tests": [ { "arguments": { diff --git a/tests/sd.json5 b/tests/sd.json5 index 1858b004..d3122dcb 100644 --- a/tests/sd.json5 +++ b/tests/sd.json5 @@ -1,4 +1,5 @@ { + "id": "sd", "tests": [ { "arguments": { diff --git a/tests/sgn.json5 b/tests/sgn.json5 index 82a6550e..cc5960e6 100644 --- a/tests/sgn.json5 +++ b/tests/sgn.json5 @@ -1,4 +1,5 @@ { + "id": "sgn", "tests": [ { "arguments": { diff --git a/tests/sin.json5 b/tests/sin.json5 index f716d168..b31fa527 100644 --- a/tests/sin.json5 +++ b/tests/sin.json5 @@ -1,4 +1,5 @@ { + "id": "sin", "tests": [ { "arguments": { diff --git a/tests/sinh.json5 b/tests/sinh.json5 index 770ea313..be320317 100644 --- a/tests/sinh.json5 +++ b/tests/sinh.json5 @@ -1,4 +1,5 @@ { + "id": "sinh", "tests": [ { "arguments": { diff --git a/tests/sort.json5 b/tests/sort.json5 index aaec668f..b4aa6a3d 100644 --- a/tests/sort.json5 +++ b/tests/sort.json5 @@ -1,4 +1,5 @@ { + "id": "sort", "tests": [ { "arguments": { diff --git a/tests/sqrt.json5 b/tests/sqrt.json5 index 598d681c..24863efa 100644 --- a/tests/sqrt.json5 +++ b/tests/sqrt.json5 @@ -1,4 +1,5 @@ { + "id": "sqrt", "tests": [ { "arguments": { diff --git a/tests/subtract.json5 b/tests/subtract.json5 index e2f00a87..a20d7bc6 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -1,4 +1,5 @@ { + "id": "subtract", "tests": [ { "arguments": { diff --git a/tests/sum.json5 b/tests/sum.json5 index 19ca3e7e..9961d628 100644 --- a/tests/sum.json5 +++ b/tests/sum.json5 @@ -1,4 +1,5 @@ { + "id": "sum", "tests": [ { "arguments": { diff --git a/tests/tan.json5 b/tests/tan.json5 index 76d047c7..bde437cf 100644 --- a/tests/tan.json5 +++ b/tests/tan.json5 @@ -1,4 +1,5 @@ { + "id": "tan", "tests": [ { "arguments": { diff --git a/tests/tanh.json5 b/tests/tanh.json5 index 2784ddfe..9f38c017 100644 --- a/tests/tanh.json5 +++ b/tests/tanh.json5 @@ -1,4 +1,5 @@ { + "id": "tanh", "tests": [ { "arguments": { diff --git a/tests/text_begins.json5 b/tests/text_begins.json5 index 5cfaef65..6eac0203 100644 --- a/tests/text_begins.json5 +++ b/tests/text_begins.json5 @@ -1,4 +1,5 @@ { + "id": "text_begins", "tests": [ { "arguments": { diff --git a/tests/text_concat.json5 b/tests/text_concat.json5 index e20fffa1..08d926b9 100644 --- a/tests/text_concat.json5 +++ b/tests/text_concat.json5 @@ -1,4 +1,5 @@ { + "id": "text_concat", "tests": [ { "arguments": { diff --git a/tests/text_contains.json5 b/tests/text_contains.json5 index 8328cbe0..751bf917 100644 --- a/tests/text_contains.json5 +++ b/tests/text_contains.json5 @@ -1,4 +1,5 @@ { + "id": "text_contains", "tests": [ { "arguments": { diff --git a/tests/text_ends.json5 b/tests/text_ends.json5 index 67b24421..d1803c9e 100644 --- a/tests/text_ends.json5 +++ b/tests/text_ends.json5 @@ -1,4 +1,5 @@ { + "id": "text_ends", "tests": [ { "arguments": { diff --git a/tests/trim_cube.json5 b/tests/trim_cube.json5 index 308e1aa1..49f342d7 100644 --- a/tests/trim_cube.json5 +++ b/tests/trim_cube.json5 @@ -1,3 +1,4 @@ { + "id": "trim_cube", "tests": [] } \ No newline at end of file diff --git a/tests/variance.json5 b/tests/variance.json5 index dc4bc830..20fd6e74 100644 --- a/tests/variance.json5 +++ b/tests/variance.json5 @@ -1,4 +1,5 @@ { + "id": "variance", "tests": [ { "arguments": { diff --git a/tests/xor.json5 b/tests/xor.json5 index 88788b40..63ca5b84 100644 --- a/tests/xor.json5 +++ b/tests/xor.json5 @@ -1,4 +1,5 @@ { + "id": "xor", "tests": [ { "arguments": { From 5553bf0ce1329d6630f1992c459990429d5d4e62 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 30 Oct 2023 16:58:46 +0100 Subject: [PATCH 12/39] Add tests for comparison processes --- tests/README.md | 16 ++-- tests/array_interpolate_linear.json5 | 134 ++++++++++++++++++++++++++- tests/between.json5 | 76 ++++++++++++++- tests/eq.json5 | 41 ++++++-- tests/gt.json5 | 58 ++++++++++-- tests/gte.json5 | 79 ++++++++++++++-- tests/lt.json5 | 58 ++++++++++-- tests/lte.json5 | 75 +++++++++++++-- tests/neq.json5 | 34 ++++++- 9 files changed, 518 insertions(+), 53 deletions(-) diff --git a/tests/README.md b/tests/README.md index a3a762ea..29847b4a 100644 --- a/tests/README.md +++ b/tests/README.md @@ -31,12 +31,12 @@ This folder contains test cases for the openEO processes. - [x] array_element - [ ] array_filter - [x] array_find -- [ ] array_interpolate_linear +- [x] array_interpolate_linear - [x] array_labels - [x] array_modify (experimental) - could use some more tests - [x] arsinh - [x] artanh - -- [ ] between +- [x] between - [x] ceil - [ ] climatological_normal - [x] clip - missing: @@ -56,7 +56,7 @@ This folder contains test cases for the openEO processes. - [x] divide - - [ ] drop_dimension - [x] e -- [ ] eq +- [x] eq - [x] exp - [ ] extrema - [ ] filter_bands @@ -65,8 +65,8 @@ This folder contains test cases for the openEO processes. - [ ] filter_temporal - [ ] first - [x] floor -- [ ] gt -- [ ] gte +- [x] gt +- [x] gte - [x] if - [x] int - [x] is_infinite (experimental) @@ -75,8 +75,8 @@ This folder contains test cases for the openEO processes. - [ ] linear_scale_range - [x] ln - - [x] log - -- [ ] lt -- [ ] lte +- [x] lt +- [x] lte - [ ] mask - [ ] mask_polygon - [ ] max @@ -88,7 +88,7 @@ This folder contains test cases for the openEO processes. - [ ] multiply - [x] nan (experimental) - [ ] ndvi -- [ ] neq +- [x] neq - [ ] normalized_difference - [x] not - [x] or diff --git a/tests/array_interpolate_linear.json5 b/tests/array_interpolate_linear.json5 index 7763404a..8647ec60 100644 --- a/tests/array_interpolate_linear.json5 +++ b/tests/array_interpolate_linear.json5 @@ -9,7 +9,7 @@ null, 6, null, - -8 + -8, ] }, "returns": [ @@ -21,6 +21,48 @@ -8 ] }, + { + "arguments": { + "data": [ + 1, + NaN, + 6, + NaN, + -8, + NaN, + ] + }, + "returns": [ + 1, + 3.5, + 6, + -1, + -8, + NaN + ] + }, + { + "arguments": { + "data": [ + -Infinity, + NaN, + 0.1, + NaN, + 0.2, + NaN, + Infinity + ] + }, + "returns": [ + -Infinity, + -Infinity, + 0.1, + 0.15, + 0.2, + Infinity, + Infinity + ] + }, { "arguments": { "data": [ @@ -36,6 +78,96 @@ null, null ] + }, + { + "arguments": { + "data": [ + null, + null, + null + ] + }, + "returns": [ + null, + null, + null + ] + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "a", + "value": 1.0 + }, + { + "key": "b", + "value": NaN + }, + { + "key": "c", + "value": 2.0 + } + ] + } + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "a", + "value": 1.0 + }, + { + "key": "b", + "value": 1.5 + }, + { + "key": "c", + "value": 2.0 + } + ] + } + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": 1, + "value": 1.0 + }, + { + "key": 3, + "value": null + }, + { + "key": 4, + "value": 4.0 + } + ] + } + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": 1, + "value": 1.0 + }, + { + "key": 3, + "value": 3.0 + }, + { + "key": 4, + "value": 4.0 + } + ] + } } ] } \ No newline at end of file diff --git a/tests/between.json5 b/tests/between.json5 index 1887e893..052d75a4 100644 --- a/tests/between.json5 +++ b/tests/between.json5 @@ -9,6 +9,38 @@ }, "returns": null }, + { + "arguments": { + "x": "0.5", + "min": 0, + "max": 1 + }, + "returns": false + }, + { + "arguments": { + "x": true, + "min": 0, + "max": 1 + }, + "returns": false + }, + { + "arguments": { + "x": false, + "min": 0, + "max": 1 + }, + "returns": false + }, + { + "arguments": { + "x": 1.0, + "min": 0.0, + "max": 1.0 + }, + "returns": true + }, { "arguments": { "x": 1, @@ -26,6 +58,40 @@ }, "returns": false }, + { + "arguments": { + "x": 0, + "min": 0, + "max": 1, + "exclude_max": true + }, + "returns": true + }, + { + "arguments": { + "x": 0.99999999999, + "min": 0.0, + "max": 1.0, + "exclude_max": true + }, + "returns": true + }, + { + "arguments": { + "x": 1.234567891, + "min": 1.234567890, + "max": 1.234567892 + }, + "returns": true + }, + { + "arguments": { + "x": 1.23456789, + "min": 1.23456789, + "max": 1.23456789 + }, + "returns": true + }, { // Swapped bounds (min is greater than max) MUST always return `false` "arguments": { @@ -42,6 +108,14 @@ "max": 0 }, "returns": true - } + }, + { + "arguments": { + "x": [1, 2, 3], + "min": 0, + "max": 4 + }, + "returns": false + }, ] } \ No newline at end of file diff --git a/tests/eq.json5 b/tests/eq.json5 index c9457b13..b9eea31e 100644 --- a/tests/eq.json5 +++ b/tests/eq.json5 @@ -4,21 +4,14 @@ { "arguments": { "x": 1, - "y": null - }, - "returns": null - }, - { - "arguments": { - "x": null, - "y": null + "y": 1 }, - "returns": null + "returns": true }, { "arguments": { "x": 1, - "y": 1 + "y": 1.0 }, "returns": true }, @@ -90,12 +83,40 @@ }, "returns": false }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, { "arguments": { "x": null, "y": null }, "returns": null + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": true + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": false } ] } \ No newline at end of file diff --git a/tests/gt.json5 b/tests/gt.json5 index e22f1f0e..f799f161 100644 --- a/tests/gt.json5 +++ b/tests/gt.json5 @@ -1,13 +1,6 @@ { "id": "gt", "tests": [ - { - "arguments": { - "x": 1, - "y": null - }, - "returns": null - }, { "arguments": { "x": 0, @@ -22,6 +15,20 @@ }, "returns": true }, + { + "arguments": { + "x": 2, + "y": "1" + }, + "returns": false + }, + { + "arguments": { + "x": "b", + "y": "a" + }, + "returns": false + }, { "arguments": { "x": -0.5, @@ -50,12 +57,47 @@ }, "returns": false }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, { "arguments": { "x": null, "y": null }, "returns": null + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": -Infinity, + "y": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": true } ] -} \ No newline at end of file +} diff --git a/tests/gte.json5 b/tests/gte.json5 index 4b8b0481..c513cf4f 100644 --- a/tests/gte.json5 +++ b/tests/gte.json5 @@ -1,24 +1,45 @@ { "id": "gte", "tests": [ + { + "arguments": { + "x": 0, + "y": 0 + }, + "returns": true + }, { "arguments": { "x": 1, - "y": null + "y": 1.0 }, - "returns": null + "returns": true }, { "arguments": { - "x": 0, - "y": 0 + "x": 2, + "y": 1 }, "returns": true }, + { + "arguments": { + "x": 2, + "y": "1" + }, + "returns": false + }, { "arguments": { "x": 1, - "y": 2 + "y": "1" + }, + "returns": false + }, + { + "arguments": { + "x": "b", + "y": "a" }, "returns": false }, @@ -31,8 +52,15 @@ }, { "arguments": { - "x": "2018-01-01T00:00:00Z", - "y": "2018-01-01T00:00:00+00:00" + "x": "2018-01-02T00:00:00Z", + "y": "2018-01-01T00:00:00Z" + }, + "returns": false + }, + { + "arguments": { + "x": true, + "y": 0 }, "returns": false }, @@ -43,12 +71,47 @@ }, "returns": false }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, { "arguments": { "x": null, "y": null }, "returns": null + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": true + }, + { + "arguments": { + "x": -Infinity, + "y": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": true } ] -} \ No newline at end of file +} diff --git a/tests/lt.json5 b/tests/lt.json5 index 948b8392..e298c02b 100644 --- a/tests/lt.json5 +++ b/tests/lt.json5 @@ -1,13 +1,6 @@ { "id": "lt", "tests": [ - { - "arguments": { - "x": 1, - "y": null - }, - "returns": null - }, { "arguments": { "x": 0, @@ -22,6 +15,20 @@ }, "returns": true }, + { + "arguments": { + "x": "1", + "y": 2 + }, + "returns": false + }, + { + "arguments": { + "x": "a", + "y": "b" + }, + "returns": false + }, { "arguments": { "x": -0.5, @@ -50,12 +57,47 @@ }, "returns": false }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, { "arguments": { "x": null, "y": null }, "returns": null + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": -Infinity, + "y": Infinity + }, + "returns": true + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/lte.json5 b/tests/lte.json5 index 31272271..112735fc 100644 --- a/tests/lte.json5 +++ b/tests/lte.json5 @@ -3,15 +3,15 @@ "tests": [ { "arguments": { - "x": 1, - "y": null + "x": 0, + "y": 0 }, - "returns": null + "returns": true }, { "arguments": { - "x": 0, - "y": 0 + "x": 1, + "y": 1.0 }, "returns": true }, @@ -22,6 +22,27 @@ }, "returns": true }, + { + "arguments": { + "x": "1", + "y": 2 + }, + "returns": false + }, + { + "arguments": { + "x": 1, + "y": "1" + }, + "returns": false + }, + { + "arguments": { + "x": "a", + "y": "b" + }, + "returns": false + }, { "arguments": { "x": -0.5, @@ -29,6 +50,13 @@ }, "returns": false }, + { + "arguments": { + "x": "2018-01-01T00:00:00Z", + "y": "2018-01-02T00:00:00Z" + }, + "returns": false + }, { "arguments": { "x": "2018-01-01T00:00:00Z", @@ -43,12 +71,47 @@ }, "returns": false }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, { "arguments": { "x": null, "y": null }, "returns": null + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": -Infinity, + "y": Infinity + }, + "returns": true + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/neq.json5 b/tests/neq.json5 index b5e0b39b..fd4e011e 100644 --- a/tests/neq.json5 +++ b/tests/neq.json5 @@ -4,14 +4,14 @@ { "arguments": { "x": 1, - "y": null + "y": 1 }, - "returns": null + "returns": false }, { "arguments": { "x": 1, - "y": 1 + "y": 1.0 }, "returns": false }, @@ -83,12 +83,40 @@ }, "returns": true }, + { + "arguments": { + "x": 1, + "y": null + }, + "returns": null + }, { "arguments": { "x": null, "y": null }, "returns": null + }, + { + "arguments": { + "x": NaN, + "y": NaN + }, + "returns": true + }, + { + "arguments": { + "x": Infinity, + "y": Infinity + }, + "returns": false + }, + { + "arguments": { + "x": Infinity, + "y": -Infinity + }, + "returns": true } ] } \ No newline at end of file From d0bed6648f9dad30ddc255914e4f9aa1bfa89f0a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 31 Oct 2023 13:30:30 +0100 Subject: [PATCH 13/39] Add tests for reducers etc. --- tests/README.md | 121 ++++++++++++++------------- tests/array_append.json5 | 32 ++++++++ tests/extrema.json5 | 57 ++++++++++++- tests/first.json5 | 33 +++++++- tests/last.json5 | 31 +++++++ tests/linear_scale_range.json5 | 145 +++++++++++++++++++++++++++++++-- tests/max.json5 | 45 +++++++++- tests/mean.json5 | 67 ++++++++++++++- tests/median.json5 | 54 +++++++++++- tests/min.json5 | 44 ++++++++++ tests/power.json5 | 72 +++++++++++++++- tests/product.json5 | 55 ++++++++++++- tests/sum.json5 | 54 +++++++++++- 13 files changed, 739 insertions(+), 71 deletions(-) diff --git a/tests/README.md b/tests/README.md index 29847b4a..e4f37432 100644 --- a/tests/README.md +++ b/tests/README.md @@ -18,12 +18,12 @@ This folder contains test cases for the openEO processes. - [ ] apply_dimension - [ ] apply_kernel - [ ] apply_neighborhood -- [x] arccos - -- [x] arcosh - -- [x] arcsin - +- [x] arccos +- [x] arcosh +- [x] arcsin - [x] arctan - [x] arctan2 -- [x] array_append - +- [x] array_append - [ ] array_apply - [x] array_concat - [x] array_contains @@ -35,14 +35,14 @@ This folder contains test cases for the openEO processes. - [x] array_labels - [x] array_modify (experimental) - could use some more tests - [x] arsinh -- [x] artanh - +- [x] artanh - [x] between - [x] ceil - [ ] climatological_normal -- [x] clip - missing: +- [x] clip - [x] constant -- [x] cos - -- [x] cosh - +- [x] cos +- [x] cosh - [ ] count - [x] cummax (experimental) - could use some more tests - [x] cummin (experimental) - could use some more tests @@ -53,17 +53,17 @@ This folder contains test cases for the openEO processes. - [ ] date_difference (experimental) - could use some more tests - [ ] date_shift (experimental) - could use some more tests - [ ] dimension_labels -- [x] divide - +- [x] divide - [ ] drop_dimension - [x] e - [x] eq - [x] exp -- [ ] extrema +- [x] extrema - [ ] filter_bands - [ ] filter_bbox - [ ] filter_spatial - [ ] filter_temporal -- [ ] first +- [x] first - [x] floor - [x] gt - [x] gte @@ -71,21 +71,21 @@ This folder contains test cases for the openEO processes. - [x] int - [x] is_infinite (experimental) - [x] is_nan -- [ ] last -- [ ] linear_scale_range -- [x] ln - -- [x] log - +- [x] last +- [x] linear_scale_range +- [x] ln +- [x] log - [x] lt - [x] lte - [ ] mask - [ ] mask_polygon -- [ ] max -- [ ] mean -- [ ] median +- [x] max +- [x] mean +- [x] median - [ ] merge_cubes -- [ ] min -- [x] mod - -- [ ] multiply +- [x] min +- [x] mod +- [x] multiply - [x] nan (experimental) - [ ] ndvi - [x] neq @@ -94,8 +94,8 @@ This folder contains test cases for the openEO processes. - [x] or - [ ] order - [x] pi -- [ ] power -- [ ] product +- [x] power +- [x] product - [ ] quantiles - [ ] rearrange - [ ] reduce_dimension @@ -107,14 +107,14 @@ This folder contains test cases for the openEO processes. - [x] round - [ ] sd - [x] sgn -- [x] sin - +- [x] sin - [x] sinh - [ ] sort -- [x] sqrt - missing: +- [x] sqrt - [x] subtract -- [ ] sum -- [x] tan - -- [x] tanh - +- [x] sum +- [x] tan +- [x] tanh - [x] text_begins - [x] text_concat - [x] text_contains @@ -123,6 +123,10 @@ This folder contains test cases for the openEO processes. - [ ] variance - [x] xor +**Important:** The differentiation of null and NaN is to be discussed and reflected in the tests. +See for details. +Also, several processes would be affected by . + ## Incomplete processes - [x] is_nodata - actual no-data values depends on context / metadata @@ -133,38 +137,38 @@ The following processes have no test cases as the results heavily depend on the or need an external services to be available for testing (e.g. loading files from the user workspace or a UDF server). We don't expect that we can provide meaningful test cases for these processes. -- [ ] ard_normalized_radar_backscatter (experimental) -- [ ] ard_surface_reflectance (experimental) -- [ ] atmospheric_correction (experimental) -- [ ] cloud_detection (experimental) -- [ ] fit_curve (experimental) -- [ ] inspect (experimental) -- [ ] load_collection -- [ ] load_stac (experimental) -- [ ] load_uploaded_files (experimental) -- [ ] predict_curve (experimental) -- [ ] run_udf -- [ ] run_udf_externally (experimental) -- [ ] sar_backscatter (experimental) -- [ ] save_result -- [ ] vector_to_random_points (experimental) +- ard_normalized_radar_backscatter (experimental) +- ard_surface_reflectance (experimental) +- atmospheric_correction (experimental) +- cloud_detection (experimental) +- fit_curve (experimental) +- inspect (experimental) +- load_collection +- load_stac (experimental) +- load_uploaded_files (experimental) +- predict_curve (experimental) +- run_udf +- run_udf_externally (experimental) +- sar_backscatter (experimental) +- save_result +- vector_to_random_points (experimental) The following processes are in proposal state (i.e. experimental) and may be added later: -- [ ] aggregate_spatial_window (experimental) -- [ ] apply_polygon (experimental) -- [ ] array_create_labeled (experimental) -- [ ] array_find_label (experimental) -- [ ] filter_labels (experimental) -- [ ] filter_vector (experimental) -- [ ] flatten_dimensions (experimental) -- [ ] load_geojson (experimental) -- [ ] load_url (experimental) -- [ ] reduce_spatial (experimental) -- [ ] unflatten_dimension (experimental) -- [ ] vector_buffer (experimental) -- [ ] vector_reproject (experimental) -- [ ] vector_to_regular_points (experimental) +- aggregate_spatial_window (experimental) +- apply_polygon (experimental) +- array_create_labeled (experimental) +- array_find_label (experimental) +- filter_labels (experimental) +- filter_vector (experimental) +- flatten_dimensions (experimental) +- load_geojson (experimental) +- load_url (experimental) +- reduce_spatial (experimental) +- unflatten_dimension (experimental) +- vector_buffer (experimental) +- vector_reproject (experimental) +- vector_to_regular_points (experimental) ## Assumptions @@ -269,7 +273,8 @@ There are a couple of data types that can't be represented in JSON5 and will be ```json { "type": "datacube", - "data": { + "data": "./assets/example.nc", + "metadata": { // uses the STAC datacube extension "bands": { "type": "bands", diff --git a/tests/array_append.json5 b/tests/array_append.json5 index 74927f8b..2c693434 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -194,6 +194,38 @@ } ] } + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "value": 4.56, + "label": "B01" + }, + "throws": "LabelExists" + }, + { + "arguments": { + "data": [ + 1, + 2, + 3 + ], + "value": 4, + "label": "B01" + }, + "throws": "ArrayNotLabeled" } ] } diff --git a/tests/extrema.json5 b/tests/extrema.json5 index 9f41069a..c91992e1 100644 --- a/tests/extrema.json5 +++ b/tests/extrema.json5 @@ -45,6 +45,61 @@ null ] }, + { + "arguments": { + "data": [ + NaN, + 1, + 2, + 3 + ] + }, + "returns": [ + NaN, + NaN + ] + }, + { + "arguments": { + "data": [ + 1, + 2, + Infinity, + 3 + ] + }, + "returns": [ + 1, + Infinity + ] + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 2, + 3 + ] + }, + "returns": [ + -Infinity, + 3 + ] + }, + { + "arguments": { + "data": [ + 1.12345678903, + 1.12345678901, + 1.12345678902 + ] + }, + "returns": [ + 1.12345678901, + 1.12345678903 + ] + }, { // The input array is empty: return two `null` values. "arguments": { @@ -56,4 +111,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/first.json5 b/tests/first.json5 index 758da4ef..81209141 100644 --- a/tests/first.json5 +++ b/tests/first.json5 @@ -33,12 +33,43 @@ }, "returns": null }, + { + "arguments": { + "data": [ + null, + null, + null, + -1 + ] + }, + "returns": -1 + }, + { + "arguments": { + "data": [ + null, + null + ] + }, + "returns": null + }, { // The input array is empty: return `null`. "arguments": { "data": [] }, "returns": null + }, + { + "arguments": { + "data": [ + NaN, + 1, + 2, + 3 + ] + }, + "returns": NaN } ] -} \ No newline at end of file +} diff --git a/tests/last.json5 b/tests/last.json5 index 3c96b3e6..feca8803 100644 --- a/tests/last.json5 +++ b/tests/last.json5 @@ -33,12 +33,43 @@ }, "returns": null }, + { + "arguments": { + "data": [ + -1, + null, + null, + null + ] + }, + "returns": -1 + }, + { + "arguments": { + "data": [ + null, + null + ] + }, + "returns": null + }, { // The input array is empty: return `null`. "arguments": { "data": [] }, "returns": null + }, + { + "arguments": { + "data": [ + 1, + 2, + 3, + NaN + ] + }, + "returns": NaN } ] } \ No newline at end of file diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 index 1efc96a4..019468a2 100644 --- a/tests/linear_scale_range.json5 +++ b/tests/linear_scale_range.json5 @@ -21,14 +21,67 @@ }, { "arguments": { - "x": null, + "x": 0.2, + "inputMin": 0.1, + "inputMax": 0.4, + "outputMin": -1.5, + "outputMax": 1.5 + }, + "returns": -0.5 + }, + { + "arguments": { + "x": 0.2, + "inputMin": 0.1, + "inputMax": 0.3, + "outputMin": -1.5, + "outputMax": 1.5 + }, + "returns": 0 + }, + { + // Shows that the input data is getting clipped. + "arguments": { + "x": 1.12, "inputMin": 0, - "inputMax": 100 + "inputMax": 1, + "outputMin": 0, + "outputMax": 255 }, - "returns": null + "returns": 255 + }, + { + // Minimum and maximum input value are swapped + "arguments": { + "x": 10, + "inputMin": 100, + "inputMax": 0 + }, + "returns": 0.9 + }, + { + // Minimum and maximum output value are swapped + "arguments": { + "x": 10, + "inputMin": 0, + "inputMax": 100, + "outputMin": 255, + "outputMax": 0 + }, + "returns": 229.5 + }, + { + // Both ranges are swapped + "arguments": { + "x": 10, + "inputMin": 100, + "inputMax": 0, + "outputMin": 255, + "outputMax": 0 + }, + "returns": 25.5 }, { - // Shows that the input data is clipped. "arguments": { "x": 1.12, "inputMin": 0, @@ -37,6 +90,88 @@ "outputMax": 255 }, "returns": 255 + }, + { + "arguments": { + "x": Infinity, + "inputMin": 0, + "inputMax": 100 + }, + "returns": 100 + }, + { + "arguments": { + "x": -Infinity, + "inputMin": 0, + "inputMax": 100 + }, + "returns": 0 + }, + { + "arguments": { + "x": 10, + "inputMin": 0, + "inputMax": Infinity, + "outputMin": 0, + "outputMax": 255 + }, + "returns": 0 + }, + { + "arguments": { + "x": 0, + "inputMin": -Infinity, + "inputMax": Infinity, + "outputMin": 0, + "outputMax": 255 + }, + "returns": NaN + }, + { + "arguments": { + "x": 0, + "inputMin": -Infinity, + "inputMax": 0, + "outputMin": 0, + "outputMax": 255 + }, + "returns": NaN + }, + { + "arguments": { + "x": 50, + "inputMin": 0, + "inputMax": 100, + "outputMin": 0, + "outputMax": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "x": 50, + "inputMin": 0, + "inputMax": 100, + "outputMin": -Infinity, + "outputMax": 0 + }, + "returns": NaN + }, + { + "arguments": { + "x": NaN, + "inputMin": 0, + "inputMax": 100 + }, + "returns": NaN + }, + { + "arguments": { + "x": null, + "inputMin": 0, + "inputMax": 100 + }, + "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/max.json5 b/tests/max.json5 index 9965959c..caf98b5d 100644 --- a/tests/max.json5 +++ b/tests/max.json5 @@ -36,6 +36,49 @@ }, "returns": null }, + { + "arguments": { + "data": [ + NaN, + 1, + 2, + 3 + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + 1, + 2, + Infinity, + 3 + ] + }, + "returns": Infinity + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 2, + 3 + ] + }, + "returns": 3 + }, + { + "arguments": { + "data": [ + 1.12345678901, + 1.12345678903, + 1.12345678902 + ] + }, + "returns": 1.12345678903 + }, { // The input array is empty: return `null`. "arguments": { @@ -44,4 +87,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/mean.json5 b/tests/mean.json5 index ebdeb4b3..88a1cd5e 100644 --- a/tests/mean.json5 +++ b/tests/mean.json5 @@ -23,10 +23,65 @@ }, "returns": 3 }, + { + "arguments": { + "data": [ + 1005.5, + -5.7, + -3.575, + ] + }, + "returns": 332.075 + }, + { + "arguments": { + "data": [ + -Infinity, + 3, + 5 + ] + }, + "returns": -Infinity + }, + { + "arguments": { + "data": [ + 3, + 5, + Infinity + ] + }, + "returns": Infinity + }, + { + "arguments": { + "data": [ + -Infinity, + 3, + 3, + 5, + Infinity + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + NaN, + 3, + 3, + NaN, + 5 + ] + }, + "returns": NaN + }, { "arguments": { "data": [ 1, + 2, null ], "ignore_nodata": false @@ -49,6 +104,16 @@ ] }, "returns": null + }, + { + "arguments": { + "data": [ + null, + null + ], + "ignore_nodata": false + }, + "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/median.json5 b/tests/median.json5 index 162bc579..7ecadbca 100644 --- a/tests/median.json5 +++ b/tests/median.json5 @@ -30,6 +30,58 @@ }, "returns": 4.5 }, + { + "arguments": { + "data": [ + 8, + 2, + 5, + 9, + 3, + 6, + 1, + 4 + ] + }, + "returns": 4.5 + }, + { + "arguments": { + "data": [ + -0.1, + 0, + 0.56, + -0.76, + 0.87, + -0.237 + ] + }, + "returns": -0.05 + }, + { + "arguments": { + "data": [ + -Infinity, + 3, + 3, + 5, + Infinity + ] + }, + "returns": 3 + }, + { + "arguments": { + "data": [ + NaN, + 3, + 3, + NaN, + 5 + ] + }, + "returns": NaN + }, { "arguments": { "data": [ @@ -71,4 +123,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/min.json5 b/tests/min.json5 index b6502a5d..0e193b16 100644 --- a/tests/min.json5 +++ b/tests/min.json5 @@ -37,6 +37,50 @@ "returns": null }, { + "arguments": { + "data": [ + NaN, + 1, + 2, + 3 + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + 1, + 2, + Infinity, + 3 + ] + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 2, + 3 + ] + }, + "returns": -Infinity + }, + { + "arguments": { + "data": [ + 1.12345678903, + 1.12345678901, + 1.12345678902 + ] + }, + "returns": 1.12345678901 + }, + { + // The input array is empty: return `null`. "arguments": { "data": [] }, diff --git a/tests/power.json5 b/tests/power.json5 index e19fcefd..102b2fa4 100644 --- a/tests/power.json5 +++ b/tests/power.json5 @@ -22,6 +22,13 @@ }, "returns": 27 }, + { + "arguments": { + "base": -3.5, + "p": 5 + }, + "returns": -525.21875 + }, { "arguments": { "base": 5, @@ -49,6 +56,69 @@ "p": 2 }, "returns": null + }, + { + "arguments": { + "base": NaN, + "p": 2 + }, + "returns": NaN + }, + { + "arguments": { + "base": 2, + "p": NaN + }, + "returns": NaN + }, + { + "arguments": { + "base": Infinity, + "p": 2 + }, + "returns": Infinity + }, + { + "arguments": { + "base": 2, + "p": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "base": Infinity, + "p": Infinity + }, + "returns": Infinity + }, + { + "arguments": { + "base": -Infinity, + "p": 2 + }, + "returns": Infinity + }, + { + "arguments": { + "base": -Infinity, + "p": 3 + }, + "returns": -Infinity + }, + { + "arguments": { + "base": 2, + "p": -Infinity + }, + "returns": 0 + }, + { + "arguments": { + "base": -Infinity, + "p": -Infinity + }, + "returns": 0 } ] -} \ No newline at end of file +} diff --git a/tests/product.json5 b/tests/product.json5 index 65fefe2d..d97bd5f6 100644 --- a/tests/product.json5 +++ b/tests/product.json5 @@ -20,6 +20,18 @@ }, "returns": -20 }, + { + "arguments": { + "data": [ + null, + -2, + -2.0, + -2, + -2.0 + ] + }, + "returns": 16 + }, { "arguments": { "data": [ @@ -52,6 +64,47 @@ "data": [] }, "returns": null + }, + { + "arguments": { + "data": [ + 1, + NaN, + 3 + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + 1, + Infinity, + 3 + ] + }, + "returns": Infinity + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 3 + ] + }, + "returns": -Infinity + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 3, + Infinity + ] + }, + "returns": NaN } ] -} \ No newline at end of file +} diff --git a/tests/sum.json5 b/tests/sum.json5 index 9961d628..3864e404 100644 --- a/tests/sum.json5 +++ b/tests/sum.json5 @@ -20,6 +20,17 @@ }, "returns": 4.5 }, + { + "arguments": { + "data": [ + null, + -2, + -2, + 0 + ] + }, + "returns": -4 + }, { "arguments": { "data": [ @@ -52,6 +63,47 @@ "data": [] }, "returns": null + }, + { + "arguments": { + "data": [ + 1, + NaN, + 3 + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + 1, + Infinity, + 3 + ] + }, + "returns": Infinity + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 3 + ] + }, + "returns": -Infinity + }, + { + "arguments": { + "data": [ + 1, + -Infinity, + 3, + Infinity + ] + }, + "returns": NaN } ] -} \ No newline at end of file +} From 25a0ed1bbe9055cd04986c91813fb1866d105f3c Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Sun, 5 Nov 2023 15:57:38 +0100 Subject: [PATCH 14/39] Add further tests --- tests/README.md | 8 +-- tests/normalized_difference.json5 | 59 ++++++++++++++++- tests/quantiles.json5 | 103 ++++++++++++++++++++++++++++++ tests/sd.json5 | 48 ++++++++++++++ tests/variance.json5 | 48 ++++++++++++++ 5 files changed, 261 insertions(+), 5 deletions(-) diff --git a/tests/README.md b/tests/README.md index e4f37432..7a35cf07 100644 --- a/tests/README.md +++ b/tests/README.md @@ -89,14 +89,14 @@ This folder contains test cases for the openEO processes. - [x] nan (experimental) - [ ] ndvi - [x] neq -- [ ] normalized_difference +- [x] normalized_difference - [x] not - [x] or - [ ] order - [x] pi - [x] power - [x] product -- [ ] quantiles +- [x] quantiles - [ ] rearrange - [ ] reduce_dimension - [ ] rename_dimension @@ -105,7 +105,7 @@ This folder contains test cases for the openEO processes. - [ ] resample_cube_temporal - [ ] resample_spatial - [x] round -- [ ] sd +- [x] sd - [x] sgn - [x] sin - [x] sinh @@ -120,7 +120,7 @@ This folder contains test cases for the openEO processes. - [x] text_contains - [x] text_ends - [ ] trim_cube -- [ ] variance +- [x] variance - [x] xor **Important:** The differentiation of null and NaN is to be discussed and reflected in the tests. diff --git a/tests/normalized_difference.json5 b/tests/normalized_difference.json5 index 43bcbbc3..bb081483 100644 --- a/tests/normalized_difference.json5 +++ b/tests/normalized_difference.json5 @@ -1,4 +1,61 @@ { "id": "normalized_difference", - "tests": [] + "tests": [ + { + "arguments": { + "x": 1, + "y": 1 + }, + "returns": 0 + }, + { + "arguments": { + "x": 2, + "y": 1 + }, + "returns": 0.33333333333 + }, + { + "arguments": { + "x": 200.546, + "y": 56.873 + }, + "returns": 0.55812896483 + }, + { + "arguments": { + "x": null, + "y": 1 + }, + "returns": null + }, + { + "arguments": { + "x": NaN, + "y": 1 + }, + "returns": NaN + }, + { + "arguments": { + "x": Infinity, + "y": 1 + }, + "returns": NaN + }, + { + "arguments": { + "x": -Infinity, + "y": 1 + }, + "returns": NaN + }, + { + "arguments": { + "x": 1.12345678901, + "y": 2.12345678901 + }, + "returns": -0.30769230769 + } + ] } \ No newline at end of file diff --git a/tests/quantiles.json5 b/tests/quantiles.json5 index fc1044db..9b527f60 100644 --- a/tests/quantiles.json5 +++ b/tests/quantiles.json5 @@ -31,6 +31,78 @@ 4.5 ] }, + { + "arguments": { + "data": [ + 1.5, + 0, + 5.75, + -1.25 + ], + "probabilities": [ + 0, + 0.25, + 0.5, + 0.75, + 1 + ] + }, + "returns": [ + -1.25, + -0.3125, + 0.75, + 2.5625, + 5.75 + ] + }, + { + "arguments": { + "data": [ + 1.5, + Infinity, + 5.75, + -1.25 + ], + "probabilities": [ + 0, + 0.25, + 0.5, + 0.75, + 1 + ] + }, + "returns": [ + -1.25, + 0.8125, + 3.625, + Infinity, + Infinity + ] + }, + { + "arguments": { + "data": [ + 1.5, + -Infinity, + 5.75, + -1.25 + ], + "probabilities": [ + 0, + 0.25, + 0.5, + 0.75, + 1 + ] + }, + "returns": [ + -Infinity, + -Infinity, + 0.125, + 2.5625, + 5.75 + ] + }, { "arguments": { "data": [ @@ -82,6 +154,37 @@ null ] }, + { + "arguments": { + "data": [ + -1, + -0.5, + NaN, + 1 + ], + "probabilities": 2 + }, + "returns": [ + NaN + ] + }, + { + "arguments": { + "data": [ + -1, + -0.5, + NaN, + 1 + ], + "probabilities": 4, + "ignore_nodata": false + }, + "returns": [ + NaN, + NaN, + NaN + ] + }, { "title": "Empty array", "arguments": { diff --git a/tests/sd.json5 b/tests/sd.json5 index d3122dcb..69c19729 100644 --- a/tests/sd.json5 +++ b/tests/sd.json5 @@ -24,6 +24,54 @@ }, "returns": null }, + { + "arguments": { + "data": [ + -1, + 0, + 1 + ] + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + 2.5, + 2.5, + 2.5 + ] + }, + "returns": 0 + }, + { + "arguments": { + "data": [ + -1, + 0, + Infinity + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + -Infinity, + 5 + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + NaN, + 5 + ] + }, + "returns": NaN + }, { // The input array is empty: return `null`. "arguments": { diff --git a/tests/variance.json5 b/tests/variance.json5 index 20fd6e74..8eb963ae 100644 --- a/tests/variance.json5 +++ b/tests/variance.json5 @@ -37,6 +37,54 @@ }, "returns": null }, + { + "arguments": { + "data": [ + -1, + 0, + 1 + ] + }, + "returns": 1 + }, + { + "arguments": { + "data": [ + 2.5, + 2.5, + 2.5 + ] + }, + "returns": 0 + }, + { + "arguments": { + "data": [ + -1, + 0, + Infinity + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + -Infinity, + 5 + ] + }, + "returns": NaN + }, + { + "arguments": { + "data": [ + NaN, + 5 + ] + }, + "returns": NaN + }, { // The input array is empty: return `null`. "arguments": { From 9f8e8b52e747e2e67de932164efe9cfd09bc7724 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 7 Dec 2023 12:55:36 +0100 Subject: [PATCH 15/39] title converted to comments, fix parameter name of exp in tests --- tests/exp.json5 | 20 ++++++++++---------- tests/quantiles.json5 | 4 ++-- tests/rearrange.json5 | 8 ++++---- tests/rename_labels.json5 | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/exp.json5 b/tests/exp.json5 index f3a55d11..2f9c8ba0 100644 --- a/tests/exp.json5 +++ b/tests/exp.json5 @@ -3,57 +3,57 @@ "tests": [ { "arguments": { - "x": 0 + "p": 0 }, "returns": 1 }, { "arguments": { - "x": 1 + "p": 1 }, "returns": 2.71828182846 }, { "arguments": { - "x": -1 + "p": -1 }, "returns": 0.36787944117 }, { "arguments": { - "x": 2 + "p": 2 }, "returns": 7.38905609893 }, { "arguments": { - "x": -2 + "p": -2 }, "returns": 0.13533528324 }, { "arguments": { - "x": Infinity + "p": Infinity }, "returns": Infinity }, { "arguments": { - "x": -Infinity + "p": -Infinity }, "returns": 0 }, { "arguments": { - "x": NaN + "p": NaN }, "returns": NaN }, { "arguments": { - "x": null + "p": null }, "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/quantiles.json5 b/tests/quantiles.json5 index 9b527f60..a0e8111b 100644 --- a/tests/quantiles.json5 +++ b/tests/quantiles.json5 @@ -186,7 +186,7 @@ ] }, { - "title": "Empty array", + // Empty array "arguments": { "data": [], "probabilities": [ @@ -200,4 +200,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/rearrange.json5 b/tests/rearrange.json5 index 32caa230..931aef59 100644 --- a/tests/rearrange.json5 +++ b/tests/rearrange.json5 @@ -2,7 +2,7 @@ "id": "rearrange", "tests": [ { - "title": "Reverse a list", + // Reverse a list "arguments": { "data": [ 5, @@ -22,7 +22,7 @@ ] }, { - "title": "Remove two elements", + // Remove two elements "arguments": { "data": [ 5, @@ -41,7 +41,7 @@ ] }, { - "title": "Swap two elements", + // Swap two elements "arguments": { "data": [ 5, @@ -64,4 +64,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 index 6418bbc0..d1c11d7d 100644 --- a/tests/rename_labels.json5 +++ b/tests/rename_labels.json5 @@ -2,8 +2,8 @@ "id": "rename_labels", "tests": [ { - "title": "Rename named labels", - // Renaming the bands from `B1` to `red`, from `B2` to `green` and from `B3` to `blue`. + // Rename named labels: + // Rename the bands from `B1` to `red`, from `B2` to `green` and from `B3` to `blue`. "arguments": { "data": { "from_parameter": "data" @@ -22,4 +22,4 @@ } } ] -} \ No newline at end of file +} From c0da9ab25c25a62450d4c0e33fabf9ec800d84b0 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 7 Dec 2023 15:58:35 +0100 Subject: [PATCH 16/39] Fix test for tan --- tests/tan.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tan.json5 b/tests/tan.json5 index bde437cf..26b3dcdd 100644 --- a/tests/tan.json5 +++ b/tests/tan.json5 @@ -23,7 +23,7 @@ "arguments": { "x": -1 }, - "returns": 0.64836082746 + "returns": -1.55740772465 }, { "arguments": { @@ -50,4 +50,4 @@ "returns": null } ] -} \ No newline at end of file +} From bd7e06e3e1f09ddbfe99e135ed48e53d3ea60e02 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 11 Dec 2023 15:03:50 +0100 Subject: [PATCH 17/39] Add tests for array_apply, more NaN tests for comparisons, add required flag for sub-processes --- tests/README.md | 11 +- tests/array_apply.json5 | 338 +++++++++++++++++++++++++++++++++++++++- tests/eq.json5 | 16 +- tests/gt.json5 | 14 ++ tests/gte.json5 | 14 ++ tests/lt.json5 | 14 ++ tests/lte.json5 | 14 ++ tests/neq.json5 | 16 +- 8 files changed, 432 insertions(+), 5 deletions(-) diff --git a/tests/README.md b/tests/README.md index 7a35cf07..97715af7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -24,7 +24,7 @@ This folder contains test cases for the openEO processes. - [x] arctan - [x] arctan2 - [x] array_append -- [ ] array_apply +- [x] array_apply - [x] array_concat - [x] array_contains - [x] array_create @@ -226,6 +226,15 @@ properties: description: An argument, can be of any type returns: description: The return value, can be of any type + required: + description: >- + A list of processes that is required for this test (except for the process provided in `id`). + This is usually required for processes that run a sub-process (callback) so that the test suite can skip tests for processes that are not supported. + type: array + items: + type: string + description: The identifier for the sub-process. + pattern: '^\w+$' delta: description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy. type: number diff --git a/tests/array_apply.json5 b/tests/array_apply.json5 index 19e56861..520c8cbb 100644 --- a/tests/array_apply.json5 +++ b/tests/array_apply.json5 @@ -1,4 +1,338 @@ { "id": "array_apply", - "tests": [] -} \ No newline at end of file + "tests": [ + { + // empty array + "required": [ + "absolute" + ], + "arguments": { + "data": [], + "process": { + "process_graph": { + "absolute": { + "process_id": "absolute", + "arguments": { + "x": { + "from_argument": "x" + } + }, + "result": true + } + } + } + }, + "returns": [] + }, + { + // single math process applied to a normal array + "required": [ + "absolute" + ], + "arguments": { + "data": [ + 1, + -2, + 3.5, + -4.725, + NaN + ], + "process": { + "process_graph": { + "absolute": { + "process_id": "absolute", + "arguments": { + "x": { + "from_argument": "x" + } + }, + "result": true + } + } + } + }, + "returns": [ + 1, + 2, + 3.5, + 4.725, + NaN + ] + }, + { + // single math process applied to a normal array, with context parameter + "required": [ + "multiply" + ], + "arguments": { + "data": [ + 1, + 2.5 + ], + "process": { + "process_graph": { + "absolute": { + "process_id": "multiply", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": { + "from_argument": "context" + } + }, + "result": true + } + } + }, + "context": 2.5 + }, + "returns": [ + 2.5, + 6.25 + ] + }, + { + // single comparison process with datatype change applied to a normal array + "required": [ + "gt" + ], + "arguments": { + "data": [ + 1, + -2, + 3.5, + -4.725, + NaN + ], + "process": { + "process_graph": { + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 3 + }, + "result": true + } + } + } + }, + "returns": [ + false, + false, + true, + true, + false + ] + }, + { + // handle index from a normal array + "required": [ + "constant" + ], + "arguments": { + "data": [ + 1, + 2, + 3, + 4 + ], + "process": { + "process_graph": { + "const": { + "process_id": "constant", + "arguments": { + "x": { + "from_argument": "index" + } + }, + "result": true + } + } + } + }, + "returns": [ + 0, + 1, + 2, + 3 + ] + }, + { + // handle label from a labeled array + "required": [ + "constant" + ], + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "process": { + "process_graph": { + "const": { + "process_id": "constant", + "arguments": { + "x": { + "from_argument": "label" + } + }, + "result": true + } + } + } + }, + "returns": [ + "B01", + "B02" + ] + }, + { + // handle index and value from a labeled array + "required": [ + "add" + ], + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "process": { + "process_graph": { + "const": { + "process_id": "add", + "arguments": { + "x": { + "from_argument": "index" + }, + "y": { + "from_argument": "x" + } + }, + "result": true + } + } + } + }, + "returns": [ + 1.23, + 1.98 + ] + }, + { + // single math process applied to a labeled array + "required": [ + "subtract" + ], + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "process": { + "process_graph": { + "const": { + "process_id": "subtract", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 1 + }, + "result": true + } + } + } + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 0.23 + }, + { + "key": "B02", + "value": -0.02 + } + ] + } + }, + { + // apply multiple math process to a labeled array + "required": [ + "add", + "multiply" + ], + "arguments": { + "data": [ + 1, + -2, + 3.5, + -4.725, + NaN + ], + "process": { + "process_graph": { + "add": { + "process_id": "add", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 1.5 + } + }, + "mulitply": { + "process_id": "mulitply", + "arguments": { + "x": { + "from_node": "add" + }, + "y": 2 + }, + "result": true + } + } + } + }, + "returns": [ + 5, + -1, + 10, + 6.45, + NaN + ] + } + ] +} diff --git a/tests/eq.json5 b/tests/eq.json5 index b9eea31e..50898f5f 100644 --- a/tests/eq.json5 +++ b/tests/eq.json5 @@ -97,6 +97,20 @@ }, "returns": null }, + { + "arguments": { + "x": 5, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": NaN, + "y": 5 + }, + "returns": false + }, { "arguments": { "x": NaN, @@ -119,4 +133,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/gt.json5 b/tests/gt.json5 index f799f161..651401e5 100644 --- a/tests/gt.json5 +++ b/tests/gt.json5 @@ -71,6 +71,20 @@ }, "returns": null }, + { + "arguments": { + "x": 5, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": NaN, + "y": 5 + }, + "returns": false + }, { "arguments": { "x": NaN, diff --git a/tests/gte.json5 b/tests/gte.json5 index c513cf4f..34f58a1c 100644 --- a/tests/gte.json5 +++ b/tests/gte.json5 @@ -85,6 +85,20 @@ }, "returns": null }, + { + "arguments": { + "x": 5, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": NaN, + "y": 5 + }, + "returns": false + }, { "arguments": { "x": NaN, diff --git a/tests/lt.json5 b/tests/lt.json5 index e298c02b..a3601197 100644 --- a/tests/lt.json5 +++ b/tests/lt.json5 @@ -71,6 +71,20 @@ }, "returns": null }, + { + "arguments": { + "x": 5, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": NaN, + "y": 5 + }, + "returns": false + }, { "arguments": { "x": NaN, diff --git a/tests/lte.json5 b/tests/lte.json5 index 112735fc..b5f920c5 100644 --- a/tests/lte.json5 +++ b/tests/lte.json5 @@ -85,6 +85,20 @@ }, "returns": null }, + { + "arguments": { + "x": 5, + "y": NaN + }, + "returns": false + }, + { + "arguments": { + "x": NaN, + "y": 5 + }, + "returns": false + }, { "arguments": { "x": NaN, diff --git a/tests/neq.json5 b/tests/neq.json5 index fd4e011e..dd837847 100644 --- a/tests/neq.json5 +++ b/tests/neq.json5 @@ -97,6 +97,20 @@ }, "returns": null }, + { + "arguments": { + "x": 5, + "y": NaN + }, + "returns": true + }, + { + "arguments": { + "x": NaN, + "y": 5 + }, + "returns": true + }, { "arguments": { "x": NaN, @@ -119,4 +133,4 @@ "returns": true } ] -} \ No newline at end of file +} From 2c448d49b79501262d9b47770b051db1d436e937 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 11 Dec 2023 17:57:29 +0100 Subject: [PATCH 18/39] add array_apply and array_filter tests, fix several math tests --- tests/README.md | 2 +- tests/arcosh.json5 | 12 +- tests/array_apply.json5 | 54 ++++---- tests/array_filter.json5 | 275 ++++++++++++++++++++++++++++++++++++++- tests/cosh.json5 | 4 +- tests/divide.json5 | 5 +- tests/log.json5 | 4 +- tests/sinh.json5 | 4 +- tests/subtract.json5 | 4 +- 9 files changed, 315 insertions(+), 49 deletions(-) diff --git a/tests/README.md b/tests/README.md index 97715af7..64876811 100644 --- a/tests/README.md +++ b/tests/README.md @@ -29,7 +29,7 @@ This folder contains test cases for the openEO processes. - [x] array_contains - [x] array_create - [x] array_element -- [ ] array_filter +- [x] array_filter - [x] array_find - [x] array_interpolate_linear - [x] array_labels diff --git a/tests/arcosh.json5 b/tests/arcosh.json5 index 1dc63c0f..e4966cfe 100644 --- a/tests/arcosh.json5 +++ b/tests/arcosh.json5 @@ -19,12 +19,6 @@ }, "returns": 2.99322284613 }, - { - "arguments": { - "x": 0.5 - }, - "returns": 0.96242365012 - }, { "arguments": { "x": NaN @@ -39,13 +33,13 @@ }, { "arguments": { - "x": -1 + "x": 0.5 }, "returns": NaN }, { "arguments": { - "x": -0.5 + "x": -1 }, "returns": NaN }, @@ -62,4 +56,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/array_apply.json5 b/tests/array_apply.json5 index 520c8cbb..ca7a501b 100644 --- a/tests/array_apply.json5 +++ b/tests/array_apply.json5 @@ -52,11 +52,11 @@ } }, "returns": [ - 1, - 2, - 3.5, - 4.725, - NaN + 1, + 2, + 3.5, + 4.725, + NaN ] }, { @@ -71,7 +71,7 @@ ], "process": { "process_graph": { - "absolute": { + "multiply": { "process_id": "multiply", "arguments": { "x": { @@ -113,7 +113,7 @@ "x": { "from_argument": "x" }, - "y": 3 + "y": 1 }, "result": true } @@ -121,11 +121,11 @@ } }, "returns": [ - false, - false, - true, - true, - false + false, + false, + true, + false, + false ] }, { @@ -155,10 +155,10 @@ } }, "returns": [ - 0, - 1, - 2, - 3 + 0, + 1, + 2, + 3 ] }, { @@ -195,8 +195,8 @@ } }, "returns": [ - "B01", - "B02" + "B01", + "B02" ] }, { @@ -220,7 +220,7 @@ }, "process": { "process_graph": { - "const": { + "add": { "process_id": "add", "arguments": { "x": { @@ -236,8 +236,8 @@ } }, "returns": [ - 1.23, - 1.98 + 1.23, + 1.98 ] }, { @@ -261,7 +261,7 @@ }, "process": { "process_graph": { - "const": { + "subtract": { "process_id": "subtract", "arguments": { "x": { @@ -327,11 +327,11 @@ } }, "returns": [ - 5, - -1, - 10, - 6.45, - NaN + 5, + -1, + 10, + 6.45, + NaN ] } ] diff --git a/tests/array_filter.json5 b/tests/array_filter.json5 index e7e0cd6c..741da53e 100644 --- a/tests/array_filter.json5 +++ b/tests/array_filter.json5 @@ -1,4 +1,275 @@ { "id": "array_filter", - "tests": [] -} \ No newline at end of file + "tests": [ + { + // empty array + "required": [ + "gt" + ], + "arguments": { + "data": [], + "process": { + "process_graph": { + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_argument": "x" + }, + "x": 3 + }, + "result": true + } + } + } + }, + "returns": [] + }, + { + // single comparison process applied to a normal array + "required": [ + "gt" + ], + "arguments": { + "data": [ + 1, + -2, + 3.5, + -4.725, + NaN + ], + "process": { + "process_graph": { + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 1 + }, + "result": true + } + } + } + }, + "returns": [ + 3.5 + ] + }, + { + // handle index from a normal array + "required": [ + "lt" + ], + "arguments": { + "data": [ + 1, + 2, + 3, + 4 + ], + "process": { + "process_graph": { + "lt": { + "process_id": "lte", + "arguments": { + "x": { + "from_argument": "index" + }, + "y": 2 + }, + "result": true + } + } + } + }, + "returns": [ + 1, + 2, + 3 + ] + }, + { + // handle label from a labeled array + "required": [ + "eq" + ], + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "process": { + "process_graph": { + "eq": { + "process_id": "eq", + "arguments": { + "x": { + "from_argument": "label" + }, + "y": "B02" + }, + "result": true + } + } + } + }, + "returns": [ + { + "key": "B02", + "value": 0.98 + } + ] + }, + { + // handle index from a labeled array + "required": [ + "eq" + ], + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "process": { + "process_graph": { + "eq": { + "process_id": "eq", + "arguments": { + "x": { + "from_argument": "index" + }, + "y": 0 + }, + "result": true + } + } + } + }, + "returns": [ + { + "key": "B01", + "value": 1.23 + } + ] + }, + { + // single math process applied to a labeled array + "required": [ + "gt" + ], + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "process": { + "process_graph": { + "const": { + "process_id": "subtract", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 1 + }, + "result": true + } + } + } + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + } + ] + } + }, + { + // apply multiple math process to a labeled array + "required": [ + "lt", + "gt", + "or" + ], + "arguments": { + "data": [ + 1, + -2, + 3.5, + -4.725, + NaN + ], + "process": { + "process_graph": { + "lt": { + "process_id": "lt", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": -2 + } + }, + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 2 + } + }, + "or": { + "process_id": "or", + "arguments": { + "x": { + "from_node": "lt" + }, + "y": { + "from_node": "gt" + } + }, + "result": true + } + } + } + }, + "returns": [ + 3.5, + -4.725 + ] + } + ] +} diff --git a/tests/cosh.json5 b/tests/cosh.json5 index e79a5239..98bb031d 100644 --- a/tests/cosh.json5 +++ b/tests/cosh.json5 @@ -41,7 +41,7 @@ "arguments": { "x": -Infinity }, - "returns": NaN + "returns": Infinity }, { "arguments": { @@ -56,4 +56,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/divide.json5 b/tests/divide.json5 index 95387a21..6f453702 100644 --- a/tests/divide.json5 +++ b/tests/divide.json5 @@ -57,7 +57,8 @@ "x": 0, "y": 0 }, - "returns": NaN + "returns": NaN, + "throws": "DivisionByZero" }, { "arguments": { @@ -95,4 +96,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/log.json5 b/tests/log.json5 index e0413c18..e3bb242d 100644 --- a/tests/log.json5 +++ b/tests/log.json5 @@ -21,7 +21,7 @@ "x": 0.5, "base": 10 }, - "returns": -0.69314718056 + "returns": -0.30102999566 }, { "arguments": { @@ -35,7 +35,7 @@ "x": 2.71828182846, "base": 10 }, - "returns": 0.99999999999 + "returns": 0.43429448190 }, { "arguments": { diff --git a/tests/sinh.json5 b/tests/sinh.json5 index be320317..3ef0280f 100644 --- a/tests/sinh.json5 +++ b/tests/sinh.json5 @@ -41,7 +41,7 @@ "arguments": { "x": -Infinity }, - "returns": NaN + "returns": -Infinity }, { "arguments": { @@ -56,4 +56,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/subtract.json5 b/tests/subtract.json5 index a20d7bc6..79317e42 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -83,7 +83,7 @@ "x": 1, "y": -Infinity }, - "returns": -Infinity + "returns": Infinity }, { "arguments": { @@ -104,7 +104,7 @@ "x": Infinity, "y": Infinity }, - "returns": Infinity + "returns": NaN }, { "arguments": { From 7bddb4363a2f91bcaef7b6a3d07b92edd7085ddb Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Mon, 11 Dec 2023 22:35:20 +0100 Subject: [PATCH 19/39] update readme --- tests/README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/README.md b/tests/README.md index 64876811..a294794b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -33,7 +33,7 @@ This folder contains test cases for the openEO processes. - [x] array_find - [x] array_interpolate_linear - [x] array_labels -- [x] array_modify (experimental) - could use some more tests +- [x] array_modify* (experimental) - [x] arsinh - [x] artanh - [x] between @@ -43,15 +43,15 @@ This folder contains test cases for the openEO processes. - [x] constant - [x] cos - [x] cosh -- [ ] count -- [x] cummax (experimental) - could use some more tests -- [x] cummin (experimental) - could use some more tests -- [x] cumproduct (experimental) - could use some more tests -- [x] cumsum (experimental) - could use some more tests +- [x] count* +- [x] cummax* (experimental) +- [x] cummin* (experimental) +- [x] cumproduct* (experimental) +- [x] cumsum* (experimental) - [ ] create_data_cube -- [ ] date_between (experimental) - could use some more tests -- [ ] date_difference (experimental) - could use some more tests -- [ ] date_shift (experimental) - could use some more tests +- [x] date_between* (experimental) +- [x] date_difference* (experimental) +- [x] date_shift* (experimental) - [ ] dimension_labels - [x] divide - [ ] drop_dimension @@ -92,12 +92,12 @@ This folder contains test cases for the openEO processes. - [x] normalized_difference - [x] not - [x] or -- [ ] order +- [x] order* - [x] pi - [x] power - [x] product - [x] quantiles -- [ ] rearrange +- [x] rearrange* - [ ] reduce_dimension - [ ] rename_dimension - [ ] rename_labels @@ -109,7 +109,7 @@ This folder contains test cases for the openEO processes. - [x] sgn - [x] sin - [x] sinh -- [ ] sort +- [x] sort* - [x] sqrt - [x] subtract - [x] sum @@ -123,6 +123,8 @@ This folder contains test cases for the openEO processes. - [x] variance - [x] xor +\* = could use some more tests + **Important:** The differentiation of null and NaN is to be discussed and reflected in the tests. See for details. Also, several processes would be affected by . @@ -290,7 +292,7 @@ There are a couple of data types that can't be represented in JSON5 and will be "values": [ "B01", "B02", - "Bo3" + "B03" ] } // ... From fc07d686f8dba8b2f57c06d1b2a8c7e9cca9641e Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 12 Dec 2023 00:59:29 +0100 Subject: [PATCH 20/39] Add first datacube test --- tests/README.md | 68 ++++++++++++++++++++++---------- tests/apply.json5 | 65 +++++++++++++++++++++++++++++- tests/assets/xyt-minimal.json5 | 37 +++++++++++++++++ tests/assets/xytb-s2-small.json5 | 30 ++++++++++++++ 4 files changed, 177 insertions(+), 23 deletions(-) create mode 100644 tests/assets/xyt-minimal.json5 create mode 100644 tests/assets/xytb-s2-small.json5 diff --git a/tests/README.md b/tests/README.md index a294794b..203fc8f7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -253,16 +253,20 @@ properties: const: true ``` +### External references + Arguments and return values can point to external files, e.g. + ```json { - "$ref": "https://host.example/file.nc" + "$ref": "https://host.example/datacube.json" } ``` -There are a couple of data types that can't be represented in JSON5 and will be provided as an object instead. +### Labeled arrays + +Labeled arrays can't be represented in JSON5 and will be provided as an object instead. -**Labeled arrays:** ```json { "type": "labeled-array", @@ -280,29 +284,51 @@ There are a couple of data types that can't be represented in JSON5 and will be } ``` -**Data Cube Metadata:** +### Datacubes + +Datacubes can't be represented in JSON5 and will be provided as an object instead. +Vector datacubes are currently not supported. + ```json { "type": "datacube", - "data": "./assets/example.nc", - "metadata": { - // uses the STAC datacube extension - "bands": { - "type": "bands", - "values": [ - "B01", - "B02", - "B03" - ] + "data": [ + // multi-dimensional array + ], + "nodata": [ + NaN + ], + "dimensions": [ + // similar to the STAC datacube extension + // properties: name, type, axis (if type = spatial), values, and reference_system (optional) + { + "name": "bands", + "type": "bands", + "values": ["blue","green","red","nir"] + }, + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z","2020-06-03T00:00:00Z","2020-06-06T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0,5757485.0,5757475.0,5757465.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0,404845.0,404855.0,404865.0,404875.0], + "reference_system": "EPSG:25832" } - // ... - } + ] } ``` -### Assets - -Additional assets will be provided for the test cases. +### Nodata -- Raster data cubes will be provided as CoverageJSON. -- Multi-dimensional vector data cubes can't be provided right now, we use GeoJSON whenever possible. +todo \ No newline at end of file diff --git a/tests/apply.json5 b/tests/apply.json5 index 612ae8f6..3b3f19f2 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -1,4 +1,65 @@ { "id": "apply", - "tests": [] -} \ No newline at end of file + "tests": [ + { + "required": [ + "add" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal.json5" + }, + "process": { + "process_graph": { + "add": { + "process_id": "add", + "arguments": { + "x": { + "from_parameter": "x" + }, + "y": 1 + } + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [18.5, 54.75, -26.1, -63.25], + [-17.0, 9.45, -2.11, -19.5], + [51.4, 50.24, 26.16, -80.6] + ], + [ + [-62.65, 10.0, -67.52, -7.0], + [2.05, -62.8, 74.05, 52.05], + [49.86, -20.30, NaN, 47.15] + ] + ] + } + } + ] +} diff --git a/tests/assets/xyt-minimal.json5 b/tests/assets/xyt-minimal.json5 new file mode 100644 index 00000000..a8c8adfc --- /dev/null +++ b/tests/assets/xyt-minimal.json5 @@ -0,0 +1,37 @@ +{ + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ] + ] +} diff --git a/tests/assets/xytb-s2-small.json5 b/tests/assets/xytb-s2-small.json5 new file mode 100644 index 00000000..4eec6239 --- /dev/null +++ b/tests/assets/xytb-s2-small.json5 @@ -0,0 +1,30 @@ +{ + "type": "datacube", + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["blue", "green", "red", "nir"] + }, + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0, 5757465.0, 5757455.0, 5757445.0, 5757435.0, 5757425.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0, 404875.0, 404885.0, 404895.0, 404905.0, 404915.0], + "reference_system": "EPSG:25832" + } + ], + "data": [[[[770.0, 780.0, 838.0, 1037.0, 1087.0, 1124.0, 1197.0, 1182.0, 1014.0], [860.0, 799.0, 778.0, 921.0, 1030.0, 1051.0, 1138.0, 1059.0, 1044.0], [1007.0, 815.0, 775.0, 793.0, 796.0, 795.0, 905.0, 1043.0, 1098.0], [956.0, 898.0, 782.0, 774.0, 774.0, 804.0, 831.0, 995.0, 1023.0], [882.0, 1105.0, 946.0, 760.0, 805.0, 839.0, 870.0, 951.0, 1010.0], [816.0, 964.0, 1132.0, 849.0, 798.0, 835.0, 980.0, 1012.0, 1015.0], [844.0, 864.0, 1079.0, 929.0, 804.0, 817.0, 1004.0, 1074.0, 1144.0], [832.0, 816.0, 893.0, 956.0, 807.0, 793.0, 875.0, 1106.0, 1200.0]], [[2049.0, 2006.0, 1990.0, 2006.0, 2005.0, 2000.0, 2015.0, 2015.0, 2027.0], [2041.0, 2013.0, 1979.0, 1969.0, 1965.0, 1979.0, 2025.0, 2032.0, 2012.0], [2005.0, 2009.0, 1979.0, 1950.0, 1963.0, 1988.0, 2021.0, 2049.0, 2051.0], [1997.0, 1999.0, 1996.0, 1976.0, 2021.0, 2026.0, 2055.0, 2087.0, 2088.0], [1970.0, 1990.0, 2025.0, 2027.0, 2039.0, 2057.0, 2090.0, 2094.0, 2115.0], [1964.0, 1971.0, 2044.0, 2107.0, 2094.0, 2099.0, 2135.0, 2155.0, 2159.0], [1963.0, 1977.0, 2059.0, 2132.0, 2137.0, 2146.0, 2181.0, 2203.0, 2182.0], [1980.0, 2029.0, 2067.0, 2156.0, 2175.0, 2183.0, 2189.0, 2196.0, 2187.0]], [[5465.0, 5864.0, 6180.0, 6379.0, 6360.0, 6253.0, 6205.0, 6092.0, 5834.0], [5736.0, 6040.0, 6264.0, 6261.0, 5995.0, 5545.0, 5389.0, 5386.0, 5362.0], [6038.0, 6265.0, 6324.0, 6016.0, 5738.0, 5521.0, 5135.0, 5033.0, 5271.0], [6145.0, 6245.0, 6098.0, 5732.0, 5519.0, 5519.0, 5318.0, 5147.0, 5228.0], [6038.0, 6009.0, 5828.0, 5558.0, 5466.0, 5475.0, 5387.0, 5290.0, 5325.0], [5941.0, 5853.0, 5749.0, 5564.0, 5459.0, 5419.0, 5371.0, 5397.0, 5483.0], [6133.0, 6008.0, 5841.0, 5643.0, 5475.0, 5368.0, 5388.0, 5503.0, 5623.0], [6117.0, 6058.0, 5913.0, 5668.0, 5476.0, 5480.0, 5644.0, 5799.0, 5815.0]], [[7200.0, 7226.0, 7254.0, 7246.0, 7317.0, 7301.0, 7279.0, 7274.0, 7232.0], [7258.0, 7253.0, 7294.0, 7303.0, 7281.0, 7292.0, 7320.0, 7246.0, 7258.0], [7227.0, 7228.0, 7319.0, 7288.0, 7258.0, 7270.0, 7282.0, 7253.0, 7285.0], [7199.0, 7212.0, 7227.0, 7206.0, 7194.0, 7154.0, 7185.0, 7166.0, 7191.0], [7115.0, 7170.0, 7170.0, 7128.0, 7115.0, 7085.0, 7013.0, 7027.0, 6978.0], [6976.0, 7094.0, 7109.0, 7097.0, 7080.0, 7002.0, 6936.0, 6909.0, 6806.0], [6944.0, 7036.0, 7025.0, 7033.0, 7036.0, 6967.0, 6905.0, 6821.0, 6726.0], [6994.0, 6988.0, 6988.0, 6923.0, 6923.0, 6926.0, 6907.0, 6836.0, 6702.0]], [[1787.0, 1764.0, 1717.0, 1714.0, 1785.0, 1908.0, 1998.0, 2100.0, 2609.0], [1798.0, 1602.0, 1560.0, 1561.0, 1690.0, 1840.0, 1930.0, 2128.0, 2702.0], [1697.0, 1560.0, 1484.0, 1523.0, 1646.0, 1757.0, 1789.0, 2045.0, 2553.0], [1440.0, 1509.0, 1504.0, 1615.0, 1655.0, 1698.0, 1730.0, 1998.0, 2444.0], [1287.0, 1428.0, 1596.0, 1645.0, 1576.0, 1587.0, 1761.0, 2310.0, 2563.0], [1310.0, 1376.0, 1586.0, 1594.0, 1516.0, 1414.0, 1719.0, 2359.0, 2543.0], [1371.0, 1439.0, 1505.0, 1435.0, 1335.0, 1305.0, 1827.0, 2532.0, 2633.0], [1324.0, 1459.0, 1385.0, 1285.0, 1176.0, 1264.0, 1809.0, 2724.0, 2918.0]], [[964.0, 961.0, 977.0, 1083.0, 1250.0, 1207.0, 1302.0, 1278.0, 1162.0], [1099.0, 1052.0, 961.0, 1006.0, 1114.0, 1102.0, 1227.0, 1185.0, 1275.0], [1129.0, 1085.0, 937.0, 962.0, 958.0, 950.0, 1054.0, 1202.0, 1235.0], [993.0, 1116.0, 1020.0, 977.0, 969.0, 983.0, 1012.0, 1104.0, 1179.0], [983.0, 1106.0, 1215.0, 980.0, 983.0, 1006.0, 1049.0, 1126.0, 1186.0], [979.0, 998.0, 1188.0, 1128.0, 967.0, 986.0, 1090.0, 1187.0, 1177.0], [994.0, 974.0, 1064.0, 1170.0, 1003.0, 965.0, 1064.0, 1191.0, 1261.0], [956.0, 959.0, 989.0, 1083.0, 1033.0, 981.0, 980.0, 1118.0, 1246.0]]], [[[620.0, 687.0, 774.0, 971.0, 983.0, 1030.0, 1071.0, 1023.0, 985.0], [817.0, 677.0, 687.0, 806.0, 886.0, 850.0, 962.0, 935.0, 924.0], [958.0, 705.0, 650.0, 636.0, 627.0, 591.0, 795.0, 885.0, 906.0], [791.0, 929.0, 736.0, 659.0, 635.0, 675.0, 797.0, 837.0, 835.0], [758.0, 1101.0, 877.0, 686.0, 704.0, 823.0, 915.0, 830.0, 808.0], [689.0, 956.0, 1064.0, 710.0, 739.0, 773.0, 898.0, 937.0, 840.0], [753.0, 807.0, 1065.0, 921.0, 709.0, 687.0, 895.0, 1049.0, 954.0], [697.0, 703.0, 814.0, 911.0, 716.0, 696.0, 749.0, 1007.0, 1070.0]], [[1979.0, 1940.0, 1900.0, 1905.0, 1914.0, 1900.0, 1891.0, 1903.0, 1906.0], [1900.0, 1833.0, 1772.0, 1778.0, 1801.0, 1816.0, 1834.0, 1836.0, 1876.0], [1847.0, 1800.0, 1763.0, 1772.0, 1764.0, 1765.0, 1811.0, 1839.0, 1848.0], [1819.0, 1813.0, 1793.0, 1742.0, 1748.0, 1765.0, 1791.0, 1814.0, 1810.0], [1793.0, 1809.0, 1800.0, 1745.0, 1755.0, 1788.0, 1792.0, 1764.0, 1790.0], [1798.0, 1767.0, 1773.0, 1772.0, 1756.0, 1789.0, 1799.0, 1768.0, 1765.0], [1780.0, 1761.0, 1804.0, 1815.0, 1797.0, 1822.0, 1826.0, 1821.0, 1802.0], [1766.0, 1809.0, 1838.0, 1852.0, 1848.0, 1863.0, 1874.0, 1864.0, 1836.0]], [[5573.0, 5880.0, 6129.0, 6301.0, 6300.0, 6244.0, 6295.0, 6313.0, 6303.0], [5619.0, 5899.0, 6097.0, 6162.0, 6154.0, 6128.0, 6053.0, 5872.0, 5898.0], [5673.0, 5945.0, 6069.0, 5847.0, 5532.0, 5515.0, 5408.0, 5229.0, 5216.0], [5882.0, 6026.0, 5857.0, 5499.0, 5058.0, 4818.0, 4802.0, 5005.0, 5011.0], [6008.0, 5919.0, 5500.0, 5321.0, 5173.0, 4918.0, 4792.0, 4987.0, 5016.0], [5809.0, 5635.0, 5313.0, 5206.0, 5181.0, 4998.0, 4925.0, 4943.0, 5052.0], [5557.0, 5435.0, 5231.0, 5168.0, 5154.0, 5020.0, 5025.0, 5077.0, 5176.0], [5514.0, 5427.0, 5291.0, 5196.0, 5100.0, 5011.0, 5130.0, 5221.0, 5352.0]], [[6820.0, 6828.0, 6823.0, 6802.0, 6809.0, 6799.0, 6767.0, 6719.0, 6707.0], [6765.0, 6812.0, 6831.0, 6844.0, 6853.0, 6837.0, 6820.0, 6771.0, 6726.0], [6835.0, 6845.0, 6859.0, 6871.0, 6876.0, 6867.0, 6839.0, 6778.0, 6756.0], [6883.0, 6871.0, 6874.0, 6865.0, 6855.0, 6859.0, 6865.0, 6810.0, 6826.0], [6813.0, 6841.0, 6862.0, 6851.0, 6799.0, 6800.0, 6821.0, 6785.0, 6747.0], [6809.0, 6829.0, 6770.0, 6763.0, 6735.0, 6704.0, 6687.0, 6660.0, 6651.0], [6686.0, 6752.0, 6735.0, 6726.0, 6681.0, 6584.0, 6551.0, 6515.0, 6485.0], [6571.0, 6670.0, 6691.0, 6669.0, 6621.0, 6505.0, 6505.0, 6422.0, 6356.0]], [[1644.0, 1672.0, 1653.0, 1703.0, 1729.0, 1795.0, 1793.0, 1843.0, 2309.0], [1702.0, 1547.0, 1469.0, 1435.0, 1508.0, 1638.0, 1746.0, 1944.0, 2458.0], [1667.0, 1484.0, 1353.0, 1329.0, 1466.0, 1576.0, 1645.0, 1839.0, 2423.0], [1431.0, 1419.0, 1366.0, 1416.0, 1471.0, 1511.0, 1562.0, 1774.0, 2349.0], [1203.0, 1307.0, 1476.0, 1493.0, 1433.0, 1446.0, 1597.0, 1955.0, 2346.0], [1184.0, 1248.0, 1484.0, 1481.0, 1369.0, 1321.0, 1526.0, 2136.0, 2468.0], [1215.0, 1286.0, 1405.0, 1368.0, 1229.0, 1197.0, 1507.0, 2294.0, 2460.0], [1219.0, 1329.0, 1307.0, 1186.0, 1080.0, 1090.0, 1571.0, 2488.0, 2620.0]], [[821.0, 833.0, 857.0, 997.0, 1091.0, 1079.0, 1120.0, 1113.0, 1097.0], [987.0, 909.0, 821.0, 847.0, 935.0, 927.0, 1025.0, 1083.0, 1105.0], [1032.0, 991.0, 798.0, 796.0, 765.0, 765.0, 851.0, 1031.0, 1028.0], [871.0, 1077.0, 969.0, 799.0, 819.0, 907.0, 935.0, 978.0, 921.0], [846.0, 1028.0, 1091.0, 880.0, 853.0, 927.0, 1000.0, 967.0, 928.0], [807.0, 888.0, 1138.0, 1015.0, 862.0, 872.0, 967.0, 1027.0, 961.0], [874.0, 817.0, 1012.0, 1074.0, 877.0, 829.0, 892.0, 1097.0, 1105.0], [841.0, 798.0, 874.0, 966.0, 953.0, 843.0, 847.0, 1004.0, 1120.0]]], [[[384.0, 378.0, 455.0, 789.0, 911.0, 943.0, 974.0, 975.0, 850.0], [512.0, 413.0, 380.0, 560.0, 726.0, 714.0, 877.0, 852.0, 772.0], [781.0, 452.0, 356.0, 407.0, 452.0, 439.0, 568.0, 750.0, 802.0], [621.0, 686.0, 452.0, 398.0, 402.0, 400.0, 487.0, 699.0, 721.0], [517.0, 876.0, 655.0, 380.0, 414.0, 445.0, 529.0, 680.0, 688.0], [448.0, 769.0, 924.0, 490.0, 386.0, 469.0, 706.0, 819.0, 730.0], [455.0, 469.0, 889.0, 691.0, 403.0, 441.0, 738.0, 971.0, 927.0], [429.0, 413.0, 569.0, 663.0, 427.0, 406.0, 553.0, 957.0, 1039.0]], [[2022.0, 2013.0, 1994.0, 1947.0, 1890.0, 1848.0, 1828.0, 1826.0, 1813.0], [1998.0, 1980.0, 1947.0, 1916.0, 1877.0, 1838.0, 1814.0, 1819.0, 1819.0], [1933.0, 1897.0, 1886.0, 1867.0, 1822.0, 1788.0, 1791.0, 1812.0, 1834.0], [1824.0, 1803.0, 1803.0, 1781.0, 1748.0, 1736.0, 1771.0, 1799.0, 1807.0], [1693.0, 1690.0, 1742.0, 1707.0, 1686.0, 1683.0, 1717.0, 1771.0, 1777.0], [1681.0, 1674.0, 1703.0, 1670.0, 1654.0, 1676.0, 1690.0, 1759.0, 1776.0], [1665.0, 1642.0, 1677.0, 1692.0, 1645.0, 1643.0, 1672.0, 1731.0, 1774.0], [1651.0, 1646.0, 1637.0, 1668.0, 1660.0, 1631.0, 1643.0, 1683.0, 1754.0]], [[6446.0, 6649.0, 6776.0, 6921.0, 7022.0, 7121.0, 7217.0, 7214.0, 7195.0], [6381.0, 6639.0, 6834.0, 6845.0, 6790.0, 6874.0, 6936.0, 6876.0, 6869.0], [6374.0, 6639.0, 6708.0, 6706.0, 6719.0, 6627.0, 6561.0, 6573.0, 6555.0], [6392.0, 6543.0, 6400.0, 6178.0, 6112.0, 5961.0, 5751.0, 5711.0, 5812.0], [6442.0, 6360.0, 5966.0, 5448.0, 5243.0, 5261.0, 5322.0, 5314.0, 5245.0], [6406.0, 6037.0, 5704.0, 5446.0, 5119.0, 5051.0, 5286.0, 5335.0, 5180.0], [6068.0, 5691.0, 5545.0, 5488.0, 5273.0, 5159.0, 5261.0, 5318.0, 5294.0], [5802.0, 5541.0, 5457.0, 5450.0, 5305.0, 5297.0, 5326.0, 5452.0, 5570.0]], [[7168.0, 7178.0, 7176.0, 7125.0, 7102.0, 7102.0, 7058.0, 7047.0, 7050.0], [7162.0, 7168.0, 7148.0, 7113.0, 7099.0, 7116.0, 7092.0, 7031.0, 7014.0], [7136.0, 7135.0, 7127.0, 7176.0, 7158.0, 7156.0, 7119.0, 7047.0, 7048.0], [7169.0, 7189.0, 7186.0, 7189.0, 7174.0, 7208.0, 7173.0, 7118.0, 7064.0], [7208.0, 7233.0, 7248.0, 7212.0, 7206.0, 7219.0, 7183.0, 7155.0, 7083.0], [7176.0, 7181.0, 7223.0, 7228.0, 7190.0, 7177.0, 7167.0, 7152.0, 7098.0], [7174.0, 7207.0, 7198.0, 7141.0, 7118.0, 7095.0, 7065.0, 7052.0, 6986.0], [7117.0, 7128.0, 7116.0, 7066.0, 7000.0, 6950.0, 6941.0, 6885.0, 6820.0]], [[1563.0, 1631.0, 1629.0, 1759.0, 1888.0, 1824.0, 1704.0, 1735.0, 2190.0], [1621.0, 1490.0, 1404.0, 1336.0, 1417.0, 1541.0, 1647.0, 1791.0, 2374.0], [1580.0, 1332.0, 1201.0, 1205.0, 1313.0, 1464.0, 1555.0, 1742.0, 2490.0], [1287.0, 1282.0, 1177.0, 1208.0, 1289.0, 1378.0, 1423.0, 1699.0, 2363.0], [993.0, 1200.0, 1277.0, 1279.0, 1309.0, 1317.0, 1379.0, 1741.0, 2291.0], [874.0, 1047.0, 1333.0, 1301.0, 1230.0, 1186.0, 1374.0, 2044.0, 2398.0], [952.0, 1005.0, 1258.0, 1211.0, 1041.0, 967.0, 1342.0, 2194.0, 2399.0], [950.0, 1057.0, 1127.0, 999.0, 835.0, 817.0, 1400.0, 2354.0, 2531.0]], [[503.0, 510.0, 550.0, 727.0, 948.0, 960.0, 1034.0, 1016.0, 934.0], [735.0, 674.0, 490.0, 573.0, 726.0, 698.0, 851.0, 930.0, 981.0], [740.0, 690.0, 502.0, 523.0, 513.0, 516.0, 643.0, 875.0, 898.0], [587.0, 787.0, 667.0, 536.0, 502.0, 507.0, 590.0, 724.0, 800.0], [540.0, 829.0, 940.0, 558.0, 521.0, 541.0, 680.0, 798.0, 813.0], [512.0, 628.0, 907.0, 783.0, 530.0, 553.0, 724.0, 903.0, 840.0], [528.0, 533.0, 698.0, 861.0, 639.0, 520.0, 679.0, 968.0, 1001.0], [519.0, 516.0, 540.0, 703.0, 630.0, 524.0, 558.0, 816.0, 999.0]]], [[[2811.0, 3581.0, 3633.0, 2705.0, 2019.0, 1872.0, 1629.0, 1588.0, 2416.0], [3713.0, 3539.0, 3377.0, 2523.0, 1632.0, 1478.0, 1443.0, 1875.0, 1823.0], [3276.0, 3569.0, 3249.0, 2458.0, 1504.0, 1206.0, 1287.0, 1471.0, 1147.0], [3193.0, 3955.0, 3440.0, 3145.0, 2475.0, 2488.0, 2451.0, 1620.0, 1001.0], [2191.0, 3473.0, 3411.0, 3577.0, 3529.0, 3481.0, 3447.0, 1894.0, 1009.0], [1323.0, 2638.0, 3324.0, 3763.0, 3841.0, 3121.0, 2606.0, 1833.0, 1058.0], [1687.0, 2001.0, 3160.0, 3933.0, 3937.0, 3285.0, 2383.0, 2352.0, 1648.0], [2015.0, 1318.0, 2582.0, 3281.0, 3511.0, 3432.0, 2620.0, 2382.0, 2100.0]], [[3074.0, 3067.0, 3034.0, 2868.0, 2787.0, 2729.0, 2676.0, 2704.0, 2759.0], [3032.0, 3045.0, 2984.0, 2908.0, 2782.0, 2691.0, 2662.0, 2680.0, 2703.0], [2956.0, 3035.0, 2994.0, 2955.0, 2808.0, 2771.0, 2785.0, 2660.0, 2553.0], [2860.0, 2985.0, 2967.0, 2978.0, 2932.0, 2947.0, 2970.0, 2746.0, 2526.0], [2712.0, 2831.0, 2918.0, 3021.0, 3050.0, 3033.0, 3013.0, 2777.0, 2585.0], [2723.0, 2767.0, 2971.0, 3099.0, 3110.0, 3017.0, 2928.0, 2828.0, 2708.0], [2883.0, 2685.0, 2935.0, 3073.0, 3119.0, 3113.0, 3040.0, 2950.0, 2837.0], [2943.0, 2786.0, 2911.0, 3046.0, 3102.0, 3173.0, 3112.0, 3038.0, 2944.0]], [[6470.0, 6929.0, 7344.0, 7451.0, 7567.0, 7565.0, 7595.0, 7504.0, 7452.0], [6567.0, 6995.0, 7336.0, 7338.0, 7169.0, 7027.0, 6983.0, 6812.0, 6587.0], [6839.0, 7139.0, 7222.0, 7022.0, 6554.0, 6165.0, 6084.0, 6126.0, 6195.0], [7090.0, 7208.0, 7034.0, 6701.0, 6425.0, 6119.0, 5872.0, 5943.0, 6125.0], [7016.0, 6994.0, 6733.0, 6360.0, 6282.0, 6212.0, 5950.0, 5894.0, 6025.0], [6769.0, 6684.0, 6448.0, 6194.0, 6200.0, 6145.0, 5975.0, 6006.0, 6088.0], [6698.0, 6575.0, 6414.0, 6237.0, 6177.0, 6061.0, 6036.0, 6143.0, 6179.0], [6909.0, 6700.0, 6464.0, 6248.0, 6130.0, 6056.0, 6086.0, 6228.0, 6338.0]], [[7435.0, 7468.0, 7447.0, 7470.0, 7410.0, 7424.0, 7407.0, 7364.0, 7321.0], [7463.0, 7486.0, 7493.0, 7474.0, 7467.0, 7456.0, 7470.0, 7398.0, 7343.0], [7483.0, 7535.0, 7533.0, 7487.0, 7485.0, 7487.0, 7515.0, 7441.0, 7363.0], [7470.0, 7493.0, 7535.0, 7473.0, 7471.0, 7472.0, 7451.0, 7426.0, 7375.0], [7415.0, 7430.0, 7472.0, 7405.0, 7417.0, 7361.0, 7321.0, 7280.0, 7294.0], [7360.0, 7390.0, 7362.0, 7338.0, 7343.0, 7223.0, 7168.0, 7162.0, 7124.0], [7204.0, 7293.0, 7319.0, 7291.0, 7280.0, 7171.0, 7088.0, 7067.0, 6935.0], [7192.0, 7254.0, 7241.0, 7227.0, 7219.0, 7123.0, 7026.0, 6938.0, 6810.0]], [[3460.0, 3527.0, 3254.0, 2862.0, 2772.0, 2746.0, 2716.0, 2840.0, 3317.0], [3586.0, 3577.0, 3211.0, 2788.0, 2613.0, 2631.0, 2723.0, 2881.0, 3455.0], [3601.0, 3620.0, 3265.0, 2916.0, 2607.0, 2618.0, 2641.0, 2795.0, 3393.0], [3540.0, 3675.0, 3424.0, 3103.0, 2776.0, 2743.0, 2792.0, 2908.0, 3299.0], [2684.0, 3140.0, 3349.0, 3253.0, 2958.0, 2900.0, 2928.0, 3101.0, 3394.0], [2135.0, 2828.0, 3434.0, 3456.0, 3341.0, 3037.0, 2805.0, 3286.0, 3493.0], [2714.0, 2572.0, 3349.0, 3563.0, 3708.0, 3324.0, 3028.0, 3459.0, 3502.0], [2973.0, 2404.0, 3002.0, 3211.0, 3823.0, 3821.0, 3472.0, 3662.0, 3764.0]], [[3436.0, 3488.0, 3577.0, 3151.0, 2241.0, 2058.0, 1645.0, 1562.0, 2067.0], [3624.0, 3787.0, 3280.0, 2592.0, 1917.0, 1577.0, 1408.0, 1799.0, 1795.0], [3096.0, 3680.0, 3402.0, 2851.0, 2079.0, 1787.0, 1753.0, 1523.0, 1226.0], [2661.0, 3689.0, 3683.0, 3481.0, 3170.0, 3283.0, 3128.0, 1934.0, 1161.0], [1605.0, 2656.0, 3303.0, 3755.0, 3861.0, 3747.0, 3401.0, 1993.0, 1152.0], [1477.0, 2018.0, 3058.0, 3842.0, 3970.0, 3166.0, 2343.0, 1908.0, 1342.0], [2413.0, 1424.0, 2631.0, 3646.0, 3820.0, 3413.0, 2653.0, 2211.0, 1808.0], [2581.0, 1579.0, 1912.0, 2861.0, 3406.0, 3499.0, 2904.0, 2388.0, 2066.0]]]] +} From c1927e39f4408bb286fd2a7a0eaee61ae70ad959 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 12 Dec 2023 01:05:30 +0100 Subject: [PATCH 21/39] Fix apply test --- tests/apply.json5 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/apply.json5 b/tests/apply.json5 index 3b3f19f2..8bfd2d18 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -18,7 +18,8 @@ "from_parameter": "x" }, "y": 1 - } + }, + "result": true } } } From 6514eb2df3c2f159484c8b20c419878f7c8e8bad Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 12 Dec 2023 15:20:46 +0100 Subject: [PATCH 22/39] Add profile levels --- tests/README.md | 50 ++++++++++++++++----------- tests/absolute.json5 | 3 +- tests/add.json5 | 3 +- tests/add_dimension.json5 | 3 +- tests/aggregate_spatial.json5 | 3 +- tests/aggregate_spatial_window.json5 | 5 +++ tests/aggregate_temporal.json5 | 3 +- tests/aggregate_temporal_period.json5 | 3 +- tests/all.json5 | 3 +- tests/and.json5 | 3 +- tests/anomaly.json5 | 3 +- tests/any.json5 | 3 +- tests/apply.json5 | 1 + tests/apply_dimension.json5 | 3 +- tests/apply_kernel.json5 | 3 +- tests/apply_neighborhood.json5 | 3 +- tests/apply_polygon.json5 | 5 +++ tests/arccos.json5 | 3 +- tests/arcosh.json5 | 1 + tests/arcsin.json5 | 3 +- tests/arctan.json5 | 3 +- tests/arctan2.json5 | 3 +- tests/array_append.json5 | 1 + tests/array_apply.json5 | 1 + tests/array_concat.json5 | 5 ++- tests/array_contains.json5 | 3 +- tests/array_create.json5 | 3 +- tests/array_create_labeled.json5 | 5 +++ tests/array_element.json5 | 7 +++- tests/array_filter.json5 | 1 + tests/array_find.json5 | 3 +- tests/array_find_label.json5 | 5 +++ tests/array_interpolate_linear.json5 | 3 +- tests/array_labels.json5 | 3 +- tests/array_modify.json5 | 3 +- tests/arsinh.json5 | 3 +- tests/artanh.json5 | 3 +- tests/between.json5 | 3 +- tests/ceil.json5 | 3 +- tests/climatological_normal.json5 | 3 +- tests/clip.json5 | 3 +- tests/cloud_detection.json5 | 5 +++ tests/constant.json5 | 3 +- tests/cos.json5 | 3 +- tests/cosh.json5 | 1 + tests/count.json5 | 33 +++++++++++++++++- tests/create_data_cube.json5 | 3 +- tests/cummax.json5 | 3 +- tests/cummin.json5 | 3 +- tests/cumproduct.json5 | 3 +- tests/cumsum.json5 | 3 +- tests/date_between.json5 | 3 +- tests/date_difference.json5 | 3 +- tests/date_shift.json5 | 3 +- tests/dimension_labels.json5 | 3 +- tests/divide.json5 | 1 + tests/drop_dimension.json5 | 3 +- tests/e.json5 | 3 +- tests/eq.json5 | 1 + tests/exp.json5 | 1 + tests/extrema.json5 | 1 + tests/filter_bands.json5 | 3 +- tests/filter_bbox.json5 | 3 +- tests/filter_labels.json5 | 5 +++ tests/filter_spatial.json5 | 3 +- tests/filter_temporal.json5 | 3 +- tests/filter_vector.json5 | 5 +++ tests/first.json5 | 1 + tests/flatten_dimensions.json5 | 5 +++ tests/floor.json5 | 3 +- tests/gt.json5 | 1 + tests/gte.json5 | 1 + tests/if.json5 | 3 +- tests/inspect.json5 | 5 +++ tests/int.json5 | 3 +- tests/is_infinite.json5 | 3 +- tests/is_nan.json5 | 3 +- tests/is_nodata.json5 | 3 +- tests/is_valid.json5 | 3 +- tests/last.json5 | 3 +- tests/linear_scale_range.json5 | 1 + tests/ln.json5 | 3 +- tests/load_collection.json5 | 5 +++ tests/load_geojson.json5 | 5 +++ tests/load_stac.json5 | 5 +++ tests/load_url.json5 | 5 +++ tests/log.json5 | 1 + tests/lt.json5 | 1 + tests/lte.json5 | 1 + tests/mask.json5 | 3 +- tests/mask_polygon.json5 | 3 +- tests/max.json5 | 1 + tests/mean.json5 | 1 + tests/median.json5 | 1 + tests/merge_cubes.json5 | 3 +- tests/min.json5 | 3 +- tests/mod.json5 | 3 +- tests/multiply.json5 | 3 +- tests/nan.json5 | 3 +- tests/ndvi.json5 | 3 +- tests/neq.json5 | 1 + tests/normalized_difference.json5 | 3 +- tests/not.json5 | 3 +- tests/or.json5 | 3 +- tests/order.json5 | 3 +- tests/pi.json5 | 3 +- tests/power.json5 | 1 + tests/product.json5 | 1 + tests/quantiles.json5 | 5 +-- tests/rearrange.json5 | 1 + tests/reduce_dimension.json5 | 3 +- tests/reduce_spatial.json5 | 5 +++ tests/rename_dimension.json5 | 3 +- tests/rename_labels.json5 | 1 + tests/resample_cube_spatial.json5 | 3 +- tests/resample_cube_temporal.json5 | 3 +- tests/resample_spatial.json5 | 3 +- tests/round.json5 | 3 +- tests/save_result.json5 | 5 +++ tests/sd.json5 | 3 +- tests/sgn.json5 | 3 +- tests/sin.json5 | 3 +- tests/sinh.json5 | 1 + tests/sort.json5 | 3 +- tests/sqrt.json5 | 3 +- tests/subtract.json5 | 1 + tests/sum.json5 | 1 + tests/tan.json5 | 1 + tests/tanh.json5 | 3 +- tests/text_begins.json5 | 3 +- tests/text_concat.json5 | 3 +- tests/text_contains.json5 | 3 +- tests/text_ends.json5 | 3 +- tests/trim_cube.json5 | 3 +- tests/unflatten_dimensions.json5 | 5 +++ tests/variance.json5 | 3 +- tests/vector_buffer.json5 | 5 +++ tests/vector_reproject.json5 | 5 +++ tests/vector_to_random_points.json5 | 5 +++ tests/vector_to_regular_points.json5 | 5 +++ tests/xor.json5 | 3 +- 141 files changed, 377 insertions(+), 113 deletions(-) create mode 100644 tests/aggregate_spatial_window.json5 create mode 100644 tests/apply_polygon.json5 create mode 100644 tests/array_create_labeled.json5 create mode 100644 tests/array_find_label.json5 create mode 100644 tests/cloud_detection.json5 create mode 100644 tests/filter_labels.json5 create mode 100644 tests/filter_vector.json5 create mode 100644 tests/flatten_dimensions.json5 create mode 100644 tests/inspect.json5 create mode 100644 tests/load_collection.json5 create mode 100644 tests/load_geojson.json5 create mode 100644 tests/load_stac.json5 create mode 100644 tests/load_url.json5 create mode 100644 tests/reduce_spatial.json5 create mode 100644 tests/save_result.json5 create mode 100644 tests/unflatten_dimensions.json5 create mode 100644 tests/vector_buffer.json5 create mode 100644 tests/vector_reproject.json5 create mode 100644 tests/vector_to_random_points.json5 create mode 100644 tests/vector_to_regular_points.json5 diff --git a/tests/README.md b/tests/README.md index 203fc8f7..e8cab80b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -8,6 +8,7 @@ This folder contains test cases for the openEO processes. - [x] add - [ ] add_dimension - [ ] aggregate_spatial +- [ ] aggregate_spatial_window (experimental) - [ ] aggregate_temporal - [ ] aggregate_temporal_period - [x] all @@ -18,6 +19,7 @@ This folder contains test cases for the openEO processes. - [ ] apply_dimension - [ ] apply_kernel - [ ] apply_neighborhood +- [ ] apply_polygon (experimental) - [x] arccos - [x] arcosh - [x] arcsin @@ -28,9 +30,11 @@ This folder contains test cases for the openEO processes. - [x] array_concat - [x] array_contains - [x] array_create +- [ ] array_create_labeled (experimental) - [x] array_element - [x] array_filter - [x] array_find +- [ ] array_find_label (experimental) - [x] array_interpolate_linear - [x] array_labels - [x] array_modify* (experimental) @@ -61,9 +65,12 @@ This folder contains test cases for the openEO processes. - [x] extrema - [ ] filter_bands - [ ] filter_bbox +- [ ] filter_labels (experimental) - [ ] filter_spatial - [ ] filter_temporal +- [ ] filter_vector (experimental) - [x] first +- [ ] flatten_dimensions (experimental) - [x] floor - [x] gt - [x] gte @@ -71,9 +78,11 @@ This folder contains test cases for the openEO processes. - [x] int - [x] is_infinite (experimental) - [x] is_nan +- [x] is_nodata* - [x] last - [x] linear_scale_range - [x] ln +- [ ] load_geojson (experimental) - [x] log - [x] lt - [x] lte @@ -99,6 +108,7 @@ This folder contains test cases for the openEO processes. - [x] quantiles - [x] rearrange* - [ ] reduce_dimension +- [ ] reduce_spatial (experimental) - [ ] rename_dimension - [ ] rename_labels - [ ] resample_cube_spatial @@ -120,7 +130,11 @@ This folder contains test cases for the openEO processes. - [x] text_contains - [x] text_ends - [ ] trim_cube +- [ ] unflatten_dimension (experimental) - [x] variance +- [ ] vector_buffer (experimental) +- [ ] vector_reproject (experimental) +- [ ] vector_to_regular_points (experimental) - [x] xor \* = could use some more tests @@ -129,10 +143,6 @@ This folder contains test cases for the openEO processes. See for details. Also, several processes would be affected by . -## Incomplete processes - -- [x] is_nodata - actual no-data values depends on context / metadata - ## Missing processes The following processes have no test cases as the results heavily depend on the underlying implementation @@ -148,6 +158,7 @@ We don't expect that we can provide meaningful test cases for these processes. - load_collection - load_stac (experimental) - load_uploaded_files (experimental) +- load_url (experimental) - predict_curve (experimental) - run_udf - run_udf_externally (experimental) @@ -155,23 +166,6 @@ We don't expect that we can provide meaningful test cases for these processes. - save_result - vector_to_random_points (experimental) -The following processes are in proposal state (i.e. experimental) and may be added later: - -- aggregate_spatial_window (experimental) -- apply_polygon (experimental) -- array_create_labeled (experimental) -- array_find_label (experimental) -- filter_labels (experimental) -- filter_vector (experimental) -- flatten_dimensions (experimental) -- load_geojson (experimental) -- load_url (experimental) -- reduce_spatial (experimental) -- unflatten_dimension (experimental) -- vector_buffer (experimental) -- vector_reproject (experimental) -- vector_to_regular_points (experimental) - ## Assumptions The test cases assume a couple of things as they are an abstraction and not bound to specific implementations: @@ -203,6 +197,11 @@ properties: type: boolean description: Declares that the process is experimental, tests may fail. default: false + level: + type: string + description: openEO process profile the process is assigned to. + default: L4 + pattern: 'L\d([\w-])?' tests: description: A list of test cases without a specific order type: array @@ -251,6 +250,15 @@ properties: - description: Use true if the type of exception is unknown type: boolean const: true + level: + type: + - string + - null + description: >- + openEO process profile the test is assigned to. + Defaults to the level of the process. + default: null + pattern: 'L\d([\w-])?' ``` ### External references diff --git a/tests/absolute.json5 b/tests/absolute.json5 index bb038b43..8d5fbd00 100644 --- a/tests/absolute.json5 +++ b/tests/absolute.json5 @@ -1,5 +1,6 @@ { "id": "absolute", + "level": "L1", "tests": [ { "arguments": { @@ -56,4 +57,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/add.json5 b/tests/add.json5 index 60618917..14183223 100644 --- a/tests/add.json5 +++ b/tests/add.json5 @@ -1,5 +1,6 @@ { "id": "add", + "level": "L1", "tests": [ { "arguments": { @@ -156,4 +157,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/add_dimension.json5 b/tests/add_dimension.json5 index 6cbfd3cf..1be0c876 100644 --- a/tests/add_dimension.json5 +++ b/tests/add_dimension.json5 @@ -1,4 +1,5 @@ { "id": "add_dimension", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/aggregate_spatial.json5 b/tests/aggregate_spatial.json5 index 5031b473..ff65d6c6 100644 --- a/tests/aggregate_spatial.json5 +++ b/tests/aggregate_spatial.json5 @@ -1,4 +1,5 @@ { "id": "aggregate_spatial", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/aggregate_spatial_window.json5 b/tests/aggregate_spatial_window.json5 new file mode 100644 index 00000000..c9541a63 --- /dev/null +++ b/tests/aggregate_spatial_window.json5 @@ -0,0 +1,5 @@ +{ + "id": "aggregate_spatial_window", + "level": "L3", + "tests": [] +} diff --git a/tests/aggregate_temporal.json5 b/tests/aggregate_temporal.json5 index 1a53fa0d..2e5dfdb0 100644 --- a/tests/aggregate_temporal.json5 +++ b/tests/aggregate_temporal.json5 @@ -1,5 +1,6 @@ { "id": "aggregate_temporal", + "level": "L2", "tests": [ { "arguments": { @@ -51,4 +52,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tests/aggregate_temporal_period.json5 b/tests/aggregate_temporal_period.json5 index 6e1876cd..dd3d0233 100644 --- a/tests/aggregate_temporal_period.json5 +++ b/tests/aggregate_temporal_period.json5 @@ -1,4 +1,5 @@ { "id": "aggregate_temporal_period", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/all.json5 b/tests/all.json5 index 1e1de101..1160e514 100644 --- a/tests/all.json5 +++ b/tests/all.json5 @@ -1,5 +1,6 @@ { "id": "all", + "level": "L2", "tests": [ { "arguments": { @@ -92,4 +93,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/and.json5 b/tests/and.json5 index 6cc48c9c..ab124af5 100644 --- a/tests/and.json5 +++ b/tests/and.json5 @@ -1,5 +1,6 @@ { "id": "and", + "level": "L1", "tests": [ { "arguments": { @@ -65,4 +66,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/anomaly.json5 b/tests/anomaly.json5 index 4ae47e83..c5ea7eb2 100644 --- a/tests/anomaly.json5 +++ b/tests/anomaly.json5 @@ -1,4 +1,5 @@ { "id": "anomaly", + "level": "L3-Clim", "tests": [] -} \ No newline at end of file +} diff --git a/tests/any.json5 b/tests/any.json5 index f84077e6..7d352b43 100644 --- a/tests/any.json5 +++ b/tests/any.json5 @@ -1,5 +1,6 @@ { "id": "any", + "level": "L2", "tests": [ { "arguments": { @@ -92,4 +93,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/apply.json5 b/tests/apply.json5 index 8bfd2d18..128c3c73 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -1,5 +1,6 @@ { "id": "apply", + "level": "L1", "tests": [ { "required": [ diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 index 32413d2d..1accbe9f 100644 --- a/tests/apply_dimension.json5 +++ b/tests/apply_dimension.json5 @@ -1,4 +1,5 @@ { "id": "apply_dimension", + "level": "L1", "tests": [] -} \ No newline at end of file +} diff --git a/tests/apply_kernel.json5 b/tests/apply_kernel.json5 index 69c22e01..28c3c2ab 100644 --- a/tests/apply_kernel.json5 +++ b/tests/apply_kernel.json5 @@ -1,4 +1,5 @@ { "id": "apply_kernel", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/apply_neighborhood.json5 b/tests/apply_neighborhood.json5 index 862d9af8..b40b12d7 100644 --- a/tests/apply_neighborhood.json5 +++ b/tests/apply_neighborhood.json5 @@ -1,5 +1,6 @@ { "id": "apply_neighborhood", + "level": "L3", "tests": [ { "arguments": { @@ -56,4 +57,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tests/apply_polygon.json5 b/tests/apply_polygon.json5 new file mode 100644 index 00000000..31d84ea9 --- /dev/null +++ b/tests/apply_polygon.json5 @@ -0,0 +1,5 @@ +{ + "id": "apply_polygon", + "level": "L3", + "tests": [] +} diff --git a/tests/arccos.json5 b/tests/arccos.json5 index 8fbd931b..24b4c84c 100644 --- a/tests/arccos.json5 +++ b/tests/arccos.json5 @@ -1,5 +1,6 @@ { "id": "arccos", + "level": "L1", "tests": [ { "arguments": { @@ -68,4 +69,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/arcosh.json5 b/tests/arcosh.json5 index e4966cfe..7c378f9a 100644 --- a/tests/arcosh.json5 +++ b/tests/arcosh.json5 @@ -1,5 +1,6 @@ { "id": "arcosh", + "level": "L2", "tests": [ { "arguments": { diff --git a/tests/arcsin.json5 b/tests/arcsin.json5 index 4e3d3945..0f1a35a6 100644 --- a/tests/arcsin.json5 +++ b/tests/arcsin.json5 @@ -1,5 +1,6 @@ { "id": "arcsin", + "level": "L1", "tests": [ { "arguments": { @@ -68,4 +69,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/arctan.json5 b/tests/arctan.json5 index e7106301..5a948970 100644 --- a/tests/arctan.json5 +++ b/tests/arctan.json5 @@ -1,5 +1,6 @@ { "id": "arctan", + "level": "L1", "tests": [ { "arguments": { @@ -68,4 +69,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/arctan2.json5 b/tests/arctan2.json5 index 0910e9ec..f3930733 100644 --- a/tests/arctan2.json5 +++ b/tests/arctan2.json5 @@ -1,5 +1,6 @@ { "id": "arctan2", + "level": "L2", "tests": [ { "arguments": { @@ -149,4 +150,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/array_append.json5 b/tests/array_append.json5 index 2c693434..c926d5a6 100644 --- a/tests/array_append.json5 +++ b/tests/array_append.json5 @@ -1,5 +1,6 @@ { "id": "array_append", + "level": "L3", "tests": [ { "arguments": { diff --git a/tests/array_apply.json5 b/tests/array_apply.json5 index ca7a501b..827e2189 100644 --- a/tests/array_apply.json5 +++ b/tests/array_apply.json5 @@ -1,5 +1,6 @@ { "id": "array_apply", + "level": "L3", "tests": [ { // empty array diff --git a/tests/array_concat.json5 b/tests/array_concat.json5 index 0e5dfd05..b045b185 100644 --- a/tests/array_concat.json5 +++ b/tests/array_concat.json5 @@ -1,5 +1,6 @@ { "id": "array_concat", + "level": "L1", "tests": [ { // Adds an empty array @@ -65,6 +66,7 @@ }, { // Check that a normal array and a labeled array lead to a normal array (labels get dropped) + "level": "L3", "arguments": { "array1": [ 1, @@ -93,6 +95,7 @@ }, { // Check that a labeled arrays are supported + "level": "L3", "arguments": { "array1": { "type": "labeled-array", @@ -144,4 +147,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tests/array_contains.json5 b/tests/array_contains.json5 index d6efe2cc..d454f019 100644 --- a/tests/array_contains.json5 +++ b/tests/array_contains.json5 @@ -1,5 +1,6 @@ { "id": "array_contains", + "level": "L3", "tests": [ { "arguments": { @@ -82,4 +83,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/array_create.json5 b/tests/array_create.json5 index e5137695..1e29f80e 100644 --- a/tests/array_create.json5 +++ b/tests/array_create.json5 @@ -1,5 +1,6 @@ { "id": "array_create", + "level": "L1", "tests": [ { "arguments": {}, @@ -53,4 +54,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/array_create_labeled.json5 b/tests/array_create_labeled.json5 new file mode 100644 index 00000000..71e62b09 --- /dev/null +++ b/tests/array_create_labeled.json5 @@ -0,0 +1,5 @@ +{ + "id": "array_create_labeled", + "level": "L3", + "tests": [] +} diff --git a/tests/array_element.json5 b/tests/array_element.json5 index d789ffd6..2eab8dfb 100644 --- a/tests/array_element.json5 +++ b/tests/array_element.json5 @@ -1,5 +1,6 @@ { "id": "array_element", + "level": "L1", "tests": [ { "arguments": { @@ -34,6 +35,7 @@ "returns": null }, { + "level": "L2", "arguments": { "data": { "type": "labeled-array", @@ -65,6 +67,7 @@ "throws": "ArrayElementParameterMissing" }, { + "level": "L2", "arguments": { "data": [ 1 @@ -95,6 +98,7 @@ "throws": "ArrayElementNotAvailable" }, { + "level": "L2", "arguments": { "data": { "type": "labeled-array", @@ -129,6 +133,7 @@ "returns": null }, { + "level": "L2", "arguments": { "data": { "type": "labeled-array", @@ -153,4 +158,4 @@ "returns": null }, ] -} \ No newline at end of file +} diff --git a/tests/array_filter.json5 b/tests/array_filter.json5 index 741da53e..46e6d23e 100644 --- a/tests/array_filter.json5 +++ b/tests/array_filter.json5 @@ -1,5 +1,6 @@ { "id": "array_filter", + "level": "L3", "tests": [ { // empty array diff --git a/tests/array_find.json5 b/tests/array_find.json5 index 9dd5f5a4..b522a7c0 100644 --- a/tests/array_find.json5 +++ b/tests/array_find.json5 @@ -1,5 +1,6 @@ { "id": "array_find", + "level": "L2", "tests": [ { "arguments": { @@ -164,4 +165,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/array_find_label.json5 b/tests/array_find_label.json5 new file mode 100644 index 00000000..ba3bc422 --- /dev/null +++ b/tests/array_find_label.json5 @@ -0,0 +1,5 @@ +{ + "id": "array_find_label", + "level": "L3", + "tests": [] +} diff --git a/tests/array_interpolate_linear.json5 b/tests/array_interpolate_linear.json5 index 8647ec60..d8bde973 100644 --- a/tests/array_interpolate_linear.json5 +++ b/tests/array_interpolate_linear.json5 @@ -1,5 +1,6 @@ { "id": "array_interpolate_linear", + "level": "L3", "tests": [ { "arguments": { @@ -170,4 +171,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tests/array_labels.json5 b/tests/array_labels.json5 index 32efce58..e8da177e 100644 --- a/tests/array_labels.json5 +++ b/tests/array_labels.json5 @@ -1,5 +1,6 @@ { "id": "array_labels", + "level": "L3", "tests": [ { "arguments": { @@ -66,4 +67,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/array_modify.json5 b/tests/array_modify.json5 index 0b629320..adf1c579 100644 --- a/tests/array_modify.json5 +++ b/tests/array_modify.json5 @@ -1,5 +1,6 @@ { "id": "array_modify", + "level": "L3", "experimental": true, "tests": [ { @@ -120,4 +121,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/arsinh.json5 b/tests/arsinh.json5 index 984505a2..7b533601 100644 --- a/tests/arsinh.json5 +++ b/tests/arsinh.json5 @@ -1,5 +1,6 @@ { "id": "arsinh", + "level": "L2", "tests": [ { "arguments": { @@ -56,4 +57,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/artanh.json5 b/tests/artanh.json5 index ee48a78f..6d169e91 100644 --- a/tests/artanh.json5 +++ b/tests/artanh.json5 @@ -1,5 +1,6 @@ { "id": "artanh", + "level": "L2", "tests": [ { "arguments": { @@ -68,4 +69,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/between.json5 b/tests/between.json5 index 052d75a4..a2b8042a 100644 --- a/tests/between.json5 +++ b/tests/between.json5 @@ -1,5 +1,6 @@ { "id": "between", + "level": "L1", "tests": [ { "arguments": { @@ -118,4 +119,4 @@ "returns": false }, ] -} \ No newline at end of file +} diff --git a/tests/ceil.json5 b/tests/ceil.json5 index 0f8ff830..fa042206 100644 --- a/tests/ceil.json5 +++ b/tests/ceil.json5 @@ -1,5 +1,6 @@ { "id": "ceil", + "level": "L1", "tests": [ { "arguments": { @@ -62,4 +63,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/climatological_normal.json5 b/tests/climatological_normal.json5 index 4f143c83..c280e27b 100644 --- a/tests/climatological_normal.json5 +++ b/tests/climatological_normal.json5 @@ -1,4 +1,5 @@ { "id": "climatological_normal", + "level": "L3-Clim", "tests": [] -} \ No newline at end of file +} diff --git a/tests/clip.json5 b/tests/clip.json5 index 45194de6..f3a64fe5 100644 --- a/tests/clip.json5 +++ b/tests/clip.json5 @@ -1,5 +1,6 @@ { "id": "clip", + "level": "L1", "tests": [ { "arguments": { @@ -146,4 +147,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/cloud_detection.json5 b/tests/cloud_detection.json5 new file mode 100644 index 00000000..07245ab4 --- /dev/null +++ b/tests/cloud_detection.json5 @@ -0,0 +1,5 @@ +{ + "id": "cloud_detection", + "level": "L3", + "tests": [] +} diff --git a/tests/constant.json5 b/tests/constant.json5 index 8f13adcf..b8644035 100644 --- a/tests/constant.json5 +++ b/tests/constant.json5 @@ -1,5 +1,6 @@ { "id": "constant", + "level": "L1", "tests": [ { "arguments": { @@ -100,4 +101,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tests/cos.json5 b/tests/cos.json5 index 3d9eedfc..c718147e 100644 --- a/tests/cos.json5 +++ b/tests/cos.json5 @@ -1,5 +1,6 @@ { "id": "cos", + "level": "L1", "tests": [ { "arguments": { @@ -50,4 +51,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/cosh.json5 b/tests/cosh.json5 index 98bb031d..74f5e9e1 100644 --- a/tests/cosh.json5 +++ b/tests/cosh.json5 @@ -1,5 +1,6 @@ { "id": "cosh", + "level": "L2", "tests": [ { "arguments": { diff --git a/tests/count.json5 b/tests/count.json5 index 21ce3519..2bc9529c 100644 --- a/tests/count.json5 +++ b/tests/count.json5 @@ -1,5 +1,6 @@ { "id": "count", + "level": "L2", "tests": [ { "arguments": { @@ -62,6 +63,36 @@ } }, "returns": 3 + }, + { + "level": "L3", + "arguments": { + "data": [ + 0, + 1, + 2, + 3, + 4, + 5, + null + ], + "condition": { + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_parameter": "element" + }, + "y": { + "from_parameter": "context" + } + }, + "result": true + } + }, + "context": 2 + }, + "returns": 3 } ] -} \ No newline at end of file +} diff --git a/tests/create_data_cube.json5 b/tests/create_data_cube.json5 index 05829dea..8e35f191 100644 --- a/tests/create_data_cube.json5 +++ b/tests/create_data_cube.json5 @@ -1,4 +1,5 @@ { "id": "create_data_cube", + "level": "L3", "tests": [] -} \ No newline at end of file +} diff --git a/tests/cummax.json5 b/tests/cummax.json5 index 9f9fa3f5..f983f5d4 100644 --- a/tests/cummax.json5 +++ b/tests/cummax.json5 @@ -1,5 +1,6 @@ { "id": "cummax", + "level": "L3", "experimental": true, "tests": [ { @@ -58,4 +59,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/cummin.json5 b/tests/cummin.json5 index 549cd04b..af89506d 100644 --- a/tests/cummin.json5 +++ b/tests/cummin.json5 @@ -1,5 +1,6 @@ { "id": "cummin", + "level": "L3", "experimental": true, "tests": [ { @@ -58,4 +59,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/cumproduct.json5 b/tests/cumproduct.json5 index 4d371b75..835fbc8e 100644 --- a/tests/cumproduct.json5 +++ b/tests/cumproduct.json5 @@ -1,5 +1,6 @@ { "id": "cumproduct", + "level": "L3", "experimental": true, "tests": [ { @@ -62,4 +63,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/cumsum.json5 b/tests/cumsum.json5 index 8744e8cb..ce92f2e6 100644 --- a/tests/cumsum.json5 +++ b/tests/cumsum.json5 @@ -1,5 +1,6 @@ { "id": "cumsum", + "level": "L3", "experimental": true, "tests": [ { @@ -58,4 +59,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/date_between.json5 b/tests/date_between.json5 index c3d9d2f7..f971e2b6 100644 --- a/tests/date_between.json5 +++ b/tests/date_between.json5 @@ -1,5 +1,6 @@ { "id": "date_between", + "level": "L2-Date", "experimental": true, "tests": [ { @@ -11,4 +12,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/date_difference.json5 b/tests/date_difference.json5 index 38bc26e9..6417e4b5 100644 --- a/tests/date_difference.json5 +++ b/tests/date_difference.json5 @@ -1,5 +1,6 @@ { "id": "date_difference", + "level": "L2-Date", "experimental": true, "tests": [ { @@ -32,4 +33,4 @@ "returns": -1 } ] -} \ No newline at end of file +} diff --git a/tests/date_shift.json5 b/tests/date_shift.json5 index a6b8e8d2..40d4fbc9 100644 --- a/tests/date_shift.json5 +++ b/tests/date_shift.json5 @@ -1,5 +1,6 @@ { "id": "date_shift", + "level": "L2-Date", "experimental": true, "tests": [ { @@ -71,4 +72,4 @@ "returns": "2017-12-31" } ] -} \ No newline at end of file +} diff --git a/tests/dimension_labels.json5 b/tests/dimension_labels.json5 index dd8cb14b..2908c443 100644 --- a/tests/dimension_labels.json5 +++ b/tests/dimension_labels.json5 @@ -1,4 +1,5 @@ { "id": "dimension_labels", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/divide.json5 b/tests/divide.json5 index 6f453702..fa0c597a 100644 --- a/tests/divide.json5 +++ b/tests/divide.json5 @@ -1,5 +1,6 @@ { "id": "divide", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/drop_dimension.json5 b/tests/drop_dimension.json5 index 854ef251..36eb81c6 100644 --- a/tests/drop_dimension.json5 +++ b/tests/drop_dimension.json5 @@ -1,4 +1,5 @@ { "id": "drop_dimension", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/e.json5 b/tests/e.json5 index 182fe4c2..5921aa4a 100644 --- a/tests/e.json5 +++ b/tests/e.json5 @@ -1,9 +1,10 @@ { "id": "e", + "level": "L1", "tests": [ { "arguments": {}, "returns": 2.718281828459 } ] -} \ No newline at end of file +} diff --git a/tests/eq.json5 b/tests/eq.json5 index 50898f5f..a3fa8828 100644 --- a/tests/eq.json5 +++ b/tests/eq.json5 @@ -1,5 +1,6 @@ { "id": "eq", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/exp.json5 b/tests/exp.json5 index 2f9c8ba0..cad8d87f 100644 --- a/tests/exp.json5 +++ b/tests/exp.json5 @@ -1,5 +1,6 @@ { "id": "exp", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/extrema.json5 b/tests/extrema.json5 index c91992e1..4ef7a2ed 100644 --- a/tests/extrema.json5 +++ b/tests/extrema.json5 @@ -1,5 +1,6 @@ { "id": "extrema", + "level": "L2", "tests": [ { "arguments": { diff --git a/tests/filter_bands.json5 b/tests/filter_bands.json5 index 691a400d..c9e42b84 100644 --- a/tests/filter_bands.json5 +++ b/tests/filter_bands.json5 @@ -1,4 +1,5 @@ { "id": "filter_bands", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/filter_bbox.json5 b/tests/filter_bbox.json5 index f131ab85..468859bf 100644 --- a/tests/filter_bbox.json5 +++ b/tests/filter_bbox.json5 @@ -1,4 +1,5 @@ { "id": "filter_bbox", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/filter_labels.json5 b/tests/filter_labels.json5 new file mode 100644 index 00000000..c220ec20 --- /dev/null +++ b/tests/filter_labels.json5 @@ -0,0 +1,5 @@ +{ + "id": "filter_labels", + "level": "L3", + "tests": [] +} diff --git a/tests/filter_spatial.json5 b/tests/filter_spatial.json5 index 60473628..a6853c5f 100644 --- a/tests/filter_spatial.json5 +++ b/tests/filter_spatial.json5 @@ -1,4 +1,5 @@ { "id": "filter_spatial", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/filter_temporal.json5 b/tests/filter_temporal.json5 index 3dcc40d4..fcf0c8a7 100644 --- a/tests/filter_temporal.json5 +++ b/tests/filter_temporal.json5 @@ -1,4 +1,5 @@ { "id": "filter_temporal", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/filter_vector.json5 b/tests/filter_vector.json5 new file mode 100644 index 00000000..8c2f5e33 --- /dev/null +++ b/tests/filter_vector.json5 @@ -0,0 +1,5 @@ +{ + "id": "filter_vector", + "level": "L2B", + "tests": [] +} diff --git a/tests/first.json5 b/tests/first.json5 index 81209141..db301e36 100644 --- a/tests/first.json5 +++ b/tests/first.json5 @@ -1,5 +1,6 @@ { "id": "first", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/flatten_dimensions.json5 b/tests/flatten_dimensions.json5 new file mode 100644 index 00000000..b33f5ef5 --- /dev/null +++ b/tests/flatten_dimensions.json5 @@ -0,0 +1,5 @@ +{ + "id": "flatten_dimensions", + "level": "L3", + "tests": [] +} diff --git a/tests/floor.json5 b/tests/floor.json5 index ee55c139..997d8990 100644 --- a/tests/floor.json5 +++ b/tests/floor.json5 @@ -1,5 +1,6 @@ { "id": "floor", + "level": "L1", "tests": [ { "arguments": { @@ -62,4 +63,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/gt.json5 b/tests/gt.json5 index 651401e5..db40afc6 100644 --- a/tests/gt.json5 +++ b/tests/gt.json5 @@ -1,5 +1,6 @@ { "id": "gt", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/gte.json5 b/tests/gte.json5 index 34f58a1c..aa82d7bd 100644 --- a/tests/gte.json5 +++ b/tests/gte.json5 @@ -1,5 +1,6 @@ { "id": "gte", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/if.json5 b/tests/if.json5 index c71bf659..122b7a17 100644 --- a/tests/if.json5 +++ b/tests/if.json5 @@ -1,5 +1,6 @@ { "id": "if", + "level": "L2", "tests": [ { "arguments": { @@ -52,4 +53,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/inspect.json5 b/tests/inspect.json5 new file mode 100644 index 00000000..0cac530b --- /dev/null +++ b/tests/inspect.json5 @@ -0,0 +1,5 @@ +{ + "id": "inspect", + "level": "L2", + "tests": [] +} diff --git a/tests/int.json5 b/tests/int.json5 index 2129fc92..879aa5ee 100644 --- a/tests/int.json5 +++ b/tests/int.json5 @@ -1,5 +1,6 @@ { "id": "int", + "level": "L1", "tests": [ { "arguments": { @@ -89,4 +90,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/is_infinite.json5 b/tests/is_infinite.json5 index 73cbb061..936234bd 100644 --- a/tests/is_infinite.json5 +++ b/tests/is_infinite.json5 @@ -1,5 +1,6 @@ { "id": "is_infinite", + "level": "L3", "experimental": true, "tests": [ { @@ -135,4 +136,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/is_nan.json5 b/tests/is_nan.json5 index 3ac7c83f..e130c521 100644 --- a/tests/is_nan.json5 +++ b/tests/is_nan.json5 @@ -1,5 +1,6 @@ { "id": "is_nan", + "level": "L2", "tests": [ { "arguments": { @@ -86,4 +87,4 @@ "returns": true } ] -} \ No newline at end of file +} diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index 0dddc9ed..206852cd 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -1,5 +1,6 @@ { "id": "is_nodata", + "level": "L2", // We can't check for other no-data values than `null` // as it depends on the data cube / metadata / context, which can't influence "tests": [ @@ -33,4 +34,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/is_valid.json5 b/tests/is_valid.json5 index e772f921..2652076d 100644 --- a/tests/is_valid.json5 +++ b/tests/is_valid.json5 @@ -1,5 +1,6 @@ { "id": "is_valid", + "level": "L2", "tests": [ { "arguments": { @@ -29,4 +30,4 @@ "returns": true } ] -} \ No newline at end of file +} diff --git a/tests/last.json5 b/tests/last.json5 index feca8803..b1a9623c 100644 --- a/tests/last.json5 +++ b/tests/last.json5 @@ -1,5 +1,6 @@ { "id": "last", + "level": "L1", "tests": [ { "arguments": { @@ -72,4 +73,4 @@ "returns": NaN } ] -} \ No newline at end of file +} diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 index 019468a2..03009d0e 100644 --- a/tests/linear_scale_range.json5 +++ b/tests/linear_scale_range.json5 @@ -1,5 +1,6 @@ { "id": "linear_scale_range", + "level": "L2", "tests": [ { "arguments": { diff --git a/tests/ln.json5 b/tests/ln.json5 index 883cd589..4a5c03f5 100644 --- a/tests/ln.json5 +++ b/tests/ln.json5 @@ -1,5 +1,6 @@ { "id": "ln", + "level": "L1", "tests": [ { "arguments": { @@ -63,4 +64,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/load_collection.json5 b/tests/load_collection.json5 new file mode 100644 index 00000000..642cfa4e --- /dev/null +++ b/tests/load_collection.json5 @@ -0,0 +1,5 @@ +{ + "id": "load_collection", + "level": "L1", + "tests": [] +} diff --git a/tests/load_geojson.json5 b/tests/load_geojson.json5 new file mode 100644 index 00000000..4ac4e72d --- /dev/null +++ b/tests/load_geojson.json5 @@ -0,0 +1,5 @@ +{ + "id": "load_geojson", + "level": "L3", + "tests": [] +} diff --git a/tests/load_stac.json5 b/tests/load_stac.json5 new file mode 100644 index 00000000..2306883a --- /dev/null +++ b/tests/load_stac.json5 @@ -0,0 +1,5 @@ +{ + "id": "load_stac", + "level": "L3", + "tests": [] +} diff --git a/tests/load_url.json5 b/tests/load_url.json5 new file mode 100644 index 00000000..9a1f5acd --- /dev/null +++ b/tests/load_url.json5 @@ -0,0 +1,5 @@ +{ + "id": "load_url", + "level": "L3", + "tests": [] +} diff --git a/tests/log.json5 b/tests/log.json5 index e3bb242d..23e00e78 100644 --- a/tests/log.json5 +++ b/tests/log.json5 @@ -1,5 +1,6 @@ { "id": "log", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/lt.json5 b/tests/lt.json5 index a3601197..d19efaa5 100644 --- a/tests/lt.json5 +++ b/tests/lt.json5 @@ -1,5 +1,6 @@ { "id": "lt", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/lte.json5 b/tests/lte.json5 index b5f920c5..ecf35492 100644 --- a/tests/lte.json5 +++ b/tests/lte.json5 @@ -1,5 +1,6 @@ { "id": "lte", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/mask.json5 b/tests/mask.json5 index 27ba31e5..f970670d 100644 --- a/tests/mask.json5 +++ b/tests/mask.json5 @@ -1,4 +1,5 @@ { "id": "mask", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/mask_polygon.json5 b/tests/mask_polygon.json5 index 1647594c..b730adb0 100644 --- a/tests/mask_polygon.json5 +++ b/tests/mask_polygon.json5 @@ -1,4 +1,5 @@ { "id": "mask_polygon", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/max.json5 b/tests/max.json5 index caf98b5d..04b766d4 100644 --- a/tests/max.json5 +++ b/tests/max.json5 @@ -1,5 +1,6 @@ { "id": "max", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/mean.json5 b/tests/mean.json5 index 88a1cd5e..625d9e47 100644 --- a/tests/mean.json5 +++ b/tests/mean.json5 @@ -1,5 +1,6 @@ { "id": "mean", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/median.json5 b/tests/median.json5 index 7ecadbca..8aa3ba9c 100644 --- a/tests/median.json5 +++ b/tests/median.json5 @@ -1,5 +1,6 @@ { "id": "median", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/merge_cubes.json5 b/tests/merge_cubes.json5 index b23c4c2f..eda1edb8 100644 --- a/tests/merge_cubes.json5 +++ b/tests/merge_cubes.json5 @@ -1,4 +1,5 @@ { "id": "merge_cubes", + "level": "L3", "tests": [] -} \ No newline at end of file +} diff --git a/tests/min.json5 b/tests/min.json5 index 0e193b16..3f246378 100644 --- a/tests/min.json5 +++ b/tests/min.json5 @@ -1,5 +1,6 @@ { "id": "min", + "level": "L1", "tests": [ { "arguments": { @@ -87,4 +88,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/mod.json5 b/tests/mod.json5 index b9152234..9a9823d3 100644 --- a/tests/mod.json5 +++ b/tests/mod.json5 @@ -1,5 +1,6 @@ { "id": "mod", + "level": "L1", "tests": [ { "arguments": { @@ -166,4 +167,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/multiply.json5 b/tests/multiply.json5 index 0e010cc4..96606394 100644 --- a/tests/multiply.json5 +++ b/tests/multiply.json5 @@ -1,5 +1,6 @@ { "id": "multiply", + "level": "L1", "tests": [ { "arguments": { @@ -163,4 +164,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/nan.json5 b/tests/nan.json5 index eacfd111..bdaca0d0 100644 --- a/tests/nan.json5 +++ b/tests/nan.json5 @@ -1,5 +1,6 @@ { "id": "nan", + "level": "L2", "experimental": true, "tests": [ { @@ -7,4 +8,4 @@ "returns": NaN } ] -} \ No newline at end of file +} diff --git a/tests/ndvi.json5 b/tests/ndvi.json5 index d57003ae..4e207686 100644 --- a/tests/ndvi.json5 +++ b/tests/ndvi.json5 @@ -1,4 +1,5 @@ { "id": "ndvi", + "level": "L3", "tests": [] -} \ No newline at end of file +} diff --git a/tests/neq.json5 b/tests/neq.json5 index dd837847..d0dd1c60 100644 --- a/tests/neq.json5 +++ b/tests/neq.json5 @@ -1,5 +1,6 @@ { "id": "neq", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/normalized_difference.json5 b/tests/normalized_difference.json5 index bb081483..34ced543 100644 --- a/tests/normalized_difference.json5 +++ b/tests/normalized_difference.json5 @@ -1,5 +1,6 @@ { "id": "normalized_difference", + "level": "L2", "tests": [ { "arguments": { @@ -58,4 +59,4 @@ "returns": -0.30769230769 } ] -} \ No newline at end of file +} diff --git a/tests/not.json5 b/tests/not.json5 index 37639697..563e9556 100644 --- a/tests/not.json5 +++ b/tests/not.json5 @@ -1,5 +1,6 @@ { "id": "not", + "level": "L1", "tests": [ { "arguments": { @@ -20,4 +21,4 @@ "returns": false } ] -} \ No newline at end of file +} diff --git a/tests/or.json5 b/tests/or.json5 index 1ea969e4..f029e13b 100644 --- a/tests/or.json5 +++ b/tests/or.json5 @@ -1,5 +1,6 @@ { "id": "or", + "level": "L1", "tests": [ { "arguments": { @@ -65,4 +66,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/order.json5 b/tests/order.json5 index 6d570fa9..0d1dfde9 100644 --- a/tests/order.json5 +++ b/tests/order.json5 @@ -1,5 +1,6 @@ { "id": "order", + "level": "L3", "tests": [ { "arguments": { @@ -125,4 +126,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/pi.json5 b/tests/pi.json5 index 1fb335df..c889691d 100644 --- a/tests/pi.json5 +++ b/tests/pi.json5 @@ -1,9 +1,10 @@ { "id": "pi", + "level": "L1", "tests": [ { "arguments": {}, "returns": 3.14159265359 } ] -} \ No newline at end of file +} diff --git a/tests/power.json5 b/tests/power.json5 index 102b2fa4..4615f538 100644 --- a/tests/power.json5 +++ b/tests/power.json5 @@ -1,5 +1,6 @@ { "id": "power", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/product.json5 b/tests/product.json5 index d97bd5f6..5c08af5b 100644 --- a/tests/product.json5 +++ b/tests/product.json5 @@ -1,5 +1,6 @@ { "id": "product", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/quantiles.json5 b/tests/quantiles.json5 index a0e8111b..e6ffcc51 100644 --- a/tests/quantiles.json5 +++ b/tests/quantiles.json5 @@ -1,5 +1,6 @@ { "id": "quantiles", + "level": "L1", "tests": [ { "arguments": { @@ -76,7 +77,7 @@ 0.8125, 3.625, Infinity, - Infinity + Infinity ] }, { @@ -100,7 +101,7 @@ -Infinity, 0.125, 2.5625, - 5.75 + 5.75 ] }, { diff --git a/tests/rearrange.json5 b/tests/rearrange.json5 index 931aef59..ba2b6f58 100644 --- a/tests/rearrange.json5 +++ b/tests/rearrange.json5 @@ -1,5 +1,6 @@ { "id": "rearrange", + "level": "L3", "tests": [ { // Reverse a list diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 index 1f1b9924..5e6f331e 100644 --- a/tests/reduce_dimension.json5 +++ b/tests/reduce_dimension.json5 @@ -1,4 +1,5 @@ { "id": "reduce_dimension", + "level": "L1", "tests": [] -} \ No newline at end of file +} diff --git a/tests/reduce_spatial.json5 b/tests/reduce_spatial.json5 new file mode 100644 index 00000000..19ae7ae6 --- /dev/null +++ b/tests/reduce_spatial.json5 @@ -0,0 +1,5 @@ +{ + "id": "reduce_spatial", + "level": "L3", + "tests": [] +} diff --git a/tests/rename_dimension.json5 b/tests/rename_dimension.json5 index de2bc77f..402cd245 100644 --- a/tests/rename_dimension.json5 +++ b/tests/rename_dimension.json5 @@ -1,4 +1,5 @@ { "id": "rename_dimension", + "level": "L2", "tests": [] -} \ No newline at end of file +} diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 index d1c11d7d..82deb687 100644 --- a/tests/rename_labels.json5 +++ b/tests/rename_labels.json5 @@ -1,5 +1,6 @@ { "id": "rename_labels", + "level": "L2", "tests": [ { // Rename named labels: diff --git a/tests/resample_cube_spatial.json5 b/tests/resample_cube_spatial.json5 index ef96a5ea..739ab67f 100644 --- a/tests/resample_cube_spatial.json5 +++ b/tests/resample_cube_spatial.json5 @@ -1,4 +1,5 @@ { "id": "resample_cube_spatial", + "level": "L3", "tests": [] -} \ No newline at end of file +} diff --git a/tests/resample_cube_temporal.json5 b/tests/resample_cube_temporal.json5 index ea626a51..ed824518 100644 --- a/tests/resample_cube_temporal.json5 +++ b/tests/resample_cube_temporal.json5 @@ -1,4 +1,5 @@ { "id": "resample_cube_temporal", + "level": "L3", "tests": [] -} \ No newline at end of file +} diff --git a/tests/resample_spatial.json5 b/tests/resample_spatial.json5 index f6d8711d..d50a04cd 100644 --- a/tests/resample_spatial.json5 +++ b/tests/resample_spatial.json5 @@ -1,4 +1,5 @@ { "id": "resample_spatial", + "level": "L2A", "tests": [] -} \ No newline at end of file +} diff --git a/tests/round.json5 b/tests/round.json5 index 0f63d138..0f0b6ff2 100644 --- a/tests/round.json5 +++ b/tests/round.json5 @@ -1,5 +1,6 @@ { "id": "round", + "level": "L1", "tests": [ { "arguments": { @@ -79,4 +80,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/save_result.json5 b/tests/save_result.json5 new file mode 100644 index 00000000..e312abaf --- /dev/null +++ b/tests/save_result.json5 @@ -0,0 +1,5 @@ +{ + "id": "save_result", + "level": "L1", + "tests": [] +} diff --git a/tests/sd.json5 b/tests/sd.json5 index 69c19729..8dce5e9c 100644 --- a/tests/sd.json5 +++ b/tests/sd.json5 @@ -1,5 +1,6 @@ { "id": "sd", + "level": "L1", "tests": [ { "arguments": { @@ -80,4 +81,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/sgn.json5 b/tests/sgn.json5 index cc5960e6..026ae03b 100644 --- a/tests/sgn.json5 +++ b/tests/sgn.json5 @@ -1,5 +1,6 @@ { "id": "sgn", + "level": "L1", "tests": [ { "arguments": { @@ -44,4 +45,4 @@ "returns": -1 }, ] -} \ No newline at end of file +} diff --git a/tests/sin.json5 b/tests/sin.json5 index b31fa527..0103bcb2 100644 --- a/tests/sin.json5 +++ b/tests/sin.json5 @@ -1,5 +1,6 @@ { "id": "sin", + "level": "L1", "tests": [ { "arguments": { @@ -50,4 +51,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/sinh.json5 b/tests/sinh.json5 index 3ef0280f..f0a643a5 100644 --- a/tests/sinh.json5 +++ b/tests/sinh.json5 @@ -1,5 +1,6 @@ { "id": "sinh", + "level": "L2", "tests": [ { "arguments": { diff --git a/tests/sort.json5 b/tests/sort.json5 index b4aa6a3d..a8d86a52 100644 --- a/tests/sort.json5 +++ b/tests/sort.json5 @@ -1,5 +1,6 @@ { "id": "sort", + "level": "L2", "tests": [ { "arguments": { @@ -62,4 +63,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tests/sqrt.json5 b/tests/sqrt.json5 index 24863efa..c8f81358 100644 --- a/tests/sqrt.json5 +++ b/tests/sqrt.json5 @@ -1,5 +1,6 @@ { "id": "sqrt", + "level": "L1", "tests": [ { "arguments": { @@ -50,4 +51,4 @@ "returns": NaN }, ] -} \ No newline at end of file +} diff --git a/tests/subtract.json5 b/tests/subtract.json5 index 79317e42..6eb9485a 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -1,5 +1,6 @@ { "id": "subtract", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/sum.json5 b/tests/sum.json5 index 3864e404..2054f87d 100644 --- a/tests/sum.json5 +++ b/tests/sum.json5 @@ -1,5 +1,6 @@ { "id": "sum", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/tan.json5 b/tests/tan.json5 index 26b3dcdd..393f9f24 100644 --- a/tests/tan.json5 +++ b/tests/tan.json5 @@ -1,5 +1,6 @@ { "id": "tan", + "level": "L1", "tests": [ { "arguments": { diff --git a/tests/tanh.json5 b/tests/tanh.json5 index 9f38c017..44601862 100644 --- a/tests/tanh.json5 +++ b/tests/tanh.json5 @@ -1,5 +1,6 @@ { "id": "tanh", + "level": "L2", "tests": [ { "arguments": { @@ -50,4 +51,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/text_begins.json5 b/tests/text_begins.json5 index 6eac0203..b0cffdd9 100644 --- a/tests/text_begins.json5 +++ b/tests/text_begins.json5 @@ -1,5 +1,6 @@ { "id": "text_begins", + "level": "L2-Text", "tests": [ { "arguments": { @@ -46,4 +47,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/text_concat.json5 b/tests/text_concat.json5 index 08d926b9..456e4ff3 100644 --- a/tests/text_concat.json5 +++ b/tests/text_concat.json5 @@ -1,5 +1,6 @@ { "id": "text_concat", + "level": "L2-Text", "tests": [ { "arguments": { @@ -59,4 +60,4 @@ "returns": "" } ] -} \ No newline at end of file +} diff --git a/tests/text_contains.json5 b/tests/text_contains.json5 index 751bf917..db5dbc09 100644 --- a/tests/text_contains.json5 +++ b/tests/text_contains.json5 @@ -1,5 +1,6 @@ { "id": "text_contains", + "level": "L2-Text", "tests": [ { "arguments": { @@ -46,4 +47,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/text_ends.json5 b/tests/text_ends.json5 index d1803c9e..5a0f6933 100644 --- a/tests/text_ends.json5 +++ b/tests/text_ends.json5 @@ -1,5 +1,6 @@ { "id": "text_ends", + "level": "L2-Text", "tests": [ { "arguments": { @@ -46,4 +47,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/trim_cube.json5 b/tests/trim_cube.json5 index 49f342d7..0bcc6627 100644 --- a/tests/trim_cube.json5 +++ b/tests/trim_cube.json5 @@ -1,4 +1,5 @@ { "id": "trim_cube", + "level": "L3", "tests": [] -} \ No newline at end of file +} diff --git a/tests/unflatten_dimensions.json5 b/tests/unflatten_dimensions.json5 new file mode 100644 index 00000000..cdfed772 --- /dev/null +++ b/tests/unflatten_dimensions.json5 @@ -0,0 +1,5 @@ +{ + "id": "unflatten_dimensions", + "level": "L3", + "tests": [] +} diff --git a/tests/variance.json5 b/tests/variance.json5 index 8eb963ae..17ab2812 100644 --- a/tests/variance.json5 +++ b/tests/variance.json5 @@ -1,5 +1,6 @@ { "id": "variance", + "level": "L1", "tests": [ { "arguments": { @@ -93,4 +94,4 @@ "returns": null } ] -} \ No newline at end of file +} diff --git a/tests/vector_buffer.json5 b/tests/vector_buffer.json5 new file mode 100644 index 00000000..941d4d02 --- /dev/null +++ b/tests/vector_buffer.json5 @@ -0,0 +1,5 @@ +{ + "id": "vector_buffer", + "level": "L2B", + "tests": [] +} diff --git a/tests/vector_reproject.json5 b/tests/vector_reproject.json5 new file mode 100644 index 00000000..31373246 --- /dev/null +++ b/tests/vector_reproject.json5 @@ -0,0 +1,5 @@ +{ + "id": "vector_reproject", + "level": "L2B", + "tests": [] +} diff --git a/tests/vector_to_random_points.json5 b/tests/vector_to_random_points.json5 new file mode 100644 index 00000000..8fbf1507 --- /dev/null +++ b/tests/vector_to_random_points.json5 @@ -0,0 +1,5 @@ +{ + "id": "vector_reproject", + "level": "L3", + "tests": [] +} diff --git a/tests/vector_to_regular_points.json5 b/tests/vector_to_regular_points.json5 new file mode 100644 index 00000000..8fbf1507 --- /dev/null +++ b/tests/vector_to_regular_points.json5 @@ -0,0 +1,5 @@ +{ + "id": "vector_reproject", + "level": "L3", + "tests": [] +} diff --git a/tests/xor.json5 b/tests/xor.json5 index 63ca5b84..b4cba17d 100644 --- a/tests/xor.json5 +++ b/tests/xor.json5 @@ -1,5 +1,6 @@ { "id": "xor", + "level": "L2", "tests": [ { "arguments": { @@ -65,4 +66,4 @@ "returns": null } ] -} \ No newline at end of file +} From e26b03810563d516381eedfb16243d8d14120f76 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 12 Dec 2023 21:13:33 +0100 Subject: [PATCH 23/39] Fix test in apply --- tests/apply.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/apply.json5 b/tests/apply.json5 index 128c3c73..488e8eaa 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -58,7 +58,7 @@ [ [-62.65, 10.0, -67.52, -7.0], [2.05, -62.8, 74.05, 52.05], - [49.86, -20.30, NaN, 47.15] + [48.86, -20.30, NaN, 47.15] ] ] } From 4787fb7455fbbcba047d95de4f3ddff096d2b0c9 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 12 Dec 2023 21:38:58 +0100 Subject: [PATCH 24/39] Add tests for reduce_dimension and apply_dimension --- tests/apply_dimension.json5 | 64 +++++++++++++++++++++++++++++++++++- tests/reduce_dimension.json5 | 52 ++++++++++++++++++++++++++++- 2 files changed, 114 insertions(+), 2 deletions(-) diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 index 1accbe9f..a981d77f 100644 --- a/tests/apply_dimension.json5 +++ b/tests/apply_dimension.json5 @@ -1,5 +1,67 @@ { "id": "apply_dimension", "level": "L1", - "tests": [] + "tests": [ + { + "required": [ + "extrema" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal.json5" + }, + "process": { + "process_graph": { + "extrema": { + "process_id": "extrema", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [-63.65, 9.0 , -68.52, -64.25], + [-18.0 , -63.8 , -3.11, -20.5 ], + [ 47.86, -21.3 , 25.16, -81.6 ] + ], + [ + [ 17.5 , 53.75, -27.1 , -8.0 ], + [ 1.05, 8.45, 73.05, 51.05], + [ 50.4 , 49.24, 25.16, 46.15] + ] + ] + } + } + ] } diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 index 5e6f331e..896add44 100644 --- a/tests/reduce_dimension.json5 +++ b/tests/reduce_dimension.json5 @@ -1,5 +1,55 @@ { "id": "reduce_dimension", "level": "L1", - "tests": [] + "tests": [ + { + "required": [ + "sum" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal.json5" + }, + "reducer": { + "process_graph": { + "sum": { + "process_id": "sum", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [-46.15, 62.75, -95.62, -72.25], + [-16.95, -55.35, 69.94, 30.55], + [ 98.26, 27.94, 25.16, -35.45] + ] + } + } + ] } From 622dc6552606aa17992c2997b58ce65354655f83 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 13 Dec 2023 13:53:57 +0100 Subject: [PATCH 25/39] Add more tests --- tests/README.md | 22 +- tests/add_dimension.json5 | 179 ++++++++++++++- tests/apply.json5 | 158 ++++++++++++- tests/apply_dimension.json5 | 70 +++++- tests/array_create_labeled.json5 | 87 +++++++- tests/array_element.json5 | 24 ++ tests/array_find_label.json5 | 97 +++++++- tests/assets/xyb-enumerated-bands.json5 | 42 ++++ tests/assets/xyb-minimal-int.json5 | 42 ++++ tests/assets/xyb-one-band.json5 | 31 +++ ...-minimal.json5 => xyt-minimal-float.json5} | 0 tests/create_data_cube.json5 | 11 +- tests/dimension_labels.json5 | 57 ++++- tests/drop_dimension.json5 | 53 ++++- tests/reduce_dimension.json5 | 78 ++++++- tests/rename_dimension.json5 | 159 ++++++++++++- tests/rename_labels.json5 | 210 +++++++++++++++++- 17 files changed, 1295 insertions(+), 25 deletions(-) create mode 100644 tests/assets/xyb-enumerated-bands.json5 create mode 100644 tests/assets/xyb-minimal-int.json5 create mode 100644 tests/assets/xyb-one-band.json5 rename tests/assets/{xyt-minimal.json5 => xyt-minimal-float.json5} (100%) diff --git a/tests/README.md b/tests/README.md index e8cab80b..384d18b0 100644 --- a/tests/README.md +++ b/tests/README.md @@ -6,7 +6,7 @@ This folder contains test cases for the openEO processes. - [x] absolute - [x] add -- [ ] add_dimension +- [x] add_dimension - [ ] aggregate_spatial - [ ] aggregate_spatial_window (experimental) - [ ] aggregate_temporal @@ -15,8 +15,8 @@ This folder contains test cases for the openEO processes. - [x] and - [ ] anomaly - [x] any -- [ ] apply -- [ ] apply_dimension +- [x] apply* +- [x] apply_dimension* - [ ] apply_kernel - [ ] apply_neighborhood - [ ] apply_polygon (experimental) @@ -30,11 +30,11 @@ This folder contains test cases for the openEO processes. - [x] array_concat - [x] array_contains - [x] array_create -- [ ] array_create_labeled (experimental) +- [x] array_create_labeled (experimental) - [x] array_element - [x] array_filter - [x] array_find -- [ ] array_find_label (experimental) +- [x] array_find_label (experimental) - [x] array_interpolate_linear - [x] array_labels - [x] array_modify* (experimental) @@ -52,13 +52,13 @@ This folder contains test cases for the openEO processes. - [x] cummin* (experimental) - [x] cumproduct* (experimental) - [x] cumsum* (experimental) -- [ ] create_data_cube +- [x] create_data_cube - [x] date_between* (experimental) - [x] date_difference* (experimental) - [x] date_shift* (experimental) -- [ ] dimension_labels +- [x] dimension_labels - [x] divide -- [ ] drop_dimension +- [x] drop_dimension* - [x] e - [x] eq - [x] exp @@ -107,10 +107,10 @@ This folder contains test cases for the openEO processes. - [x] product - [x] quantiles - [x] rearrange* -- [ ] reduce_dimension +- [x] reduce_dimension* - [ ] reduce_spatial (experimental) -- [ ] rename_dimension -- [ ] rename_labels +- [x] rename_dimension +- [x] rename_labels - [ ] resample_cube_spatial - [ ] resample_cube_temporal - [ ] resample_spatial diff --git a/tests/add_dimension.json5 b/tests/add_dimension.json5 index 1be0c876..534bb139 100644 --- a/tests/add_dimension.json5 +++ b/tests/add_dimension.json5 @@ -1,5 +1,182 @@ { "id": "add_dimension", "level": "L2", - "tests": [] + "tests": [ + { + // add bands dimension + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "name": "b", + "label": "B1", + "type": "bands" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "b", + "type": "bands", + "values": ["B1"] + }, + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + // add temporal dimension + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "name": "t", + "label": "2020-01-01T00:00:00Z", + "type": "temporal" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-01-01T00:00:00Z"] + }, + { + "name": "bands", + "type": "bands", + "values": ["red", "green", "blue"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + // add second temporal dimension + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "name": "t2", + "label": "2010-01-01T00:00:00.0Z", + "type": "temporal" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "t2", + "type": "temporal", + "values": ["2010-01-01T00:00:00.0Z"] + }, + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + // add other dimension + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "name": "var", + "label": 1, + "type": "other" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "var", + "type": "other", + "values": [1] + }, + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + // throw for existing dimension + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "name": "t", + "label": "2020-01-01", + "type": "temporal" + }, + "throws": "DimensionExists" + } + ] } diff --git a/tests/apply.json5 b/tests/apply.json5 index 488e8eaa..3b5913f6 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -3,12 +3,13 @@ "level": "L1", "tests": [ { + // single math process "required": [ "add" ], "arguments": { "data": { - "$ref": "assets/xyt-minimal.json5" + "$ref": "assets/xyt-minimal-float.json5" }, "process": { "process_graph": { @@ -62,6 +63,161 @@ ] ] } + }, + { + // multiple processes with a data type change + "required": [ + "lt", + "gt", + "or" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "process": { + "process_graph": { + "lt": { + "process_id": "lt", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": -50 + } + }, + "gt": { + "process_id": "gt", + "arguments": { + "x": { + "from_argument": "x" + }, + "y": 50 + } + }, + "or": { + "process_id": "or", + "arguments": { + "x": { + "from_node": "lt" + }, + "y": { + "from_node": "gt" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [false, true, false, true], + [false, false, false, false], + [true, false, false, true] + ], + [ + [true, false, true, false], + [false, true, true, true], + [false, false, NaN, false] + ] + ] + } + }, + { + // math on integers with context parameter + "level": "L3", + "required": [ + "multiply" + ], + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "process": { + "process_graph": { + "add": { + "process_id": "multiply", + "arguments": { + "x": { + "from_parameter": "x" + }, + "y": { + "from_parameter": "context" + } + }, + "result": true + } + } + }, + "context": 10 + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red", "green", "blue"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [1720, 470, 1170, 1920], + [670, 2510, 1950, 1030], + [90, 2110, 0, 2420] + ], + [ + [360, 870, 700, 2160], + [880, 1400, 580, 1930], + [2300, 390, 0, 870] + ], + [ + [1740, 880, 810, 1650], + [250, 770, 720, 90], + [1480, 1150, 0, 2080] + ] + ] + } } ] } diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 index a981d77f..7e733083 100644 --- a/tests/apply_dimension.json5 +++ b/tests/apply_dimension.json5 @@ -8,7 +8,7 @@ ], "arguments": { "data": { - "$ref": "assets/xyt-minimal.json5" + "$ref": "assets/xyt-minimal-float.json5" }, "process": { "process_graph": { @@ -62,6 +62,74 @@ ] ] } + }, + { + "required": [ + "quantiles" + ], + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "process": { + "process_graph": { + "quantiles": { + "process_id": "quantiles", + "arguments": { + "data": { + "from_parameter": "data" + }, + "probabilities": [0.5, 0.75, 0.9] + }, + "result": true + } + } + }, + "dimension": "bands", + "target_dimension": "quantiles", + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "quantiles", + "type": "other", + "values": [0, 1, 2] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [172.0, 87.0, 81.0, 192.0], + [67.0, 140.0, 72.0, 103.0], + [148.0, 115.0, NaN, 208.0] + ], + [ + [173.0, 87.5, 99.0, 204.0], + [77.5, 195.5, 133.5, 148.0], + [189.0, 163.0, NaN, 225.0] + ], + [ + [173.6, 87.8, 109.8, 211.2], + [83.8, 228.8, 170.4, 175.0], + [213.6, 191.8, NaN, 235.2] + ] + ] + } } ] } diff --git a/tests/array_create_labeled.json5 b/tests/array_create_labeled.json5 index 71e62b09..3376e90f 100644 --- a/tests/array_create_labeled.json5 +++ b/tests/array_create_labeled.json5 @@ -1,5 +1,90 @@ { "id": "array_create_labeled", "level": "L3", - "tests": [] + "tests": [ + // empty array + { + "arguments": { + "data": [], + "labels": [] + }, + "returns": { + "type": "labeled-array", + "data": [] + } + }, + { + "arguments": { + "data": [1.23, 0.98], + "labels": ["B01", "B02"] + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + } + }, + { + "arguments": { + "data": [5,6,7,NaN], + "labels": [8,7,5,4] + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": 8, + "value": 5 + }, + { + "key": 7, + "value": 6 + }, + { + "key": 5, + "value": 7 + }, + { + "key": 4, + "value": NaN + }, + ] + } + }, + { + "arguments": { + "data": [true, false], + "labels": [1, "2"] + }, + "returns": { + "type": "labeled-array", + "data": [ + { + "key": 1, + "value": true + }, + { + "key": "2", + "value": false + } + ] + } + }, + { + // mismatch of array lengths + "arguments": { + "data": [1], + "labels": [1,2], + }, + "throws": "ArrayLengthMismatch" + } + ] } diff --git a/tests/array_element.json5 b/tests/array_element.json5 index 2eab8dfb..e2b30985 100644 --- a/tests/array_element.json5 +++ b/tests/array_element.json5 @@ -157,5 +157,29 @@ }, "returns": null }, + { + "level": "L2", + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": 1, + "value": 4 + }, + { + "key": 2, + "value": 5 + }, + { + "key": 3, + "value": 6 + } + ] + }, + "label": 1 + }, + "returns": 4 + } ] } diff --git a/tests/array_find_label.json5 b/tests/array_find_label.json5 index ba3bc422..c5487add 100644 --- a/tests/array_find_label.json5 +++ b/tests/array_find_label.json5 @@ -1,5 +1,100 @@ { "id": "array_find_label", "level": "L3", - "tests": [] + "tests": [ + { + "arguments": { + "data": [ + 1, + 2 + ], + "label": 1 + }, + "returns": null + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "label": "B01" + }, + "returns": 0 + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": "B01", + "value": 1.23 + }, + { + "key": "B02", + "value": 0.98 + } + ] + }, + "label": "B02" + }, + "returns": 1 + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": 2, + "value": 1.23 + }, + { + "key": 3, + "value": 0.98 + }, + { + "key": 4, + "value": 2.75 + } + ] + }, + "label": 4 + }, + "returns": 2 + }, + { + "arguments": { + "data": { + "type": "labeled-array", + "data": [ + { + "key": 2, + "value": 1.23 + }, + { + "key": 3, + "value": 0.98 + }, + { + "key": 4, + "value": 2.75 + } + ] + }, + "label": 1 + }, + "returns": null + } + ] } diff --git a/tests/assets/xyb-enumerated-bands.json5 b/tests/assets/xyb-enumerated-bands.json5 new file mode 100644 index 00000000..db6e9ec4 --- /dev/null +++ b/tests/assets/xyb-enumerated-bands.json5 @@ -0,0 +1,42 @@ +{ + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": [0, 1, 2] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 0, 242] + ], + [ + [36, 87, 70, 216], + [88, 140, 58, 193], + [230, 39, 0, 87] + ], + [ + [174, 88, 81, 165], + [25, 77, 72, 9], + [148, 115, 0, 208] + ] + ] +} diff --git a/tests/assets/xyb-minimal-int.json5 b/tests/assets/xyb-minimal-int.json5 new file mode 100644 index 00000000..6ed0d6f5 --- /dev/null +++ b/tests/assets/xyb-minimal-int.json5 @@ -0,0 +1,42 @@ +{ + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red", "green", "blue"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 0, 242] + ], + [ + [36, 87, 70, 216], + [88, 140, 58, 193], + [230, 39, 0, 87] + ], + [ + [174, 88, 81, 165], + [25, 77, 72, 9], + [148, 115, 0, 208] + ] + ] +} diff --git a/tests/assets/xyb-one-band.json5 b/tests/assets/xyb-one-band.json5 new file mode 100644 index 00000000..159c747f --- /dev/null +++ b/tests/assets/xyb-one-band.json5 @@ -0,0 +1,31 @@ +{ + "type": "datacube", + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 0, 242] + ] + ] +} diff --git a/tests/assets/xyt-minimal.json5 b/tests/assets/xyt-minimal-float.json5 similarity index 100% rename from tests/assets/xyt-minimal.json5 rename to tests/assets/xyt-minimal-float.json5 diff --git a/tests/create_data_cube.json5 b/tests/create_data_cube.json5 index 8e35f191..01cff983 100644 --- a/tests/create_data_cube.json5 +++ b/tests/create_data_cube.json5 @@ -1,5 +1,14 @@ { "id": "create_data_cube", "level": "L3", - "tests": [] + "tests": [ + { + "arguments": {}, + "returns": { + "type": "datacube", + "dimensions": [], + "data": [] + } + } + ] } diff --git a/tests/dimension_labels.json5 b/tests/dimension_labels.json5 index 2908c443..ccb48ab4 100644 --- a/tests/dimension_labels.json5 +++ b/tests/dimension_labels.json5 @@ -1,5 +1,60 @@ { "id": "dimension_labels", "level": "L2", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "dimension": "foo" + }, + "throws": "DimensionNotAvailable" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "dimension": "x" + }, + "returns": [404835.0, 404845.0, 404855.0, 404865.0] + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "dimension": "x" + }, + "returns": [404835.0, 404845.0, 404855.0, 404865.0] + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "dimension": "y" + }, + "returns": [5757495.0, 5757485.0, 5757475.0] + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "dimension": "t" + }, + "returns": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "dimension": "bands" + }, + "returns": ["red", "green", "blue"] + } + ] } diff --git a/tests/drop_dimension.json5 b/tests/drop_dimension.json5 index 36eb81c6..435d13d1 100644 --- a/tests/drop_dimension.json5 +++ b/tests/drop_dimension.json5 @@ -1,5 +1,56 @@ { "id": "drop_dimension", "level": "L2", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "name": "t" + }, + "throws": "DimensionLabelCountMismatch" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-one-band.json5" + }, + "name": "foo" + }, + "throws": "DimensionNotAvailable" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-one-band.json5" + }, + "name": "bands" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 0, 242] + ] + } + }, + ] } diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 index 896add44..705442a4 100644 --- a/tests/reduce_dimension.json5 +++ b/tests/reduce_dimension.json5 @@ -3,12 +3,13 @@ "level": "L1", "tests": [ { + // single process "required": [ "sum" ], "arguments": { "data": { - "$ref": "assets/xyt-minimal.json5" + "$ref": "assets/xyt-minimal-float.json5" }, "reducer": { "process_graph": { @@ -50,6 +51,81 @@ [ 98.26, 27.94, 25.16, -35.45] ] } + }, + { + // multiple processes with labels + "level": "L2", + "required": [ + "array_element", + "divide" + ], + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "reducer": { + "process_graph": { + "red": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "red" + }, + "result": true + }, + "blue": { + "process_id": "array_element", + "arguments": { + "data": { + "from_parameter": "data" + }, + "label": "blue" + }, + "result": true + }, + "divide": { + "process_id": "divide", + "arguments": { + "x": { + "from_argument": "red" + }, + "y": { + "from_argument": "blue" + } + }, + "result": true + } + } + }, + "dimension": "bands" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [0.98850574712, 0.53409090909, 1.44444444444, 1.16363636363], + [2.68, 3.2597402597, 2.708333333333, 11.44444444444], + [0.06081081081081, 1.834782608695, NaN, 1.163461538461] + ] + } } ] } diff --git a/tests/rename_dimension.json5 b/tests/rename_dimension.json5 index 402cd245..9879bdf2 100644 --- a/tests/rename_dimension.json5 +++ b/tests/rename_dimension.json5 @@ -1,5 +1,162 @@ { "id": "rename_dimension", "level": "L2", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "source": "foo", + "target": "bar" + }, + "throws": "DimensionNotAvailable" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "source": "t", + "target": "x" + }, + "throws": "DimensionExists" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "source": "t", + "target": "time" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "time", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "source": "x", + "target": "lon" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "lon", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "source": "y", + "target": "lat" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "lat", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "source": "bands", + "target": "b" + }, + "returns": { + "type": "datacube", + "dimensions": [ + { + "name": "b", + "type": "bands", + "values": ["red", "green", "blue"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + } + ] } diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 index 82deb687..1adfe31f 100644 --- a/tests/rename_labels.json5 +++ b/tests/rename_labels.json5 @@ -3,23 +3,225 @@ "level": "L2", "tests": [ { - // Rename named labels: - // Rename the bands from `B1` to `red`, from `B2` to `green` and from `B3` to `blue`. "arguments": { "data": { - "from_parameter": "data" + "$ref": "assets/xyb-minimal-int.json5" }, "dimension": "bands", - "source": [ + "target": [ "B1", "B2", "B3" + ] + }, + "throws": "LabelsNotEnumerated" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "dimension": "bands", + "target": [ + "B1" + ], + "source": [ + "red", + "green" + ] + }, + "throws": "LabelMismatch" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "dimension": "bands", + "target": [ + "bar" + ], + "source": [ + "foo" + ] + }, + "throws": "LabelNotAvailable" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "dimension": "bands", + "target": [ + "blue" + ], + "source": [ + "green" + ] + }, + "throws": "LabelExists" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "dimension": "bands", + "source": [ + "red", + "green", + "blue" ], "target": [ + "B1", + "B2", + "B3" + ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["B1", "B2", "B3"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-enumerated-bands.json5" + }, + "dimension": "bands", + "source": [ "red", "green", "blue" ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red", "green", "blue"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "dimension": "bands", + "source": [ + "blue", + "green" + ], + "target": [ + "B3", + "B2" + ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red", "B2", "B3"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-enumerated-bands.json5" + }, + "dimension": "bands", + "source": [ + "red" + ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red", 1, 2] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": null } } ] From de71911db8d51f7df4fabdad7cfdf33513edd37a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 14 Dec 2023 15:38:08 +0100 Subject: [PATCH 26/39] Fix various test cases --- tests/README.md | 17 ++++++++++++++++- tests/clip.json5 | 4 ++-- tests/date_shift.json5 | 25 ++++++++++++++++++++----- tests/dimension_labels.json5 | 11 ++++++++++- tests/linear_scale_range.json5 | 2 +- tests/mod.json5 | 2 +- tests/multiply.json5 | 2 +- tests/normalized_difference.json5 | 2 +- 8 files changed, 52 insertions(+), 13 deletions(-) diff --git a/tests/README.md b/tests/README.md index 384d18b0..9b5db123 100644 --- a/tests/README.md +++ b/tests/README.md @@ -2,7 +2,7 @@ This folder contains test cases for the openEO processes. -## Supported processes +## Processes - [x] absolute - [x] add @@ -239,6 +239,7 @@ properties: delta: description: If set to a positive number the equality of the actual return value and the expected return value is checked against a delta value to circumvent problems with floating-point inaccuracy. type: number + default: 0.0000000001 throws: description: >- Specifies whether the execution is meant to throw an exception. @@ -261,6 +262,20 @@ properties: pattern: 'L\d([\w-])?' ``` +### Datetimes + +Datetimes as strings have a varying precision, especially regarding the milliseconds. +Also, sometimes timezones are differently handled. + +Datetimes in return values should be encoded as follows so that the results can be compared better: + +```json +{ + "type": "datetime", + "value": "2020-01-01T00:00:00Z" +} +``` + ### External references Arguments and return values can point to external files, e.g. diff --git a/tests/clip.json5 b/tests/clip.json5 index f3a64fe5..a74f9d5d 100644 --- a/tests/clip.json5 +++ b/tests/clip.json5 @@ -104,7 +104,7 @@ "min": -1, "max": Infinity }, - "returns": -2 + "returns": -1 }, { "arguments": { @@ -112,7 +112,7 @@ "min": -Infinity, "max": 1 }, - "returns": 2 + "returns": 1 }, { "arguments": { diff --git a/tests/date_shift.json5 b/tests/date_shift.json5 index 40d4fbc9..bab0e625 100644 --- a/tests/date_shift.json5 +++ b/tests/date_shift.json5 @@ -9,7 +9,10 @@ "value": 6, "unit": "month" }, - "returns": "2020-08-01T17:22:45Z" + "returns": { + "type": "datetime", + "value": "2020-08-01T17:22:45Z" + } }, { "arguments": { @@ -17,7 +20,10 @@ "value": -7, "unit": "day" }, - "returns": "2021-03-24T00:00:00+02:00" + "returns": { + "type": "datetime", + "value": "2021-03-24T00:00:00+02:00" + } }, { // Adding a year to February 29th in a leap year will result in February 28th in the next (non-leap) year. @@ -26,7 +32,10 @@ "value": 1, "unit": "year" }, - "returns": "2021-02-28T17:22:45Z" + "returns": { + "type": "datetime", + "value": "2021-02-28T17:22:45Z", + } }, { // Adding a month to January 31th will result in February 29th in leap years. @@ -44,7 +53,10 @@ "value": 1, "unit": "second" }, - "returns": "2017-01-01T00:00:00Z" + "returns": { + "type": "datetime", + "value": "2017-01-01T00:00:00Z" + } }, { // Milliseconds can be added or subtracted. If not given, the default value is `0`. @@ -53,7 +65,10 @@ "value": 1150, "unit": "millisecond" }, - "returns": "2018-12-31T17:22:46.150Z" + "returns": { + "type": "datetime", + "value": "2018-12-31T17:22:46.150Z" + } }, { "arguments": { diff --git a/tests/dimension_labels.json5 b/tests/dimension_labels.json5 index ccb48ab4..09d537b4 100644 --- a/tests/dimension_labels.json5 +++ b/tests/dimension_labels.json5 @@ -45,7 +45,16 @@ }, "dimension": "t" }, - "returns": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + "returns": [ + { + "type": "datetime", + "value": "2020-06-01T00:00:00Z" + }, + { + "type": "datetime", + "value": "2020-06-03T00:00:00Z" + } + ] }, { "arguments": { diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 index 03009d0e..bccb71cd 100644 --- a/tests/linear_scale_range.json5 +++ b/tests/linear_scale_range.json5 @@ -98,7 +98,7 @@ "inputMin": 0, "inputMax": 100 }, - "returns": 100 + "returns": 1 }, { "arguments": { diff --git a/tests/mod.json5 b/tests/mod.json5 index 9a9823d3..c7c15f18 100644 --- a/tests/mod.json5 +++ b/tests/mod.json5 @@ -122,7 +122,7 @@ "x": 2, "y": -Infinity }, - "returns": -2 + "returns": 2 }, { "arguments": { diff --git a/tests/multiply.json5 b/tests/multiply.json5 index 96606394..ac433fc8 100644 --- a/tests/multiply.json5 +++ b/tests/multiply.json5 @@ -49,7 +49,7 @@ "x": -250, "y": -10 }, - "returns": -2500 + "returns": 2500 }, { "arguments": { diff --git a/tests/normalized_difference.json5 b/tests/normalized_difference.json5 index 34ced543..bc76508d 100644 --- a/tests/normalized_difference.json5 +++ b/tests/normalized_difference.json5 @@ -56,7 +56,7 @@ "x": 1.12345678901, "y": 2.12345678901 }, - "returns": -0.30769230769 + "returns": -0.30798479108 } ] } From 2bc57e9c45578ef954976d720d872aa172f43a33 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 14 Dec 2023 22:03:05 +0100 Subject: [PATCH 27/39] Special no-data handling, fix tests --- tests/README.md | 21 +++++++---- tests/absolute.json5 | 4 +-- tests/add.json5 | 22 ++++++------ tests/aggregate_temporal.json5 | 52 +--------------------------- tests/all.json5 | 16 ++++----- tests/and.json5 | 18 +++++----- tests/any.json5 | 16 ++++----- tests/arccos.json5 | 4 +-- tests/arcosh.json5 | 4 +-- tests/arctan.json5 | 4 +-- tests/arctan2.json5 | 14 ++++---- tests/array_interpolate_linear.json5 | 34 +++++++++--------- tests/arsinh.json5 | 4 +-- tests/artanh.json5 | 4 +-- tests/between.json5 | 4 +-- tests/ceil.json5 | 4 +-- tests/clip.json5 | 4 +-- tests/constant.json5 | 8 ++--- tests/cos.json5 | 4 +-- tests/cosh.json5 | 4 +-- tests/count.json5 | 8 ++--- tests/cummax.json5 | 12 +++---- tests/cummin.json5 | 12 +++---- tests/cumproduct.json5 | 12 +++---- tests/cumsum.json5 | 12 +++---- tests/divide.json5 | 4 +-- tests/eq.json5 | 10 +++--- tests/exp.json5 | 4 +-- tests/extrema.json5 | 14 ++++---- tests/first.json5 | 22 ++++++------ tests/floor.json5 | 4 +-- tests/gt.json5 | 10 +++--- tests/gte.json5 | 10 +++--- tests/int.json5 | 6 ++-- tests/is_infinite.json5 | 2 +- tests/is_nan.json5 | 2 +- tests/is_nodata.json5 | 8 ++--- tests/is_valid.json5 | 6 ++-- tests/last.json5 | 22 ++++++------ tests/linear_scale_range.json5 | 4 +-- tests/ln.json5 | 4 +-- tests/log.json5 | 4 +-- tests/lt.json5 | 10 +++--- tests/lte.json5 | 10 +++--- tests/max.json5 | 10 +++--- tests/mean.json5 | 24 ++++++------- tests/median.json5 | 18 +++++----- tests/min.json5 | 10 +++--- tests/mod.json5 | 22 ++++++------ tests/multiply.json5 | 22 ++++++------ tests/neq.json5 | 10 +++--- tests/normalized_difference.json5 | 4 +-- tests/not.json5 | 4 +-- tests/or.json5 | 18 +++++----- tests/order.json5 | 16 ++++----- tests/power.json5 | 8 ++--- tests/product.json5 | 12 +++---- tests/quantiles.json5 | 14 ++++---- tests/reduce_dimension.json5 | 6 ++-- tests/round.json5 | 4 +-- tests/sd.json5 | 10 +++--- tests/sgn.json5 | 4 +-- tests/sin.json5 | 4 +-- tests/sinh.json5 | 4 +-- tests/sort.json5 | 12 +++---- tests/sqrt.json5 | 4 +-- tests/subtract.json5 | 16 ++++----- tests/sum.json5 | 12 +++---- tests/tan.json5 | 4 +-- tests/tanh.json5 | 4 +-- tests/text_begins.json5 | 4 +-- tests/text_contains.json5 | 4 +-- tests/text_ends.json5 | 4 +-- tests/variance.json5 | 10 +++--- tests/xor.json5 | 22 ++++++------ 75 files changed, 366 insertions(+), 411 deletions(-) diff --git a/tests/README.md b/tests/README.md index 9b5db123..e1314982 100644 --- a/tests/README.md +++ b/tests/README.md @@ -141,7 +141,6 @@ This folder contains test cases for the openEO processes. **Important:** The differentiation of null and NaN is to be discussed and reflected in the tests. See for details. -Also, several processes would be affected by . ## Missing processes @@ -170,7 +169,7 @@ We don't expect that we can provide meaningful test cases for these processes. The test cases assume a couple of things as they are an abstraction and not bound to specific implementations: - The JSON Schema type `number` explicitly includes the values `+Infinity`, `-Infinity` and `NaN`. -- The input and output values for no-data values are `null`, so there's no mapping to e.g. `0` as no-data value. +- The input and output values for no-data values are `null` by default unless otherwise specified by a runner. - Input that is not valid according to the schemas, will be rejected upfront and will not be checked on. For example, the absolute process only tests against the data types `number` and `null`. There are no tests for a boolean or string input. - Numerical data types such as uint8 don't matter, i.e. tests don't check for overflows etc. This suite can't provide such tests as the underlying data type is not known. - If not otherwise specified for numbers, a precision of 10 decimals is checked so return values should have at least 11 decimals. @@ -262,6 +261,17 @@ properties: pattern: 'L\d([\w-])?' ``` +### No-data values + +No-data values have a special encoding in tests (see below). +The encoding is replaced with `null` unless otherwise specified by the runners. + +```json +{ + "type": "nodata" +} +``` + ### Datetimes Datetimes as strings have a varying precision, especially regarding the milliseconds. @@ -286,6 +296,8 @@ Arguments and return values can point to external files, e.g. } ``` +The test suite can currently only load JSON and JSON5 files. + ### Labeled arrays Labeled arrays can't be represented in JSON5 and will be provided as an object instead. @@ -317,6 +329,7 @@ Vector datacubes are currently not supported. "type": "datacube", "data": [ // multi-dimensional array + // can be set to `null` if the data values are irrelevant for the test. ], "nodata": [ NaN @@ -351,7 +364,3 @@ Vector datacubes are currently not supported. ] } ``` - -### Nodata - -todo \ No newline at end of file diff --git a/tests/absolute.json5 b/tests/absolute.json5 index 8d5fbd00..a495c763 100644 --- a/tests/absolute.json5 +++ b/tests/absolute.json5 @@ -52,9 +52,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/add.json5 b/tests/add.json5 index 14183223..f0f7f8c1 100644 --- a/tests/add.json5 +++ b/tests/add.json5 @@ -124,37 +124,37 @@ { "arguments": { "x": -Infinity, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": Infinity }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": 1 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/aggregate_temporal.json5 b/tests/aggregate_temporal.json5 index 2e5dfdb0..41771199 100644 --- a/tests/aggregate_temporal.json5 +++ b/tests/aggregate_temporal.json5 @@ -1,55 +1,5 @@ { "id": "aggregate_temporal", "level": "L2", - "tests": [ - { - "arguments": { - "data": { - "from_parameter": "data" - }, - "intervals": [ - [ - "2015-01-01", - "2016-01-01" - ], - [ - "2016-01-01", - "2017-01-01" - ], - [ - "2017-01-01", - "2018-01-01" - ], - [ - "2018-01-01", - "2019-01-01" - ], - [ - "2019-01-01", - "2020-01-01" - ] - ], - "labels": [ - "2015", - "2016", - "2017", - "2018", - "2019" - ], - "reducer": { - "process_graph": { - "mean1": { - "process_id": "mean", - "arguments": { - "data": { - "from_parameter": "data" - } - }, - "result": true - } - } - } - } - } - ] + "tests": [] } diff --git a/tests/all.json5 b/tests/all.json5 index 1160e514..4fa5bc0f 100644 --- a/tests/all.json5 +++ b/tests/all.json5 @@ -6,7 +6,7 @@ "arguments": { "data": [ false, - null + {"type": "nodata"} ] }, "returns": false @@ -15,7 +15,7 @@ "arguments": { "data": [ true, - null + {"type": "nodata"} ] }, "returns": true @@ -24,7 +24,7 @@ "arguments": { "data": [ false, - null + {"type": "nodata"} ], "ignore_nodata": false }, @@ -34,11 +34,11 @@ "arguments": { "data": [ true, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -80,17 +80,17 @@ { "arguments": { "data": [ - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/and.json5 b/tests/and.json5 index ab124af5..fe6380bf 100644 --- a/tests/and.json5 +++ b/tests/and.json5 @@ -19,9 +19,9 @@ { "arguments": { "x": true, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -40,30 +40,30 @@ { "arguments": { "x": false, - "y": null + "y": {"type": "nodata"} }, "returns": false }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": true }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": false }, "returns": false }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/any.json5 b/tests/any.json5 index 7d352b43..ab480704 100644 --- a/tests/any.json5 +++ b/tests/any.json5 @@ -6,7 +6,7 @@ "arguments": { "data": [ false, - null + {"type": "nodata"} ] }, "returns": false @@ -15,7 +15,7 @@ "arguments": { "data": [ true, - null + {"type": "nodata"} ] }, "returns": true @@ -24,17 +24,17 @@ "arguments": { "data": [ false, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [ true, - null + {"type": "nodata"} ], "ignore_nodata": false }, @@ -80,17 +80,17 @@ { "arguments": { "data": [ - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/arccos.json5 b/tests/arccos.json5 index 24b4c84c..824352a4 100644 --- a/tests/arccos.json5 +++ b/tests/arccos.json5 @@ -64,9 +64,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/arcosh.json5 b/tests/arcosh.json5 index 7c378f9a..3e5ecca3 100644 --- a/tests/arcosh.json5 +++ b/tests/arcosh.json5 @@ -52,9 +52,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/arctan.json5 b/tests/arctan.json5 index 5a948970..cc193566 100644 --- a/tests/arctan.json5 +++ b/tests/arctan.json5 @@ -64,9 +64,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/arctan2.json5 b/tests/arctan2.json5 index f3930733..e733d8bf 100644 --- a/tests/arctan2.json5 +++ b/tests/arctan2.json5 @@ -130,24 +130,24 @@ }, { "arguments": { - "y": null, + "y": {"type": "nodata"}, "x": 1 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "y": 1, - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "y": null, - "x": null + "y": {"type": "nodata"}, + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/array_interpolate_linear.json5 b/tests/array_interpolate_linear.json5 index d8bde973..84e37d07 100644 --- a/tests/array_interpolate_linear.json5 +++ b/tests/array_interpolate_linear.json5 @@ -5,16 +5,16 @@ { "arguments": { "data": [ - null, + {"type": "nodata"}, 1, - null, + {"type": "nodata"}, 6, - null, + {"type": "nodata"}, -8, ] }, "returns": [ - null, + {"type": "nodata"}, 1, 3.5, 6, @@ -67,31 +67,31 @@ { "arguments": { "data": [ - null, + {"type": "nodata"}, 1, - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, "returns": [ - null, + {"type": "nodata"}, 1, - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, { "arguments": { "data": [ - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] }, "returns": [ - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] }, { @@ -143,7 +143,7 @@ }, { "key": 3, - "value": null + "value": {"type": "nodata"} }, { "key": 4, diff --git a/tests/arsinh.json5 b/tests/arsinh.json5 index 7b533601..0a169969 100644 --- a/tests/arsinh.json5 +++ b/tests/arsinh.json5 @@ -52,9 +52,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/artanh.json5 b/tests/artanh.json5 index 6d169e91..43fa89b2 100644 --- a/tests/artanh.json5 +++ b/tests/artanh.json5 @@ -64,9 +64,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/between.json5 b/tests/between.json5 index a2b8042a..fd8e5c02 100644 --- a/tests/between.json5 +++ b/tests/between.json5 @@ -4,11 +4,11 @@ "tests": [ { "arguments": { - "x": null, + "x": {"type": "nodata"}, "min": 0, "max": 1 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/ceil.json5 b/tests/ceil.json5 index fa042206..5f8d4013 100644 --- a/tests/ceil.json5 +++ b/tests/ceil.json5 @@ -58,9 +58,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/clip.json5 b/tests/clip.json5 index a74f9d5d..5e14903b 100644 --- a/tests/clip.json5 +++ b/tests/clip.json5 @@ -140,11 +140,11 @@ }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "min": -1, "max": 1 }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/constant.json5 b/tests/constant.json5 index b8644035..b6021c26 100644 --- a/tests/constant.json5 +++ b/tests/constant.json5 @@ -58,9 +58,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -82,9 +82,9 @@ }, { "arguments": { - "x": [0,NaN,null,false,""] + "x": [0,false,""] }, - "returns": [0,NaN,null,false,""] + "returns": [0,false,""] }, { "arguments": { diff --git a/tests/cos.json5 b/tests/cos.json5 index c718147e..af5f516e 100644 --- a/tests/cos.json5 +++ b/tests/cos.json5 @@ -46,9 +46,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/cosh.json5 b/tests/cosh.json5 index 74f5e9e1..0bc945ad 100644 --- a/tests/cosh.json5 +++ b/tests/cosh.json5 @@ -52,9 +52,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/count.json5 b/tests/count.json5 index 2bc9529c..01e5ea15 100644 --- a/tests/count.json5 +++ b/tests/count.json5 @@ -23,7 +23,7 @@ "arguments": { "data": [ "ABC", - null + {"type": "nodata"} ] }, "returns": 1 @@ -32,7 +32,7 @@ "arguments": { "data": [ false, - null + {"type": "nodata"} ], "condition": true }, @@ -47,7 +47,7 @@ 3, 4, 5, - null + {"type": "nodata"} ], "condition": { "gt": { @@ -74,7 +74,7 @@ 3, 4, 5, - null + {"type": "nodata"} ], "condition": { "gt": { diff --git a/tests/cummax.json5 b/tests/cummax.json5 index f983f5d4..d8498630 100644 --- a/tests/cummax.json5 +++ b/tests/cummax.json5 @@ -26,7 +26,7 @@ "data": [ 1, 3, - null, + {"type": "nodata"}, 5, 1 ] @@ -34,7 +34,7 @@ "returns": [ 1, 3, - null, + {"type": "nodata"}, 5, 5 ] @@ -44,7 +44,7 @@ "data": [ 1, 3, - null, + {"type": "nodata"}, 5, 1 ], @@ -53,9 +53,9 @@ "returns": [ 1, 3, - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/cummin.json5 b/tests/cummin.json5 index af89506d..2f571693 100644 --- a/tests/cummin.json5 +++ b/tests/cummin.json5 @@ -26,7 +26,7 @@ "data": [ 5, 3, - null, + {"type": "nodata"}, 1, 5 ] @@ -34,7 +34,7 @@ "returns": [ 5, 3, - null, + {"type": "nodata"}, 1, 1 ] @@ -44,7 +44,7 @@ "data": [ 5, 3, - null, + {"type": "nodata"}, 1, 5 ], @@ -53,9 +53,9 @@ "returns": [ 5, 3, - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/cumproduct.json5 b/tests/cumproduct.json5 index 835fbc8e..7edcbafc 100644 --- a/tests/cumproduct.json5 +++ b/tests/cumproduct.json5 @@ -27,7 +27,7 @@ 1, 2, 3, - null, + {"type": "nodata"}, 3, 1 ] @@ -36,7 +36,7 @@ 1, 2, 6, - null, + {"type": "nodata"}, 18, 18 ] @@ -47,7 +47,7 @@ 1, 2, 3, - null, + {"type": "nodata"}, 3, 1 ], @@ -57,9 +57,9 @@ 1, 2, 6, - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/cumsum.json5 b/tests/cumsum.json5 index ce92f2e6..66aec224 100644 --- a/tests/cumsum.json5 +++ b/tests/cumsum.json5 @@ -26,7 +26,7 @@ "data": [ 1, 3, - null, + {"type": "nodata"}, 3, 1 ] @@ -34,7 +34,7 @@ "returns": [ 1, 4, - null, + {"type": "nodata"}, 7, 8 ] @@ -44,7 +44,7 @@ "data": [ 1, 3, - null, + {"type": "nodata"}, 3, 1 ], @@ -53,9 +53,9 @@ "returns": [ 1, 4, - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/divide.json5 b/tests/divide.json5 index fa0c597a..f1ccd261 100644 --- a/tests/divide.json5 +++ b/tests/divide.json5 @@ -91,10 +91,10 @@ }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": 1 }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/eq.json5 b/tests/eq.json5 index a3fa8828..1e5a9b7c 100644 --- a/tests/eq.json5 +++ b/tests/eq.json5 @@ -87,16 +87,16 @@ { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/exp.json5 b/tests/exp.json5 index cad8d87f..6182b94d 100644 --- a/tests/exp.json5 +++ b/tests/exp.json5 @@ -52,9 +52,9 @@ }, { "arguments": { - "p": null + "p": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/extrema.json5 b/tests/extrema.json5 index 4ef7a2ed..6b068531 100644 --- a/tests/extrema.json5 +++ b/tests/extrema.json5 @@ -21,7 +21,7 @@ "data": [ 5, 2.5, - null, + {"type": "nodata"}, -0.7 ] }, @@ -36,14 +36,14 @@ 1, 0, 3, - null, + {"type": "nodata"}, 2 ], "ignore_nodata": false }, "returns": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, { @@ -102,13 +102,13 @@ ] }, { - // The input array is empty: return two `null` values. + // The input array is empty: return two `{"type": "nodata"}` values. "arguments": { "data": [] }, "returns": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/first.json5 b/tests/first.json5 index db301e36..0e2fb86e 100644 --- a/tests/first.json5 +++ b/tests/first.json5 @@ -16,7 +16,7 @@ { "arguments": { "data": [ - null, + {"type": "nodata"}, "A", "B" ] @@ -26,20 +26,20 @@ { "arguments": { "data": [ - null, + {"type": "nodata"}, 2, 3 ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [ - null, - null, - null, + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"}, -1 ] }, @@ -48,18 +48,18 @@ { "arguments": { "data": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, - "returns": null + "returns": {"type": "nodata"} }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/floor.json5 b/tests/floor.json5 index 997d8990..9ce88ea2 100644 --- a/tests/floor.json5 +++ b/tests/floor.json5 @@ -58,9 +58,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/gt.json5 b/tests/gt.json5 index db40afc6..479fc061 100644 --- a/tests/gt.json5 +++ b/tests/gt.json5 @@ -61,16 +61,16 @@ { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/gte.json5 b/tests/gte.json5 index aa82d7bd..32e22e50 100644 --- a/tests/gte.json5 +++ b/tests/gte.json5 @@ -75,16 +75,16 @@ { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/int.json5 b/tests/int.json5 index 879aa5ee..dd58effd 100644 --- a/tests/int.json5 +++ b/tests/int.json5 @@ -81,13 +81,13 @@ "arguments": { "x": NaN }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/is_infinite.json5 b/tests/is_infinite.json5 index 936234bd..64955a22 100644 --- a/tests/is_infinite.json5 +++ b/tests/is_infinite.json5 @@ -131,7 +131,7 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, "returns": false } diff --git a/tests/is_nan.json5 b/tests/is_nan.json5 index e130c521..7354fc02 100644 --- a/tests/is_nan.json5 +++ b/tests/is_nan.json5 @@ -82,7 +82,7 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, "returns": true } diff --git a/tests/is_nodata.json5 b/tests/is_nodata.json5 index 206852cd..4f6987e3 100644 --- a/tests/is_nodata.json5 +++ b/tests/is_nodata.json5 @@ -1,12 +1,10 @@ { "id": "is_nodata", "level": "L2", - // We can't check for other no-data values than `null` - // as it depends on the data cube / metadata / context, which can't influence "tests": [ { "arguments": { - "x": null + "x": {"type": "nodata"} }, "returns": true }, @@ -27,8 +25,8 @@ { "arguments": { "x": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, "returns": false diff --git a/tests/is_valid.json5 b/tests/is_valid.json5 index 2652076d..0c23fe71 100644 --- a/tests/is_valid.json5 +++ b/tests/is_valid.json5 @@ -16,15 +16,15 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, "returns": false }, { "arguments": { "x": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, "returns": true diff --git a/tests/last.json5 b/tests/last.json5 index b1a9623c..0508afd1 100644 --- a/tests/last.json5 +++ b/tests/last.json5 @@ -18,7 +18,7 @@ "data": [ "A", "B", - null + {"type": "nodata"} ] }, "returns": "B" @@ -28,19 +28,19 @@ "data": [ 0, 1, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [ -1, - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] }, "returns": -1 @@ -48,18 +48,18 @@ { "arguments": { "data": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, - "returns": null + "returns": {"type": "nodata"} }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/linear_scale_range.json5 b/tests/linear_scale_range.json5 index bccb71cd..95aabbc2 100644 --- a/tests/linear_scale_range.json5 +++ b/tests/linear_scale_range.json5 @@ -168,11 +168,11 @@ }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "inputMin": 0, "inputMax": 100 }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/ln.json5 b/tests/ln.json5 index 4a5c03f5..5016b5fd 100644 --- a/tests/ln.json5 +++ b/tests/ln.json5 @@ -59,9 +59,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/log.json5 b/tests/log.json5 index 23e00e78..3ac9a0a8 100644 --- a/tests/log.json5 +++ b/tests/log.json5 @@ -117,10 +117,10 @@ }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "base": 10 }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/lt.json5 b/tests/lt.json5 index d19efaa5..a8803d93 100644 --- a/tests/lt.json5 +++ b/tests/lt.json5 @@ -61,16 +61,16 @@ { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/lte.json5 b/tests/lte.json5 index ecf35492..b68a3f3a 100644 --- a/tests/lte.json5 +++ b/tests/lte.json5 @@ -75,16 +75,16 @@ { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/max.json5 b/tests/max.json5 index 04b766d4..b253e544 100644 --- a/tests/max.json5 +++ b/tests/max.json5 @@ -18,7 +18,7 @@ "data": [ 5, 2.5, - null, + {"type": "nodata"}, -0.7 ] }, @@ -30,12 +30,12 @@ 1, 0, 3, - null, + {"type": "nodata"}, 2 ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -81,11 +81,11 @@ "returns": 1.12345678903 }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/mean.json5 b/tests/mean.json5 index 625d9e47..865f0431 100644 --- a/tests/mean.json5 +++ b/tests/mean.json5 @@ -18,7 +18,7 @@ "data": [ 9, 2.5, - null, + {"type": "nodata"}, -2.5 ] }, @@ -83,38 +83,38 @@ "data": [ 1, 2, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} }, { - // The input array has only `null` elements: return `null`. + // The input array has only `{"type": "nodata"}` elements: return `{"type": "nodata"}`. "arguments": { "data": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/median.json5 b/tests/median.json5 index 8aa3ba9c..7b5260b7 100644 --- a/tests/median.json5 +++ b/tests/median.json5 @@ -88,7 +88,7 @@ "data": [ -1, -0.5, - null, + {"type": "nodata"}, 1 ] }, @@ -99,29 +99,29 @@ "data": [ -1, 0, - null, + {"type": "nodata"}, 1 ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} }, { - // The input array has only `null` elements: return `null`. + // The input array has only `{"type": "nodata"}` elements: return `{"type": "nodata"}`. "arguments": { "data": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/min.json5 b/tests/min.json5 index 3f246378..8d368d99 100644 --- a/tests/min.json5 +++ b/tests/min.json5 @@ -18,7 +18,7 @@ "data": [ 5, 2.5, - null, + {"type": "nodata"}, -0.7 ] }, @@ -30,12 +30,12 @@ 1, 0, 3, - null, + {"type": "nodata"}, 2 ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -81,11 +81,11 @@ "returns": 1.12345678901 }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/mod.json5 b/tests/mod.json5 index c7c15f18..1b003c6a 100644 --- a/tests/mod.json5 +++ b/tests/mod.json5 @@ -134,37 +134,37 @@ { "arguments": { "x": -Infinity, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": Infinity }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": 2 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "x": 2, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/multiply.json5 b/tests/multiply.json5 index ac433fc8..ac4505df 100644 --- a/tests/multiply.json5 +++ b/tests/multiply.json5 @@ -131,37 +131,37 @@ { "arguments": { "x": -Infinity, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": Infinity }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": 1 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/neq.json5 b/tests/neq.json5 index d0dd1c60..6a321fe2 100644 --- a/tests/neq.json5 +++ b/tests/neq.json5 @@ -87,16 +87,16 @@ { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/normalized_difference.json5 b/tests/normalized_difference.json5 index bc76508d..308d039f 100644 --- a/tests/normalized_difference.json5 +++ b/tests/normalized_difference.json5 @@ -25,10 +25,10 @@ }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": 1 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/not.json5 b/tests/not.json5 index 563e9556..afa62535 100644 --- a/tests/not.json5 +++ b/tests/not.json5 @@ -4,9 +4,9 @@ "tests": [ { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/or.json5 b/tests/or.json5 index f029e13b..84c0760b 100644 --- a/tests/or.json5 +++ b/tests/or.json5 @@ -19,7 +19,7 @@ { "arguments": { "x": true, - "y": null + "y": {"type": "nodata"} }, "returns": true }, @@ -40,30 +40,30 @@ { "arguments": { "x": false, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": true }, "returns": true }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/order.json5 b/tests/order.json5 index 0d1dfde9..4009f223 100644 --- a/tests/order.json5 +++ b/tests/order.json5 @@ -8,10 +8,10 @@ 6, -1, 2, - null, + {"type": "nodata"}, 7, 4, - null, + {"type": "nodata"}, 8, 3, 9, @@ -36,10 +36,10 @@ 6, -1, 2, - null, + {"type": "nodata"}, 7, 4, - null, + {"type": "nodata"}, 8, 3, 9, @@ -67,10 +67,10 @@ 6, -1, 2, - null, + {"type": "nodata"}, 7, 4, - null, + {"type": "nodata"}, 8, 3, 9, @@ -99,10 +99,10 @@ 6, -1, 2, - null, + {"type": "nodata"}, 7, 4, - null, + {"type": "nodata"}, 8, 3, 9, diff --git a/tests/power.json5 b/tests/power.json5 index 4615f538..65e1ac73 100644 --- a/tests/power.json5 +++ b/tests/power.json5 @@ -47,16 +47,16 @@ { "arguments": { "base": 1, - "p": null + "p": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "base": null, + "base": {"type": "nodata"}, "p": 2 }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/product.json5 b/tests/product.json5 index 5c08af5b..1367013f 100644 --- a/tests/product.json5 +++ b/tests/product.json5 @@ -24,7 +24,7 @@ { "arguments": { "data": [ - null, + {"type": "nodata"}, -2, -2.0, -2, @@ -37,11 +37,11 @@ "arguments": { "data": [ 1, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -54,17 +54,17 @@ { "arguments": { "data": [ - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/quantiles.json5 b/tests/quantiles.json5 index e6ffcc51..dc13bab4 100644 --- a/tests/quantiles.json5 +++ b/tests/quantiles.json5 @@ -129,7 +129,7 @@ "data": [ -1, -0.5, - null, + {"type": "nodata"}, 1 ], "probabilities": 2 @@ -143,16 +143,16 @@ "data": [ -1, -0.5, - null, + {"type": "nodata"}, 1 ], "probabilities": 4, "ignore_nodata": false }, "returns": [ - null, - null, - null + {"type": "nodata"}, + {"type": "nodata"}, + {"type": "nodata"} ] }, { @@ -196,8 +196,8 @@ ] }, "returns": [ - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 index 705442a4..677ffe32 100644 --- a/tests/reduce_dimension.json5 +++ b/tests/reduce_dimension.json5 @@ -72,8 +72,7 @@ "from_parameter": "data" }, "label": "red" - }, - "result": true + } }, "blue": { "process_id": "array_element", @@ -82,8 +81,7 @@ "from_parameter": "data" }, "label": "blue" - }, - "result": true + } }, "divide": { "process_id": "divide", diff --git a/tests/round.json5 b/tests/round.json5 index 0f0b6ff2..97c62d17 100644 --- a/tests/round.json5 +++ b/tests/round.json5 @@ -75,9 +75,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/sd.json5 b/tests/sd.json5 index 8dce5e9c..6288d0a4 100644 --- a/tests/sd.json5 +++ b/tests/sd.json5 @@ -8,7 +8,7 @@ -1, 1, 3, - null + {"type": "nodata"} ] }, "returns": 2 @@ -19,11 +19,11 @@ -1, 1, 3, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -74,11 +74,11 @@ "returns": NaN }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/sgn.json5 b/tests/sgn.json5 index 026ae03b..d5fd5b41 100644 --- a/tests/sgn.json5 +++ b/tests/sgn.json5 @@ -22,9 +22,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/sin.json5 b/tests/sin.json5 index 0103bcb2..391f710a 100644 --- a/tests/sin.json5 +++ b/tests/sin.json5 @@ -46,9 +46,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/sinh.json5 b/tests/sinh.json5 index f0a643a5..4a56089e 100644 --- a/tests/sinh.json5 +++ b/tests/sinh.json5 @@ -52,9 +52,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/sort.json5 b/tests/sort.json5 index a8d86a52..b88c330c 100644 --- a/tests/sort.json5 +++ b/tests/sort.json5 @@ -8,10 +8,10 @@ 6, -1, 2, - null, + {"type": "nodata"}, 7, 4, - null, + {"type": "nodata"}, 8, 3, 9, @@ -36,10 +36,10 @@ 6, -1, 2, - null, + {"type": "nodata"}, 7, 4, - null, + {"type": "nodata"}, 8, 3, 9, @@ -58,8 +58,8 @@ 3, 2, -1, - null, - null + {"type": "nodata"}, + {"type": "nodata"} ] } ] diff --git a/tests/sqrt.json5 b/tests/sqrt.json5 index c8f81358..6601c6f6 100644 --- a/tests/sqrt.json5 +++ b/tests/sqrt.json5 @@ -28,9 +28,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/subtract.json5 b/tests/subtract.json5 index 6eb9485a..481d0c1f 100644 --- a/tests/subtract.json5 +++ b/tests/subtract.json5 @@ -110,30 +110,30 @@ { "arguments": { "x": Infinity, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": -Infinity }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "x": 1, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": -1 }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/sum.json5 b/tests/sum.json5 index 2054f87d..b5e54054 100644 --- a/tests/sum.json5 +++ b/tests/sum.json5 @@ -24,7 +24,7 @@ { "arguments": { "data": [ - null, + {"type": "nodata"}, -2, -2, 0 @@ -36,11 +36,11 @@ "arguments": { "data": [ 1, - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -53,17 +53,17 @@ { "arguments": { "data": [ - null + {"type": "nodata"} ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { diff --git a/tests/tan.json5 b/tests/tan.json5 index 393f9f24..7aae6d87 100644 --- a/tests/tan.json5 +++ b/tests/tan.json5 @@ -46,9 +46,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/tanh.json5 b/tests/tanh.json5 index 44601862..e469c217 100644 --- a/tests/tanh.json5 +++ b/tests/tanh.json5 @@ -46,9 +46,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/text_begins.json5 b/tests/text_begins.json5 index b0cffdd9..e8b84243 100644 --- a/tests/text_begins.json5 +++ b/tests/text_begins.json5 @@ -41,10 +41,10 @@ }, { "arguments": { - "data": null, + "data": {"type": "nodata"}, "pattern": "null" }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/text_contains.json5 b/tests/text_contains.json5 index db5dbc09..e23ef6a3 100644 --- a/tests/text_contains.json5 +++ b/tests/text_contains.json5 @@ -41,10 +41,10 @@ }, { "arguments": { - "data": null, + "data": {"type": "nodata"}, "pattern": "null" }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/text_ends.json5 b/tests/text_ends.json5 index 5a0f6933..d79082f5 100644 --- a/tests/text_ends.json5 +++ b/tests/text_ends.json5 @@ -41,10 +41,10 @@ }, { "arguments": { - "data": null, + "data": {"type": "nodata"}, "pattern": "null" }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/variance.json5 b/tests/variance.json5 index 17ab2812..f4c7c469 100644 --- a/tests/variance.json5 +++ b/tests/variance.json5 @@ -18,7 +18,7 @@ 2, 3, 3, - null, + {"type": "nodata"}, 4, 4, 5 @@ -31,12 +31,12 @@ "data": [ -1, 1, - null, + {"type": "nodata"}, 3 ], "ignore_nodata": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -87,11 +87,11 @@ "returns": NaN }, { - // The input array is empty: return `null`. + // The input array is empty: return `{"type": "nodata"}`. "arguments": { "data": [] }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/xor.json5 b/tests/xor.json5 index b4cba17d..3cfa372d 100644 --- a/tests/xor.json5 +++ b/tests/xor.json5 @@ -19,9 +19,9 @@ { "arguments": { "x": true, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { @@ -40,30 +40,30 @@ { "arguments": { "x": false, - "y": null + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": true }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, + "x": {"type": "nodata"}, "y": false }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { - "x": null, - "y": null + "x": {"type": "nodata"}, + "y": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } From 5ab0d8b4219431de9cd43f45615a06955c30ac78 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 15 Dec 2023 00:06:17 +0100 Subject: [PATCH 28/39] Add filter_bands and filter_temporal --- tests/README.md | 4 +- tests/assets/xyt-more-timestamps.json5 | 58 +++++++ tests/filter_bands.json5 | 154 ++++++++++++++++++- tests/filter_temporal.json5 | 201 ++++++++++++++++++++++++- 4 files changed, 413 insertions(+), 4 deletions(-) create mode 100644 tests/assets/xyt-more-timestamps.json5 diff --git a/tests/README.md b/tests/README.md index e1314982..093b75a7 100644 --- a/tests/README.md +++ b/tests/README.md @@ -63,11 +63,11 @@ This folder contains test cases for the openEO processes. - [x] eq - [x] exp - [x] extrema -- [ ] filter_bands +- [x] filter_bands* - [ ] filter_bbox - [ ] filter_labels (experimental) - [ ] filter_spatial -- [ ] filter_temporal +- [x] filter_temporal* - [ ] filter_vector (experimental) - [x] first - [ ] flatten_dimensions (experimental) diff --git a/tests/assets/xyt-more-timestamps.json5 b/tests/assets/xyt-more-timestamps.json5 new file mode 100644 index 00000000..cda0cddf --- /dev/null +++ b/tests/assets/xyt-more-timestamps.json5 @@ -0,0 +1,58 @@ +{ + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": [ + "2020-06-01T00:00:00Z", + "2020-06-03T00:00:00Z", + "2020-06-05T00:00:00Z", + "2020-06-07T00:00:00Z", + "2020-06-09T00:00:00Z" + ] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] +} diff --git a/tests/filter_bands.json5 b/tests/filter_bands.json5 index c9e42b84..61bd447f 100644 --- a/tests/filter_bands.json5 +++ b/tests/filter_bands.json5 @@ -1,5 +1,157 @@ { "id": "filter_bands", "level": "L2A", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + } + }, + "throws": "BandFilterParameterMissing", + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "bands": [ + "test" + ] + }, + "throws": "DimensionMissing", + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "bands": [ + "foo" + ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": [] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "bands": [ + "red", + "blue" + ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["red", "blue"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 0, 242] + ], + [ + [174, 88, 81, 165], + [25, 77, 72, 9], + [148, 115, 0, 208] + ] + ] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "bands": [ + "red", + "blue" + ] + }, + "returns": { + "type": "datacube", + "nodata": 0, + "dimensions": [ + { + "name": "bands", + "type": "bands", + "values": ["blue", "green"] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [174, 88, 81, 165], + [25, 77, 72, 9], + [148, 115, 0, 208] + ], + [ + [36, 87, 70, 216], + [88, 140, 58, 193], + [230, 39, 0, 87] + ] + ] + } + } + ] } diff --git a/tests/filter_temporal.json5 b/tests/filter_temporal.json5 index fcf0c8a7..545c6cfd 100644 --- a/tests/filter_temporal.json5 +++ b/tests/filter_temporal.json5 @@ -1,5 +1,204 @@ { "id": "filter_temporal", "level": "L2", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + "2016-01-01", + "2015-01-01", + ] + }, + "throws": "TemporalExtentEmpty" + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + "2015-01-01", + "2016-01-01" + ], + "dimension": "time" + }, + "throws": "DimensionNotAvailable", + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "extent": [ + "2015-01-01", + "2016-01-01" + ] + }, + "throws": "DimensionNotAvailable", + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + "2020-06-01T00:00:00Z", + "2020-06-05T00:00:00Z", + ] + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": [ + "2020-06-01T00:00:00Z", + "2020-06-03T00:00:00Z" + ] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ] + ] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + "2020-06-08", + null + ] + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": [ + "2020-06-09T00:00:00Z" + ] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + "2021-01-01", + null + ] + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "t", + "type": "temporal", + "values": [] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + "2010-01-01T00:00:00Z", + "2030-01-01T00:00:00Z" + ] + }, + "returns": { + "$ref": "assets/xyt-more-timestamps.json5" + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "extent": [ + null, + "2022-01-01T00:00:00Z" + ] + }, + "returns": { + "$ref": "assets/xyt-more-timestamps.json5" + } + } + ] } From 932de0f0f18b445d655eac76892718776ed74199 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 15 Dec 2023 15:51:44 +0100 Subject: [PATCH 29/39] Add mask, merge_cubes, refactor datacube object --- tests/README.md | 23 +- tests/add_dimension.json5 | 68 +++--- tests/apply.json5 | 52 ++--- tests/apply_dimension.json5 | 30 +-- tests/assets/xyb-enumerated-bands.json5 | 23 +- ...one-band.json5 => xyb-mask-one-band.json5} | 22 +- tests/assets/xyb-mask.json5 | 23 ++ tests/assets/xyb-minimal-int.json5 | 24 +- tests/assets/xyt-minimal-float.json5 | 14 +- tests/assets/xyt-more-timestamps.json5 | 14 +- tests/assets/xytb-s2-small.json5 | 17 +- tests/create_data_cube.json5 | 3 +- tests/drop_dimension.json5 | 27 +-- tests/filter_bands.json5 | 62 +++--- tests/filter_temporal.json5 | 44 ++-- tests/mask.json5 | 149 ++++++++++++- tests/merge_cubes.json5 | 208 +++++++++++++++++- tests/reduce_dimension.json5 | 24 +- tests/rename_dimension.json5 | 56 ++--- tests/rename_labels.json5 | 66 +++--- 20 files changed, 613 insertions(+), 336 deletions(-) rename tests/assets/{xyb-one-band.json5 => xyb-mask-one-band.json5} (64%) create mode 100644 tests/assets/xyb-mask.json5 diff --git a/tests/README.md b/tests/README.md index 093b75a7..ab5921f3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -86,12 +86,12 @@ This folder contains test cases for the openEO processes. - [x] log - [x] lt - [x] lte -- [ ] mask +- [x] mask* - [ ] mask_polygon - [x] max - [x] mean - [x] median -- [ ] merge_cubes +- [x] merge_cubes* - [x] min - [x] mod - [x] multiply @@ -334,33 +334,30 @@ Vector datacubes are currently not supported. "nodata": [ NaN ], - "dimensions": [ + "order": ["bands", "t", "y", "x"], + "dimensions": { // similar to the STAC datacube extension - // properties: name, type, axis (if type = spatial), values, and reference_system (optional) - { - "name": "bands", + // properties: type, axis (if type = spatial), values, and reference_system (optional) + "bands": { "type": "bands", "values": ["blue","green","red","nir"] }, - { - "name": "t", + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z","2020-06-03T00:00:00Z","2020-06-06T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0,5757485.0,5757475.0,5757465.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0,404845.0,404855.0,404865.0,404875.0], "reference_system": "EPSG:25832" } - ] + } } ``` diff --git a/tests/add_dimension.json5 b/tests/add_dimension.json5 index 534bb139..71bbe266 100644 --- a/tests/add_dimension.json5 +++ b/tests/add_dimension.json5 @@ -14,32 +14,29 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "b", + "order": ["b", "t", "y", "x"], + "dimensions": { + "b": { "type": "bands", "values": ["B1"] }, - { - "name": "t", + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -55,32 +52,29 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "t", + "order": ["t", "bands", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-01-01T00:00:00Z"] }, - { - "name": "bands", + "bands": { "type": "bands", "values": ["red", "green", "blue"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -96,32 +90,29 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "t2", + "order": ["t2", "t", "y", "x"], + "dimensions": { + "t2": { "type": "temporal", "values": ["2010-01-01T00:00:00.0Z"] }, - { - "name": "t", + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -137,32 +128,29 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "var", + "order": ["var", "t", "y", "x"], + "dimensions": { + "var": { "type": "other", "values": [1] }, - { - "name": "t", + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, diff --git a/tests/apply.json5 b/tests/apply.json5 index 3b5913f6..f6fb3ff1 100644 --- a/tests/apply.json5 +++ b/tests/apply.json5 @@ -29,27 +29,25 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [18.5, 54.75, -26.1, -63.25], @@ -113,27 +111,23 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", - "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", - "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [false, true, false, true], @@ -178,43 +172,41 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["red", "green", "blue"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [1720, 470, 1170, 1920], [670, 2510, 1950, 1030], - [90, 2110, 0, 2420] + [90, 2110, 255, 2420] ], [ [360, 870, 700, 2160], [880, 1400, 580, 1930], - [2300, 390, 0, 870] + [2300, 390, 255, 870] ], [ [1740, 880, 810, 1650], [250, 770, 720, 90], - [1480, 1150, 0, 2080] + [1480, 1150, 255, 2080] ] ] } diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 index 7e733083..bc296d78 100644 --- a/tests/apply_dimension.json5 +++ b/tests/apply_dimension.json5 @@ -28,27 +28,25 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [-63.65, 9.0 , -68.52, -64.25], @@ -91,27 +89,23 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "quantiles", + "order": ["quantiles", "y", "x"], + "dimensions": { + "quantiles": { "type": "other", "values": [0, 1, 2] }, - { - "name": "y", + "y": { "type": "spatial", - "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", - "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [172.0, 87.0, 81.0, 192.0], diff --git a/tests/assets/xyb-enumerated-bands.json5 b/tests/assets/xyb-enumerated-bands.json5 index db6e9ec4..ec3b4d08 100644 --- a/tests/assets/xyb-enumerated-bands.json5 +++ b/tests/assets/xyb-enumerated-bands.json5 @@ -1,42 +1,41 @@ { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": [0, 1, 2] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, + "order": ["bands", "y", "x"], "data": [ [ [172, 47, 117, 192], [67, 251, 195, 103], - [9, 211, 0, 242] + [9, 211, 255, 242] ], [ [36, 87, 70, 216], [88, 140, 58, 193], - [230, 39, 0, 87] + [230, 39, 255, 87] ], [ [174, 88, 81, 165], [25, 77, 72, 9], - [148, 115, 0, 208] + [148, 115, 255, 208] ] ] } diff --git a/tests/assets/xyb-one-band.json5 b/tests/assets/xyb-mask-one-band.json5 similarity index 64% rename from tests/assets/xyb-one-band.json5 rename to tests/assets/xyb-mask-one-band.json5 index 159c747f..26049736 100644 --- a/tests/assets/xyb-one-band.json5 +++ b/tests/assets/xyb-mask-one-band.json5 @@ -1,31 +1,29 @@ { "type": "datacube", - "dimensions": [ - { - "name": "bands", + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", - "values": ["red"] + "values": ["mask"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ - [172, 47, 117, 192], - [67, 251, 195, 103], - [9, 211, 0, 242] + [1, 1, 1, 1], + [1, 0, 0, 1], + [0, 0, 1, 0] ] ] } diff --git a/tests/assets/xyb-mask.json5 b/tests/assets/xyb-mask.json5 new file mode 100644 index 00000000..a067b55e --- /dev/null +++ b/tests/assets/xyb-mask.json5 @@ -0,0 +1,23 @@ +{ + "type": "datacube", + "order": ["y", "x"], + "dimensions": { + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [1, 1, 1, 1], + [1, 0, 0, 1], + [0, 0, 1, 0] + ] +} diff --git a/tests/assets/xyb-minimal-int.json5 b/tests/assets/xyb-minimal-int.json5 index 6ed0d6f5..63e17194 100644 --- a/tests/assets/xyb-minimal-int.json5 +++ b/tests/assets/xyb-minimal-int.json5 @@ -1,42 +1,40 @@ { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["red", "green", "blue"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [172, 47, 117, 192], [67, 251, 195, 103], - [9, 211, 0, 242] + [9, 211, 255, 242] ], [ [36, 87, 70, 216], [88, 140, 58, 193], - [230, 39, 0, 87] + [230, 39, 255, 87] ], [ - [174, 88, 81, 165], + [174, 88, 81, 255], [25, 77, 72, 9], - [148, 115, 0, 208] + [148, 115, 255, 208] ] ] } diff --git a/tests/assets/xyt-minimal-float.json5 b/tests/assets/xyt-minimal-float.json5 index a8c8adfc..0b2a27bc 100644 --- a/tests/assets/xyt-minimal-float.json5 +++ b/tests/assets/xyt-minimal-float.json5 @@ -1,27 +1,25 @@ { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [17.5, 53.75, -27.1, -64.25], diff --git a/tests/assets/xyt-more-timestamps.json5 b/tests/assets/xyt-more-timestamps.json5 index cda0cddf..02d08c5e 100644 --- a/tests/assets/xyt-more-timestamps.json5 +++ b/tests/assets/xyt-more-timestamps.json5 @@ -1,9 +1,9 @@ { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": [ "2020-06-01T00:00:00Z", @@ -13,21 +13,19 @@ "2020-06-09T00:00:00Z" ] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [17.5, 53.75, -27.1, -64.25], diff --git a/tests/assets/xytb-s2-small.json5 b/tests/assets/xytb-s2-small.json5 index 4eec6239..4df1037b 100644 --- a/tests/assets/xytb-s2-small.json5 +++ b/tests/assets/xytb-s2-small.json5 @@ -1,30 +1,27 @@ { "type": "datacube", - "dimensions": [ - { - "name": "bands", + "order": ["bands", "t", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["blue", "green", "red", "nir"] }, - { - "name": "t", + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0, 5757465.0, 5757455.0, 5757445.0, 5757435.0, 5757425.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0, 404875.0, 404885.0, 404895.0, 404905.0, 404915.0], "reference_system": "EPSG:25832" } - ], + }, "data": [[[[770.0, 780.0, 838.0, 1037.0, 1087.0, 1124.0, 1197.0, 1182.0, 1014.0], [860.0, 799.0, 778.0, 921.0, 1030.0, 1051.0, 1138.0, 1059.0, 1044.0], [1007.0, 815.0, 775.0, 793.0, 796.0, 795.0, 905.0, 1043.0, 1098.0], [956.0, 898.0, 782.0, 774.0, 774.0, 804.0, 831.0, 995.0, 1023.0], [882.0, 1105.0, 946.0, 760.0, 805.0, 839.0, 870.0, 951.0, 1010.0], [816.0, 964.0, 1132.0, 849.0, 798.0, 835.0, 980.0, 1012.0, 1015.0], [844.0, 864.0, 1079.0, 929.0, 804.0, 817.0, 1004.0, 1074.0, 1144.0], [832.0, 816.0, 893.0, 956.0, 807.0, 793.0, 875.0, 1106.0, 1200.0]], [[2049.0, 2006.0, 1990.0, 2006.0, 2005.0, 2000.0, 2015.0, 2015.0, 2027.0], [2041.0, 2013.0, 1979.0, 1969.0, 1965.0, 1979.0, 2025.0, 2032.0, 2012.0], [2005.0, 2009.0, 1979.0, 1950.0, 1963.0, 1988.0, 2021.0, 2049.0, 2051.0], [1997.0, 1999.0, 1996.0, 1976.0, 2021.0, 2026.0, 2055.0, 2087.0, 2088.0], [1970.0, 1990.0, 2025.0, 2027.0, 2039.0, 2057.0, 2090.0, 2094.0, 2115.0], [1964.0, 1971.0, 2044.0, 2107.0, 2094.0, 2099.0, 2135.0, 2155.0, 2159.0], [1963.0, 1977.0, 2059.0, 2132.0, 2137.0, 2146.0, 2181.0, 2203.0, 2182.0], [1980.0, 2029.0, 2067.0, 2156.0, 2175.0, 2183.0, 2189.0, 2196.0, 2187.0]], [[5465.0, 5864.0, 6180.0, 6379.0, 6360.0, 6253.0, 6205.0, 6092.0, 5834.0], [5736.0, 6040.0, 6264.0, 6261.0, 5995.0, 5545.0, 5389.0, 5386.0, 5362.0], [6038.0, 6265.0, 6324.0, 6016.0, 5738.0, 5521.0, 5135.0, 5033.0, 5271.0], [6145.0, 6245.0, 6098.0, 5732.0, 5519.0, 5519.0, 5318.0, 5147.0, 5228.0], [6038.0, 6009.0, 5828.0, 5558.0, 5466.0, 5475.0, 5387.0, 5290.0, 5325.0], [5941.0, 5853.0, 5749.0, 5564.0, 5459.0, 5419.0, 5371.0, 5397.0, 5483.0], [6133.0, 6008.0, 5841.0, 5643.0, 5475.0, 5368.0, 5388.0, 5503.0, 5623.0], [6117.0, 6058.0, 5913.0, 5668.0, 5476.0, 5480.0, 5644.0, 5799.0, 5815.0]], [[7200.0, 7226.0, 7254.0, 7246.0, 7317.0, 7301.0, 7279.0, 7274.0, 7232.0], [7258.0, 7253.0, 7294.0, 7303.0, 7281.0, 7292.0, 7320.0, 7246.0, 7258.0], [7227.0, 7228.0, 7319.0, 7288.0, 7258.0, 7270.0, 7282.0, 7253.0, 7285.0], [7199.0, 7212.0, 7227.0, 7206.0, 7194.0, 7154.0, 7185.0, 7166.0, 7191.0], [7115.0, 7170.0, 7170.0, 7128.0, 7115.0, 7085.0, 7013.0, 7027.0, 6978.0], [6976.0, 7094.0, 7109.0, 7097.0, 7080.0, 7002.0, 6936.0, 6909.0, 6806.0], [6944.0, 7036.0, 7025.0, 7033.0, 7036.0, 6967.0, 6905.0, 6821.0, 6726.0], [6994.0, 6988.0, 6988.0, 6923.0, 6923.0, 6926.0, 6907.0, 6836.0, 6702.0]], [[1787.0, 1764.0, 1717.0, 1714.0, 1785.0, 1908.0, 1998.0, 2100.0, 2609.0], [1798.0, 1602.0, 1560.0, 1561.0, 1690.0, 1840.0, 1930.0, 2128.0, 2702.0], [1697.0, 1560.0, 1484.0, 1523.0, 1646.0, 1757.0, 1789.0, 2045.0, 2553.0], [1440.0, 1509.0, 1504.0, 1615.0, 1655.0, 1698.0, 1730.0, 1998.0, 2444.0], [1287.0, 1428.0, 1596.0, 1645.0, 1576.0, 1587.0, 1761.0, 2310.0, 2563.0], [1310.0, 1376.0, 1586.0, 1594.0, 1516.0, 1414.0, 1719.0, 2359.0, 2543.0], [1371.0, 1439.0, 1505.0, 1435.0, 1335.0, 1305.0, 1827.0, 2532.0, 2633.0], [1324.0, 1459.0, 1385.0, 1285.0, 1176.0, 1264.0, 1809.0, 2724.0, 2918.0]], [[964.0, 961.0, 977.0, 1083.0, 1250.0, 1207.0, 1302.0, 1278.0, 1162.0], [1099.0, 1052.0, 961.0, 1006.0, 1114.0, 1102.0, 1227.0, 1185.0, 1275.0], [1129.0, 1085.0, 937.0, 962.0, 958.0, 950.0, 1054.0, 1202.0, 1235.0], [993.0, 1116.0, 1020.0, 977.0, 969.0, 983.0, 1012.0, 1104.0, 1179.0], [983.0, 1106.0, 1215.0, 980.0, 983.0, 1006.0, 1049.0, 1126.0, 1186.0], [979.0, 998.0, 1188.0, 1128.0, 967.0, 986.0, 1090.0, 1187.0, 1177.0], [994.0, 974.0, 1064.0, 1170.0, 1003.0, 965.0, 1064.0, 1191.0, 1261.0], [956.0, 959.0, 989.0, 1083.0, 1033.0, 981.0, 980.0, 1118.0, 1246.0]]], [[[620.0, 687.0, 774.0, 971.0, 983.0, 1030.0, 1071.0, 1023.0, 985.0], [817.0, 677.0, 687.0, 806.0, 886.0, 850.0, 962.0, 935.0, 924.0], [958.0, 705.0, 650.0, 636.0, 627.0, 591.0, 795.0, 885.0, 906.0], [791.0, 929.0, 736.0, 659.0, 635.0, 675.0, 797.0, 837.0, 835.0], [758.0, 1101.0, 877.0, 686.0, 704.0, 823.0, 915.0, 830.0, 808.0], [689.0, 956.0, 1064.0, 710.0, 739.0, 773.0, 898.0, 937.0, 840.0], [753.0, 807.0, 1065.0, 921.0, 709.0, 687.0, 895.0, 1049.0, 954.0], [697.0, 703.0, 814.0, 911.0, 716.0, 696.0, 749.0, 1007.0, 1070.0]], [[1979.0, 1940.0, 1900.0, 1905.0, 1914.0, 1900.0, 1891.0, 1903.0, 1906.0], [1900.0, 1833.0, 1772.0, 1778.0, 1801.0, 1816.0, 1834.0, 1836.0, 1876.0], [1847.0, 1800.0, 1763.0, 1772.0, 1764.0, 1765.0, 1811.0, 1839.0, 1848.0], [1819.0, 1813.0, 1793.0, 1742.0, 1748.0, 1765.0, 1791.0, 1814.0, 1810.0], [1793.0, 1809.0, 1800.0, 1745.0, 1755.0, 1788.0, 1792.0, 1764.0, 1790.0], [1798.0, 1767.0, 1773.0, 1772.0, 1756.0, 1789.0, 1799.0, 1768.0, 1765.0], [1780.0, 1761.0, 1804.0, 1815.0, 1797.0, 1822.0, 1826.0, 1821.0, 1802.0], [1766.0, 1809.0, 1838.0, 1852.0, 1848.0, 1863.0, 1874.0, 1864.0, 1836.0]], [[5573.0, 5880.0, 6129.0, 6301.0, 6300.0, 6244.0, 6295.0, 6313.0, 6303.0], [5619.0, 5899.0, 6097.0, 6162.0, 6154.0, 6128.0, 6053.0, 5872.0, 5898.0], [5673.0, 5945.0, 6069.0, 5847.0, 5532.0, 5515.0, 5408.0, 5229.0, 5216.0], [5882.0, 6026.0, 5857.0, 5499.0, 5058.0, 4818.0, 4802.0, 5005.0, 5011.0], [6008.0, 5919.0, 5500.0, 5321.0, 5173.0, 4918.0, 4792.0, 4987.0, 5016.0], [5809.0, 5635.0, 5313.0, 5206.0, 5181.0, 4998.0, 4925.0, 4943.0, 5052.0], [5557.0, 5435.0, 5231.0, 5168.0, 5154.0, 5020.0, 5025.0, 5077.0, 5176.0], [5514.0, 5427.0, 5291.0, 5196.0, 5100.0, 5011.0, 5130.0, 5221.0, 5352.0]], [[6820.0, 6828.0, 6823.0, 6802.0, 6809.0, 6799.0, 6767.0, 6719.0, 6707.0], [6765.0, 6812.0, 6831.0, 6844.0, 6853.0, 6837.0, 6820.0, 6771.0, 6726.0], [6835.0, 6845.0, 6859.0, 6871.0, 6876.0, 6867.0, 6839.0, 6778.0, 6756.0], [6883.0, 6871.0, 6874.0, 6865.0, 6855.0, 6859.0, 6865.0, 6810.0, 6826.0], [6813.0, 6841.0, 6862.0, 6851.0, 6799.0, 6800.0, 6821.0, 6785.0, 6747.0], [6809.0, 6829.0, 6770.0, 6763.0, 6735.0, 6704.0, 6687.0, 6660.0, 6651.0], [6686.0, 6752.0, 6735.0, 6726.0, 6681.0, 6584.0, 6551.0, 6515.0, 6485.0], [6571.0, 6670.0, 6691.0, 6669.0, 6621.0, 6505.0, 6505.0, 6422.0, 6356.0]], [[1644.0, 1672.0, 1653.0, 1703.0, 1729.0, 1795.0, 1793.0, 1843.0, 2309.0], [1702.0, 1547.0, 1469.0, 1435.0, 1508.0, 1638.0, 1746.0, 1944.0, 2458.0], [1667.0, 1484.0, 1353.0, 1329.0, 1466.0, 1576.0, 1645.0, 1839.0, 2423.0], [1431.0, 1419.0, 1366.0, 1416.0, 1471.0, 1511.0, 1562.0, 1774.0, 2349.0], [1203.0, 1307.0, 1476.0, 1493.0, 1433.0, 1446.0, 1597.0, 1955.0, 2346.0], [1184.0, 1248.0, 1484.0, 1481.0, 1369.0, 1321.0, 1526.0, 2136.0, 2468.0], [1215.0, 1286.0, 1405.0, 1368.0, 1229.0, 1197.0, 1507.0, 2294.0, 2460.0], [1219.0, 1329.0, 1307.0, 1186.0, 1080.0, 1090.0, 1571.0, 2488.0, 2620.0]], [[821.0, 833.0, 857.0, 997.0, 1091.0, 1079.0, 1120.0, 1113.0, 1097.0], [987.0, 909.0, 821.0, 847.0, 935.0, 927.0, 1025.0, 1083.0, 1105.0], [1032.0, 991.0, 798.0, 796.0, 765.0, 765.0, 851.0, 1031.0, 1028.0], [871.0, 1077.0, 969.0, 799.0, 819.0, 907.0, 935.0, 978.0, 921.0], [846.0, 1028.0, 1091.0, 880.0, 853.0, 927.0, 1000.0, 967.0, 928.0], [807.0, 888.0, 1138.0, 1015.0, 862.0, 872.0, 967.0, 1027.0, 961.0], [874.0, 817.0, 1012.0, 1074.0, 877.0, 829.0, 892.0, 1097.0, 1105.0], [841.0, 798.0, 874.0, 966.0, 953.0, 843.0, 847.0, 1004.0, 1120.0]]], [[[384.0, 378.0, 455.0, 789.0, 911.0, 943.0, 974.0, 975.0, 850.0], [512.0, 413.0, 380.0, 560.0, 726.0, 714.0, 877.0, 852.0, 772.0], [781.0, 452.0, 356.0, 407.0, 452.0, 439.0, 568.0, 750.0, 802.0], [621.0, 686.0, 452.0, 398.0, 402.0, 400.0, 487.0, 699.0, 721.0], [517.0, 876.0, 655.0, 380.0, 414.0, 445.0, 529.0, 680.0, 688.0], [448.0, 769.0, 924.0, 490.0, 386.0, 469.0, 706.0, 819.0, 730.0], [455.0, 469.0, 889.0, 691.0, 403.0, 441.0, 738.0, 971.0, 927.0], [429.0, 413.0, 569.0, 663.0, 427.0, 406.0, 553.0, 957.0, 1039.0]], [[2022.0, 2013.0, 1994.0, 1947.0, 1890.0, 1848.0, 1828.0, 1826.0, 1813.0], [1998.0, 1980.0, 1947.0, 1916.0, 1877.0, 1838.0, 1814.0, 1819.0, 1819.0], [1933.0, 1897.0, 1886.0, 1867.0, 1822.0, 1788.0, 1791.0, 1812.0, 1834.0], [1824.0, 1803.0, 1803.0, 1781.0, 1748.0, 1736.0, 1771.0, 1799.0, 1807.0], [1693.0, 1690.0, 1742.0, 1707.0, 1686.0, 1683.0, 1717.0, 1771.0, 1777.0], [1681.0, 1674.0, 1703.0, 1670.0, 1654.0, 1676.0, 1690.0, 1759.0, 1776.0], [1665.0, 1642.0, 1677.0, 1692.0, 1645.0, 1643.0, 1672.0, 1731.0, 1774.0], [1651.0, 1646.0, 1637.0, 1668.0, 1660.0, 1631.0, 1643.0, 1683.0, 1754.0]], [[6446.0, 6649.0, 6776.0, 6921.0, 7022.0, 7121.0, 7217.0, 7214.0, 7195.0], [6381.0, 6639.0, 6834.0, 6845.0, 6790.0, 6874.0, 6936.0, 6876.0, 6869.0], [6374.0, 6639.0, 6708.0, 6706.0, 6719.0, 6627.0, 6561.0, 6573.0, 6555.0], [6392.0, 6543.0, 6400.0, 6178.0, 6112.0, 5961.0, 5751.0, 5711.0, 5812.0], [6442.0, 6360.0, 5966.0, 5448.0, 5243.0, 5261.0, 5322.0, 5314.0, 5245.0], [6406.0, 6037.0, 5704.0, 5446.0, 5119.0, 5051.0, 5286.0, 5335.0, 5180.0], [6068.0, 5691.0, 5545.0, 5488.0, 5273.0, 5159.0, 5261.0, 5318.0, 5294.0], [5802.0, 5541.0, 5457.0, 5450.0, 5305.0, 5297.0, 5326.0, 5452.0, 5570.0]], [[7168.0, 7178.0, 7176.0, 7125.0, 7102.0, 7102.0, 7058.0, 7047.0, 7050.0], [7162.0, 7168.0, 7148.0, 7113.0, 7099.0, 7116.0, 7092.0, 7031.0, 7014.0], [7136.0, 7135.0, 7127.0, 7176.0, 7158.0, 7156.0, 7119.0, 7047.0, 7048.0], [7169.0, 7189.0, 7186.0, 7189.0, 7174.0, 7208.0, 7173.0, 7118.0, 7064.0], [7208.0, 7233.0, 7248.0, 7212.0, 7206.0, 7219.0, 7183.0, 7155.0, 7083.0], [7176.0, 7181.0, 7223.0, 7228.0, 7190.0, 7177.0, 7167.0, 7152.0, 7098.0], [7174.0, 7207.0, 7198.0, 7141.0, 7118.0, 7095.0, 7065.0, 7052.0, 6986.0], [7117.0, 7128.0, 7116.0, 7066.0, 7000.0, 6950.0, 6941.0, 6885.0, 6820.0]], [[1563.0, 1631.0, 1629.0, 1759.0, 1888.0, 1824.0, 1704.0, 1735.0, 2190.0], [1621.0, 1490.0, 1404.0, 1336.0, 1417.0, 1541.0, 1647.0, 1791.0, 2374.0], [1580.0, 1332.0, 1201.0, 1205.0, 1313.0, 1464.0, 1555.0, 1742.0, 2490.0], [1287.0, 1282.0, 1177.0, 1208.0, 1289.0, 1378.0, 1423.0, 1699.0, 2363.0], [993.0, 1200.0, 1277.0, 1279.0, 1309.0, 1317.0, 1379.0, 1741.0, 2291.0], [874.0, 1047.0, 1333.0, 1301.0, 1230.0, 1186.0, 1374.0, 2044.0, 2398.0], [952.0, 1005.0, 1258.0, 1211.0, 1041.0, 967.0, 1342.0, 2194.0, 2399.0], [950.0, 1057.0, 1127.0, 999.0, 835.0, 817.0, 1400.0, 2354.0, 2531.0]], [[503.0, 510.0, 550.0, 727.0, 948.0, 960.0, 1034.0, 1016.0, 934.0], [735.0, 674.0, 490.0, 573.0, 726.0, 698.0, 851.0, 930.0, 981.0], [740.0, 690.0, 502.0, 523.0, 513.0, 516.0, 643.0, 875.0, 898.0], [587.0, 787.0, 667.0, 536.0, 502.0, 507.0, 590.0, 724.0, 800.0], [540.0, 829.0, 940.0, 558.0, 521.0, 541.0, 680.0, 798.0, 813.0], [512.0, 628.0, 907.0, 783.0, 530.0, 553.0, 724.0, 903.0, 840.0], [528.0, 533.0, 698.0, 861.0, 639.0, 520.0, 679.0, 968.0, 1001.0], [519.0, 516.0, 540.0, 703.0, 630.0, 524.0, 558.0, 816.0, 999.0]]], [[[2811.0, 3581.0, 3633.0, 2705.0, 2019.0, 1872.0, 1629.0, 1588.0, 2416.0], [3713.0, 3539.0, 3377.0, 2523.0, 1632.0, 1478.0, 1443.0, 1875.0, 1823.0], [3276.0, 3569.0, 3249.0, 2458.0, 1504.0, 1206.0, 1287.0, 1471.0, 1147.0], [3193.0, 3955.0, 3440.0, 3145.0, 2475.0, 2488.0, 2451.0, 1620.0, 1001.0], [2191.0, 3473.0, 3411.0, 3577.0, 3529.0, 3481.0, 3447.0, 1894.0, 1009.0], [1323.0, 2638.0, 3324.0, 3763.0, 3841.0, 3121.0, 2606.0, 1833.0, 1058.0], [1687.0, 2001.0, 3160.0, 3933.0, 3937.0, 3285.0, 2383.0, 2352.0, 1648.0], [2015.0, 1318.0, 2582.0, 3281.0, 3511.0, 3432.0, 2620.0, 2382.0, 2100.0]], [[3074.0, 3067.0, 3034.0, 2868.0, 2787.0, 2729.0, 2676.0, 2704.0, 2759.0], [3032.0, 3045.0, 2984.0, 2908.0, 2782.0, 2691.0, 2662.0, 2680.0, 2703.0], [2956.0, 3035.0, 2994.0, 2955.0, 2808.0, 2771.0, 2785.0, 2660.0, 2553.0], [2860.0, 2985.0, 2967.0, 2978.0, 2932.0, 2947.0, 2970.0, 2746.0, 2526.0], [2712.0, 2831.0, 2918.0, 3021.0, 3050.0, 3033.0, 3013.0, 2777.0, 2585.0], [2723.0, 2767.0, 2971.0, 3099.0, 3110.0, 3017.0, 2928.0, 2828.0, 2708.0], [2883.0, 2685.0, 2935.0, 3073.0, 3119.0, 3113.0, 3040.0, 2950.0, 2837.0], [2943.0, 2786.0, 2911.0, 3046.0, 3102.0, 3173.0, 3112.0, 3038.0, 2944.0]], [[6470.0, 6929.0, 7344.0, 7451.0, 7567.0, 7565.0, 7595.0, 7504.0, 7452.0], [6567.0, 6995.0, 7336.0, 7338.0, 7169.0, 7027.0, 6983.0, 6812.0, 6587.0], [6839.0, 7139.0, 7222.0, 7022.0, 6554.0, 6165.0, 6084.0, 6126.0, 6195.0], [7090.0, 7208.0, 7034.0, 6701.0, 6425.0, 6119.0, 5872.0, 5943.0, 6125.0], [7016.0, 6994.0, 6733.0, 6360.0, 6282.0, 6212.0, 5950.0, 5894.0, 6025.0], [6769.0, 6684.0, 6448.0, 6194.0, 6200.0, 6145.0, 5975.0, 6006.0, 6088.0], [6698.0, 6575.0, 6414.0, 6237.0, 6177.0, 6061.0, 6036.0, 6143.0, 6179.0], [6909.0, 6700.0, 6464.0, 6248.0, 6130.0, 6056.0, 6086.0, 6228.0, 6338.0]], [[7435.0, 7468.0, 7447.0, 7470.0, 7410.0, 7424.0, 7407.0, 7364.0, 7321.0], [7463.0, 7486.0, 7493.0, 7474.0, 7467.0, 7456.0, 7470.0, 7398.0, 7343.0], [7483.0, 7535.0, 7533.0, 7487.0, 7485.0, 7487.0, 7515.0, 7441.0, 7363.0], [7470.0, 7493.0, 7535.0, 7473.0, 7471.0, 7472.0, 7451.0, 7426.0, 7375.0], [7415.0, 7430.0, 7472.0, 7405.0, 7417.0, 7361.0, 7321.0, 7280.0, 7294.0], [7360.0, 7390.0, 7362.0, 7338.0, 7343.0, 7223.0, 7168.0, 7162.0, 7124.0], [7204.0, 7293.0, 7319.0, 7291.0, 7280.0, 7171.0, 7088.0, 7067.0, 6935.0], [7192.0, 7254.0, 7241.0, 7227.0, 7219.0, 7123.0, 7026.0, 6938.0, 6810.0]], [[3460.0, 3527.0, 3254.0, 2862.0, 2772.0, 2746.0, 2716.0, 2840.0, 3317.0], [3586.0, 3577.0, 3211.0, 2788.0, 2613.0, 2631.0, 2723.0, 2881.0, 3455.0], [3601.0, 3620.0, 3265.0, 2916.0, 2607.0, 2618.0, 2641.0, 2795.0, 3393.0], [3540.0, 3675.0, 3424.0, 3103.0, 2776.0, 2743.0, 2792.0, 2908.0, 3299.0], [2684.0, 3140.0, 3349.0, 3253.0, 2958.0, 2900.0, 2928.0, 3101.0, 3394.0], [2135.0, 2828.0, 3434.0, 3456.0, 3341.0, 3037.0, 2805.0, 3286.0, 3493.0], [2714.0, 2572.0, 3349.0, 3563.0, 3708.0, 3324.0, 3028.0, 3459.0, 3502.0], [2973.0, 2404.0, 3002.0, 3211.0, 3823.0, 3821.0, 3472.0, 3662.0, 3764.0]], [[3436.0, 3488.0, 3577.0, 3151.0, 2241.0, 2058.0, 1645.0, 1562.0, 2067.0], [3624.0, 3787.0, 3280.0, 2592.0, 1917.0, 1577.0, 1408.0, 1799.0, 1795.0], [3096.0, 3680.0, 3402.0, 2851.0, 2079.0, 1787.0, 1753.0, 1523.0, 1226.0], [2661.0, 3689.0, 3683.0, 3481.0, 3170.0, 3283.0, 3128.0, 1934.0, 1161.0], [1605.0, 2656.0, 3303.0, 3755.0, 3861.0, 3747.0, 3401.0, 1993.0, 1152.0], [1477.0, 2018.0, 3058.0, 3842.0, 3970.0, 3166.0, 2343.0, 1908.0, 1342.0], [2413.0, 1424.0, 2631.0, 3646.0, 3820.0, 3413.0, 2653.0, 2211.0, 1808.0], [2581.0, 1579.0, 1912.0, 2861.0, 3406.0, 3499.0, 2904.0, 2388.0, 2066.0]]]] } diff --git a/tests/create_data_cube.json5 b/tests/create_data_cube.json5 index 01cff983..a79e1792 100644 --- a/tests/create_data_cube.json5 +++ b/tests/create_data_cube.json5 @@ -6,7 +6,8 @@ "arguments": {}, "returns": { "type": "datacube", - "dimensions": [], + "order": [], + "dimensions": {}, "data": [] } } diff --git a/tests/drop_dimension.json5 b/tests/drop_dimension.json5 index 435d13d1..e8360a2c 100644 --- a/tests/drop_dimension.json5 +++ b/tests/drop_dimension.json5 @@ -14,7 +14,7 @@ { "arguments": { "data": { - "$ref": "assets/xyb-one-band.json5" + "$ref": "assets/xyb-mask-one-band.json5" }, "name": "foo" }, @@ -23,33 +23,12 @@ { "arguments": { "data": { - "$ref": "assets/xyb-one-band.json5" + "$ref": "assets/xyb-mask-one-band.json5" }, "name": "bands" }, "returns": { - "type": "datacube", - "dimensions": [ - { - "name": "y", - "type": "spatial", - "axis": "y", - "values": [5757495.0, 5757485.0, 5757475.0], - "reference_system": "EPSG:25832" - }, - { - "name": "x", - "type": "spatial", - "axis": "x", - "values": [404835.0, 404845.0, 404855.0, 404865.0], - "reference_system": "EPSG:25832" - } - ], - "data": [ - [172, 47, 117, 192], - [67, 251, 195, 103], - [9, 211, 0, 242] - ] + "$ref": "assets/xyb-mask.json5" } }, ] diff --git a/tests/filter_bands.json5 b/tests/filter_bands.json5 index 61bd447f..f60eabff 100644 --- a/tests/filter_bands.json5 +++ b/tests/filter_bands.json5 @@ -32,28 +32,26 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": [] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [] } }, @@ -69,38 +67,34 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["red", "blue"] }, - { - "name": "y", + "y": { "type": "spatial", - "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", - "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [172, 47, 117, 192], [67, 251, 195, 103], - [9, 211, 0, 242] + [9, 211, 255, 242] ], [ - [174, 88, 81, 165], + [174, 88, 81, 255], [25, 77, 72, 9], - [148, 115, 0, 208] + [148, 115, 255, 208] ] ] } @@ -117,38 +111,36 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["blue", "green"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ - [174, 88, 81, 165], + [174, 88, 81, 255], [25, 77, 72, 9], - [148, 115, 0, 208] + [148, 115, 255, 208] ], [ [36, 87, 70, 216], [88, 140, 58, 193], - [230, 39, 0, 87] + [230, 39, 255, 87] ] ] } diff --git a/tests/filter_temporal.json5 b/tests/filter_temporal.json5 index 545c6cfd..20b3fd1a 100644 --- a/tests/filter_temporal.json5 +++ b/tests/filter_temporal.json5 @@ -52,30 +52,28 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": [ "2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z" ] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [17.5, 53.75, -27.1, -64.25], @@ -103,29 +101,25 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": [ "2020-06-09T00:00:00Z" ] }, - { - "name": "y", + "y": { "type": "spatial", - "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", - "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [ [-12.23, 61.46, 2.38, -84.76], @@ -148,27 +142,25 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "x"], + "dimensions": { + "t": { "type": "temporal", "values": [] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [] } }, diff --git a/tests/mask.json5 b/tests/mask.json5 index f970670d..6d33bf16 100644 --- a/tests/mask.json5 +++ b/tests/mask.json5 @@ -1,5 +1,152 @@ { "id": "mask", "level": "L2A", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "mask": { + "$ref": "assets/xyb-mask.json5" + } + }, + "returns": { + "type": "datacube", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["red", "green", "blue"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [172, 47, 117, 192], + [67, 255, 255, 103], + [255, 255, 255, 255] + ], + [ + [36, 87, 70, 216], + [88, 255, 255, 193], + [255, 255, 255, 255] + ], + [ + [174, 88, 81, 255], + [25, 255, 255, 9], + [255, 255, 255, 255] + ] + ] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-float.json5" + }, + "mask": { + "$ref": "assets/xyb-mask.json5" + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, NaN, NaN, -20.5], + [NaN, NaN, 25.16, NaN] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, NaN, NaN, 51.05], + [NaN, NaN, NaN, NaN] + ] + ] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "mask": { + "$ref": "assets/xyb-mask.json5" + }, + "replacement": -1 + }, + "returns": { + "type": "datacube", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["red", "green", "blue"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [172, 47, 117, 192], + [67, -1, -1, 103], + [-1, -1, -1, -1] + ], + [ + [36, 87, 70, 216], + [88, -1, -1, 193], + [-1, -1, -1, -1] + ], + [ + [174, 88, 81, 255], + [25, -1, -1, 9], + [-1, -1, -1, -1] + ] + ] + } + } + ] } diff --git a/tests/merge_cubes.json5 b/tests/merge_cubes.json5 index eda1edb8..24e1b3d3 100644 --- a/tests/merge_cubes.json5 +++ b/tests/merge_cubes.json5 @@ -1,5 +1,211 @@ { "id": "merge_cubes", "level": "L3", - "tests": [] + "tests": [ + { + "arguments": { + "cube1": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "cube2": { + "$ref": "assets/xyb-mask-one-band.json5" + } + }, + "returns": { + "type": "datacube", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["red", "green", "blue", "mask"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 255, 242] + ], + [ + [36, 87, 70, 216], + [88, 140, 58, 193], + [230, 39, 255, 87] + ], + [ + [174, 88, 81, 255], + [25, 77, 72, 9], + [148, 115, 255, 208] + ], + [ + [1, 1, 1, 1], + [1, 0, 0, 1], + [0, 0, 1, 0] + ] + ] + } + }, + { + "arguments": { + "cube1": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "cube2": { + "$ref": "assets/xyb-mask-one-band.json5" + } + }, + "returns": { + "type": "datacube", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["red", "green", "blue", "mask"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [172, 47, 117, 192], + [67, 251, 195, 103], + [9, 211, 255, 242] + ], + [ + [36, 87, 70, 216], + [88, 140, 58, 193], + [230, 39, 255, 87] + ], + [ + [174, 88, 81, 255], + [25, 77, 72, 9], + [148, 115, 255, 208] + ], + [ + [1, 1, 1, 1], + [1, 0, 0, 1], + [0, 0, 1, 0] + ] + ] + } + }, + { + "arguments": { + "cube1": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "cube2": { + "$ref": "assets/xyt-more-timestamps.json5" + } + }, + "throws": "OverlapResolverMissing" + }, + { + "arguments": { + "cube1": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "cube2": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "overlap_resolver": { + "process_graph": { + "sum": { + "process_id": "sum", + "arguments": { + "data": [ + { + "from_argument": "x" + }, + { + "from_argument": "y" + } + ] + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-06-01T00:00:00Z", + "2020-06-03T00:00:00Z", + "2020-06-05T00:00:00Z", + "2020-06-07T00:00:00Z", + "2020-06-09T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [35.0, 107.5, -54.2, -128.5], + [-36.0, 16.9, -6.22, -41.0], + [100.8, 98.48, 50.32, -163.2] + ], + [ + [-127.3, 18.0, -137.04, -16.0], + [2.1, -127.6, 146.1, 102.1], + [95.72, -42.6, NaN, 92.3] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + } + ] } diff --git a/tests/reduce_dimension.json5 b/tests/reduce_dimension.json5 index 677ffe32..06ab6d3a 100644 --- a/tests/reduce_dimension.json5 +++ b/tests/reduce_dimension.json5 @@ -29,22 +29,21 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "y", + "order": ["y", "x"], + "dimensions": { + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [-46.15, 62.75, -95.62, -72.25], [-16.95, -55.35, 69.94, 30.55], @@ -102,22 +101,19 @@ "returns": { "type": "datacube", "nodata": NaN, - "dimensions": [ - { - "name": "y", + "order": ["y", "x"], + "dimensions": { + "y": { "type": "spatial", - "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", - "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": [ [0.98850574712, 0.53409090909, 1.44444444444, 1.16363636363], [2.68, 3.2597402597, 2.708333333333, 11.44444444444], diff --git a/tests/rename_dimension.json5 b/tests/rename_dimension.json5 index 9879bdf2..7383ed23 100644 --- a/tests/rename_dimension.json5 +++ b/tests/rename_dimension.json5 @@ -32,27 +32,25 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "time", + "order": ["time", "y", "x"], + "dimensions": { + "time": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -66,27 +64,25 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "t", + "order": ["t", "lon", "x"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "lon", + "lon": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -100,27 +96,25 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "t", + "order": ["t", "y", "lat"], + "dimensions": { + "t": { "type": "temporal", "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "lat", + "lat": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -134,27 +128,25 @@ }, "returns": { "type": "datacube", - "dimensions": [ - { - "name": "b", + "order: ": ["b", "y", "x"], + "dimensions": { + "b": { "type": "bands", "values": ["red", "green", "blue"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } } diff --git a/tests/rename_labels.json5 b/tests/rename_labels.json5 index 1adfe31f..6f2ebe3c 100644 --- a/tests/rename_labels.json5 +++ b/tests/rename_labels.json5 @@ -81,28 +81,26 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["B1", "B2", "B3"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -120,28 +118,24 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["red", "green", "blue"] }, - { - "name": "y", + "y": { "type": "spatial", - "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", - "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -162,28 +156,26 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["red", "B2", "B3"] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } }, @@ -199,28 +191,26 @@ }, "returns": { "type": "datacube", - "nodata": 0, - "dimensions": [ - { - "name": "bands", + "nodata": 255, + "order": ["bands", "y", "x"], + "dimensions": { + "bands": { "type": "bands", "values": ["red", 1, 2] }, - { - "name": "y", + "y": { "type": "spatial", "axis": "y", "values": [5757495.0, 5757485.0, 5757475.0], "reference_system": "EPSG:25832" }, - { - "name": "x", + "x": { "type": "spatial", "axis": "x", "values": [404835.0, 404845.0, 404855.0, 404865.0], "reference_system": "EPSG:25832" } - ], + }, "data": null } } From b13cba503e4b40d2560a1f63e6311b74ba76c3c0 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 15 Dec 2023 23:35:44 +0100 Subject: [PATCH 30/39] Mark experimental processes --- tests/aggregate_spatial_window.json5 | 1 + tests/apply_polygon.json5 | 1 + tests/array_create_labeled.json5 | 1 + tests/array_find_label.json5 | 1 + tests/filter_labels.json5 | 1 + tests/filter_vector.json5 | 1 + tests/flatten_dimensions.json5 | 1 + tests/inspect.json5 | 1 + tests/load_geojson.json5 | 1 + tests/load_stac.json5 | 1 + tests/load_url.json5 | 1 + tests/reduce_spatial.json5 | 1 + tests/unflatten_dimensions.json5 | 1 + tests/vector_buffer.json5 | 1 + tests/vector_reproject.json5 | 1 + tests/vector_to_random_points.json5 | 1 + tests/vector_to_regular_points.json5 | 1 + 17 files changed, 17 insertions(+) diff --git a/tests/aggregate_spatial_window.json5 b/tests/aggregate_spatial_window.json5 index c9541a63..3b96030d 100644 --- a/tests/aggregate_spatial_window.json5 +++ b/tests/aggregate_spatial_window.json5 @@ -1,5 +1,6 @@ { "id": "aggregate_spatial_window", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/apply_polygon.json5 b/tests/apply_polygon.json5 index 31d84ea9..0c2f5441 100644 --- a/tests/apply_polygon.json5 +++ b/tests/apply_polygon.json5 @@ -1,5 +1,6 @@ { "id": "apply_polygon", + "experimental": true, "level": "L3", "tests": [] } diff --git a/tests/array_create_labeled.json5 b/tests/array_create_labeled.json5 index 3376e90f..1b9a0d42 100644 --- a/tests/array_create_labeled.json5 +++ b/tests/array_create_labeled.json5 @@ -1,6 +1,7 @@ { "id": "array_create_labeled", "level": "L3", + "experimental": true, "tests": [ // empty array { diff --git a/tests/array_find_label.json5 b/tests/array_find_label.json5 index c5487add..aff40f08 100644 --- a/tests/array_find_label.json5 +++ b/tests/array_find_label.json5 @@ -1,6 +1,7 @@ { "id": "array_find_label", "level": "L3", + "experimental": true, "tests": [ { "arguments": { diff --git a/tests/filter_labels.json5 b/tests/filter_labels.json5 index c220ec20..5df9fa2c 100644 --- a/tests/filter_labels.json5 +++ b/tests/filter_labels.json5 @@ -1,5 +1,6 @@ { "id": "filter_labels", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/filter_vector.json5 b/tests/filter_vector.json5 index 8c2f5e33..5dadfa1d 100644 --- a/tests/filter_vector.json5 +++ b/tests/filter_vector.json5 @@ -1,5 +1,6 @@ { "id": "filter_vector", "level": "L2B", + "experimental": true, "tests": [] } diff --git a/tests/flatten_dimensions.json5 b/tests/flatten_dimensions.json5 index b33f5ef5..7c237e03 100644 --- a/tests/flatten_dimensions.json5 +++ b/tests/flatten_dimensions.json5 @@ -1,5 +1,6 @@ { "id": "flatten_dimensions", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/inspect.json5 b/tests/inspect.json5 index 0cac530b..8d2d388d 100644 --- a/tests/inspect.json5 +++ b/tests/inspect.json5 @@ -1,5 +1,6 @@ { "id": "inspect", "level": "L2", + "experimental": true, "tests": [] } diff --git a/tests/load_geojson.json5 b/tests/load_geojson.json5 index 4ac4e72d..6c5ec3c4 100644 --- a/tests/load_geojson.json5 +++ b/tests/load_geojson.json5 @@ -1,5 +1,6 @@ { "id": "load_geojson", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/load_stac.json5 b/tests/load_stac.json5 index 2306883a..7eeeaed8 100644 --- a/tests/load_stac.json5 +++ b/tests/load_stac.json5 @@ -1,5 +1,6 @@ { "id": "load_stac", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/load_url.json5 b/tests/load_url.json5 index 9a1f5acd..d85aeaaf 100644 --- a/tests/load_url.json5 +++ b/tests/load_url.json5 @@ -1,5 +1,6 @@ { "id": "load_url", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/reduce_spatial.json5 b/tests/reduce_spatial.json5 index 19ae7ae6..e42c6fef 100644 --- a/tests/reduce_spatial.json5 +++ b/tests/reduce_spatial.json5 @@ -1,5 +1,6 @@ { "id": "reduce_spatial", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/unflatten_dimensions.json5 b/tests/unflatten_dimensions.json5 index cdfed772..7bb570dd 100644 --- a/tests/unflatten_dimensions.json5 +++ b/tests/unflatten_dimensions.json5 @@ -1,5 +1,6 @@ { "id": "unflatten_dimensions", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/vector_buffer.json5 b/tests/vector_buffer.json5 index 941d4d02..17ec84f2 100644 --- a/tests/vector_buffer.json5 +++ b/tests/vector_buffer.json5 @@ -1,5 +1,6 @@ { "id": "vector_buffer", "level": "L2B", + "experimental": true, "tests": [] } diff --git a/tests/vector_reproject.json5 b/tests/vector_reproject.json5 index 31373246..d2eff4cf 100644 --- a/tests/vector_reproject.json5 +++ b/tests/vector_reproject.json5 @@ -1,5 +1,6 @@ { "id": "vector_reproject", "level": "L2B", + "experimental": true, "tests": [] } diff --git a/tests/vector_to_random_points.json5 b/tests/vector_to_random_points.json5 index 8fbf1507..50dfca50 100644 --- a/tests/vector_to_random_points.json5 +++ b/tests/vector_to_random_points.json5 @@ -1,5 +1,6 @@ { "id": "vector_reproject", "level": "L3", + "experimental": true, "tests": [] } diff --git a/tests/vector_to_regular_points.json5 b/tests/vector_to_regular_points.json5 index 8fbf1507..50dfca50 100644 --- a/tests/vector_to_regular_points.json5 +++ b/tests/vector_to_regular_points.json5 @@ -1,5 +1,6 @@ { "id": "vector_reproject", "level": "L3", + "experimental": true, "tests": [] } From 1466504a08f27d2ecb0ac2353b8674afe8227857 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 19 Dec 2023 12:36:55 +0100 Subject: [PATCH 31/39] Add additional test for apply_dimension --- tests/apply_dimension.json5 | 102 ++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/tests/apply_dimension.json5 b/tests/apply_dimension.json5 index bc296d78..45c8e5bb 100644 --- a/tests/apply_dimension.json5 +++ b/tests/apply_dimension.json5 @@ -124,6 +124,108 @@ ] ] } + }, + { + "required": [ + "array_create", + "max", + "mean", + "min" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "process": { + "process_graph": { + "max": { + "process_id": "max", + "arguments": { + "data": { + "from_parameter": "data" + } + } + }, + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + } + }, + "min": { + "process_id": "min", + "arguments": { + "data": { + "from_parameter": "data" + } + } + }, + "array": { + "process_id": "array_create", + "arguments": { + "data": [ + { + "from_node": "min" + }, + { + "from_node": "mean" + }, + { + "from_node": "max" + } + ] + }, + "result": true + }, + } + }, + "dimension": "bands", + "target_dimension": "stats", + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "dimensions": [ + { + "name": "stats", + "type": "other", + "values": [0,1,2] + }, + { + "name": "y", + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + { + "name": "x", + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + ], + "data": [ + [ + [-63.65, 9.0, -68.52, -84.76], + [-21.55, -63.8, -65.85, -23.62], + [-70.4, -54.23, 1.26, -81.6] + ], + [ + [0.002, 40.07, 9.53, -31.754], + [13.956, 16.8, 8.474, 25.934], + [9.084, -20.428, 34.82333333333, 20.272] + ], + [ + [71.79, 61.46, 97.01, 74.72], + [79.92, 74.1, 98.28, 65.9], + [50.4 , 49.24, 78.05, 73.26] + ] + ] + } } ] } From 10460679e0fdb7883606f8a67c60edb171c54720 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 22 Dec 2023 16:08:11 +0100 Subject: [PATCH 32/39] Add tests for apply_kernel --- apply_kernel.json | 4 +- tests/README.md | 55 +++---- tests/apply_kernel.json5 | 311 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 341 insertions(+), 29 deletions(-) diff --git a/apply_kernel.json b/apply_kernel.json index cf16dc78..49fb8f82 100644 --- a/apply_kernel.json +++ b/apply_kernel.json @@ -1,7 +1,7 @@ { "id": "apply_kernel", "summary": "Apply a spatial convolution with a kernel", - "description": "Applies a 2D convolution (i.e. a focal operation with a weighted kernel) on the horizontal spatial dimensions (axes `x` and `y`) of a raster data cube.\n\nEach value in the kernel is multiplied with the corresponding pixel value and all products are summed up afterwards. The sum is then multiplied with the factor.\n\nThe process can't handle non-numerical or infinite numerical values in the data cube. Boolean values are converted to integers (`false` = 0, `true` = 1), but all other non-numerical or infinite values are replaced with zeroes by default (see parameter `replace_invalid`).\n\nFor cases requiring more generic focal operations or non-numerical values, see ``apply_neighborhood()``.", + "description": "Applies a 2D convolution (i.e. a focal operation with a weighted kernel) on the horizontal spatial dimensions (axes `x` and `y`) of a raster data cube.\n\nEach value in the kernel is multiplied with the corresponding pixel value and all products are summed up afterwards. The sum is then multiplied with the factor.\n\nThe process can't handle non-numerical or infinite numerical values in the data cube. Boolean values are converted to integers (`false` = 0, `true` = 1), but all other non-numerical, NaN, no-data, or infinite values are replaced with zeroes by default (see parameter `replace_invalid`).\n\nFor cases requiring more generic focal operations or non-numerical values, see ``apply_neighborhood()``.", "categories": [ "cubes", "math > image filter" @@ -70,7 +70,7 @@ }, { "name": "replace_invalid", - "description": "This parameter specifies the value to replace non-numerical or infinite numerical values with. By default, those values are replaced with zeroes.", + "description": "This parameter specifies the value to replace non-numerical, NaN, no-data, or infinite numerical values with. By default, those values are replaced with zeroes.", "schema": { "type": "number" }, diff --git a/tests/README.md b/tests/README.md index ab5921f3..127cec5b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,19 +7,15 @@ This folder contains test cases for the openEO processes. - [x] absolute - [x] add - [x] add_dimension -- [ ] aggregate_spatial -- [ ] aggregate_spatial_window (experimental) -- [ ] aggregate_temporal -- [ ] aggregate_temporal_period +- [ ] aggregate_spatial* +- [ ] aggregate_temporal* +- [ ] aggregate_temporal_period* - [x] all - [x] and -- [ ] anomaly - [x] any - [x] apply* - [x] apply_dimension* -- [ ] apply_kernel -- [ ] apply_neighborhood -- [ ] apply_polygon (experimental) +- [x] apply_kernel - [x] arccos - [x] arcosh - [x] arcsin @@ -42,7 +38,6 @@ This folder contains test cases for the openEO processes. - [x] artanh - [x] between - [x] ceil -- [ ] climatological_normal - [x] clip - [x] constant - [x] cos @@ -64,13 +59,10 @@ This folder contains test cases for the openEO processes. - [x] exp - [x] extrema - [x] filter_bands* -- [ ] filter_bbox -- [ ] filter_labels (experimental) -- [ ] filter_spatial +- [ ] filter_bbox* +- [ ] filter_spatial* - [x] filter_temporal* -- [ ] filter_vector (experimental) - [x] first -- [ ] flatten_dimensions (experimental) - [x] floor - [x] gt - [x] gte @@ -82,12 +74,11 @@ This folder contains test cases for the openEO processes. - [x] last - [x] linear_scale_range - [x] ln -- [ ] load_geojson (experimental) - [x] log - [x] lt - [x] lte - [x] mask* -- [ ] mask_polygon +- [ ] mask_polygon* - [x] max - [x] mean - [x] median @@ -96,7 +87,6 @@ This folder contains test cases for the openEO processes. - [x] mod - [x] multiply - [x] nan (experimental) -- [ ] ndvi - [x] neq - [x] normalized_difference - [x] not @@ -108,12 +98,9 @@ This folder contains test cases for the openEO processes. - [x] quantiles - [x] rearrange* - [x] reduce_dimension* -- [ ] reduce_spatial (experimental) - [x] rename_dimension - [x] rename_labels -- [ ] resample_cube_spatial -- [ ] resample_cube_temporal -- [ ] resample_spatial +- [ ] resample_spatial* - [x] round - [x] sd - [x] sgn @@ -129,12 +116,7 @@ This folder contains test cases for the openEO processes. - [x] text_concat - [x] text_contains - [x] text_ends -- [ ] trim_cube -- [ ] unflatten_dimension (experimental) - [x] variance -- [ ] vector_buffer (experimental) -- [ ] vector_reproject (experimental) -- [ ] vector_to_regular_points (experimental) - [x] xor \* = could use some more tests @@ -164,6 +146,27 @@ We don't expect that we can provide meaningful test cases for these processes. - sar_backscatter (experimental) - save_result - vector_to_random_points (experimental) +- vector_to_regular_points (experimental) + +The following processes are experimental or part of a higher profile (L3+), so the tests will hopefully evolve over time: + +- aggregate_spatial_window (experimental) +- anomaly +- apply_neighborhood +- apply_polygon (experimental) +- climatological_normal +- filter_labels (experimental) +- filter_vector (experimental) +- flatten_dimensions (experimental) +- load_geojson (experimental) +- ndvi +- reduce_spatial (experimental) +- resample_cube_spatial +- resample_cube_temporal +- trim_cube +- unflatten_dimension (experimental) +- vector_buffer (experimental) +- vector_reproject (experimental) ## Assumptions diff --git a/tests/apply_kernel.json5 b/tests/apply_kernel.json5 index 28c3c2ab..fa94ee25 100644 --- a/tests/apply_kernel.json5 +++ b/tests/apply_kernel.json5 @@ -1,5 +1,314 @@ { "id": "apply_kernel", "level": "L2A", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2], + [2, 4], + ] + }, + "throws": "KernelDimensionsUneven" + }, + { + // all default values + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2, 1], + [2, 4, 2], + [1, 2, 1] + ] + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [149.95, 191.59, -147.67, -355.31], + [183.69, 263.52, -83.28, -381.86], + [272.53, 343.87, 17.65, -320.19] + ], + [ + [-298.3, -281.84, -138.73, 6.11], + [-167.28, -215.91, 155.51, 358.08], + [87.14, -42.98, 183.05, 359.75] + ] + ] + } + }, + { + // border = replicate + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2, 1], + [2, 4, 2], + [1, 2, 1] + ], + "border": "replicate" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [273.2, 289.49, -212.37, -724.16], + [215.59, 263.52, -83.28, -568.71], + [555.77, 517.91, 35.61, -723.53] + ], + [ + [-606.5, -396.01, -274.77, -51.36], + [-180.97, -215.91, 155.51, 498.33], + [306.19, -37.72, 207.9, 641.55] + ] + ] + } + }, + { + // border = reflect_pixel + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2, 1], + [2, 4, 2], + [1, 2, 1] + ], + "border": "reflect_pixel" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [246.8, 187.38, -165.94, -459.84], + [303.58, 263.52, -83.28, -390.02], + [360.36, 339.66, -0.62, -320.2] + ], + [ + [-469.6, -335.34, -5.38, 190.32], + [-307.18, -215.91, 155.51, 435.66], + [-144.76, -96.48, 316.4, 681.0] + ] + ] + } + }, + { + // border = wrap + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2, 1], + [2, 4, 2], + [1, 2, 1] + ], + "border": "wrap" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [69.39, 365.63, -129.71, -425.95], + [-3.16, 263.52, -83.28, -349.96], + [113.33, 441.77, -47.05, -375.49] + ], + [ + [-142.68, -276.58, -113.88, 20.02], + [-27.03, -215.91, 155.51, 344.39], + [104.19, -157.15, 47.01, 308.35] + ] + ] + } + }, + { + // border = 1, replace_invalid = 1 + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2, 1], + [2, 4, 2], + [1, 2, 1] + ], + "border": 1, + "replace_invalid": 1 + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [156.95, 195.59, -143.67, -348.31], + [187.69, 263.52, -83.28, -377.86], + [279.53, 347.87, 21.65, -313.19] + ], + [ + [-291.3, -277.84, -134.73, 13.11], + [-163.28, -214.91, 157.51, 363.08], + [94.14, -36.98, 191.05, 368.75] + ] + ] + } + }, + { + // border = -1, replace_invalid = -1, factor = 0.11111111111 + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "kernel": [ + [1, 2, 1], + [2, 4, 2], + [1, 2, 1] + ], + "border": -1, + "replace_invalid": -1, + "factor": 0.11111111111 + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [15.88333333317, 20.84333333312, -16.85222222205, -40.25666666626], + [19.96555555536, 29.27999999971, -9.25333333324, -42.8733333329], + [29.50333333304, 37.76333333296, 1.51666666665, -36.35444444408] + ], + [ + [-33.92222222188, -31.75999999968, -15.85888888873, -0.09888888889], + [-19.03111111092, -24.10111111087, 17.0566666665, 39.23111111072], + [8.90444444436, -5.44222222217, 19.44999999981, 38.97222222183] + ] + ] + } + } + ] } From 54f8fdce358c5fdc752e4cfeee43ef1c97c0a90a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 22 Dec 2023 17:07:39 +0100 Subject: [PATCH 33/39] Add tests for aggregate_temporal --- tests/README.md | 2 +- tests/aggregate_temporal.json5 | 572 +++++++++++++++++++++++++++++++- tests/assets/xytt-no-data.json5 | 27 ++ 3 files changed, 599 insertions(+), 2 deletions(-) create mode 100644 tests/assets/xytt-no-data.json5 diff --git a/tests/README.md b/tests/README.md index 127cec5b..5d978e48 100644 --- a/tests/README.md +++ b/tests/README.md @@ -8,7 +8,7 @@ This folder contains test cases for the openEO processes. - [x] add - [x] add_dimension - [ ] aggregate_spatial* -- [ ] aggregate_temporal* +- [x] aggregate_temporal - [ ] aggregate_temporal_period* - [x] all - [x] and diff --git a/tests/aggregate_temporal.json5 b/tests/aggregate_temporal.json5 index 41771199..23939741 100644 --- a/tests/aggregate_temporal.json5 +++ b/tests/aggregate_temporal.json5 @@ -1,5 +1,575 @@ { "id": "aggregate_temporal", "level": "L2", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xytt-no-data.json5" + }, + "intervals": [ + ["2015-01-01", "2016-01-01"], + ["2016-01-01", "2017-01-01"], + ["2017-01-01", "2018-01-01"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "throws": "TooManyDimensions" + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "intervals": [ + ["2015-01-01", "2016-01-01"], + ["2016-01-01", "2017-01-01"], + ["2017-01-01", "2018-01-01"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "throws": "DimensionNotAvailable" + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "intervals": [ + ["2015-01-01", "2016-01-01"], + ["2016-01-01", "2017-01-01"], + ["2017-01-01", "2018-01-01"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "time" + }, + "throws": "DimensionNotAvailable" + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "intervals": [ + ["2015-01-01", "2016-01-01"], + ["2017-01-01", "2016-01-01"], + ["2017-01-01", "2018-01-01"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "throws": "TemporalExtentEmpty" + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "intervals": [ + ["2015-01-01", "2016-01-01"], + ["2015-01-01", "2017-01-01"], + ["2015-01-01", "2018-01-01"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "throws": "DistinctDimensionLabelsRequired" + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "intervals": [ + ["2020-01-01", "2020-01-07"], + ["2020-01-07", "2020-01-14"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-01-01", + "2020-01-07" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-19.85, 32.94, -17.25, 0.82], + [20.99, 6.25, 56.07, 2.31], + [9.29, -0.70, 13.21, -10.06] + ], + [ + [29.78, 61.46, 49.70, -80.62], + [3.40, 48.45, -62.93, 61.37], + [8.78, -50.03, 78.05, 65.77] + ] + ] + } + }, + { + "required": [ + "absolute", + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "intervals": [ + ["2020-01-01T00:00:00Z", "2020-01-07T00:00:00Z"], + ["2020-01-07T00:00:00Z", "2020-01-14T00:00:00Z"], + ["2020-01-14T00:00:00Z", "2020-01-21T00:00:00Z"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + } + }, + "absolute": { + "process_id": "absolute", + "arguments": { + "data": { + "from_node": "mean" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-01-01T00:00:00Z", + "2020-01-07T00:00:00Z", + "2020-01-14T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [19.85, 32.94, 17.25, 0.82], + [20.99, 6.25, 56.07, 2.31], + [9.29, 0.70, 13.21, 10.06] + ], + [ + [29.78, 61.46, 49.70, 80.62], + [3.40, 48.45, 62.93, 61.37], + [8.78, 50.03, 78.05, 65.77] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ] + ] + } + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "intervals": [ + ["2020-01-01T00:00:00Z", "2020-01-07T00:00:00Z"], + ["2020-01-07T00:00:00Z", "2020-01-14T00:00:00Z"], + ["2020-01-14T00:00:00Z", "2020-01-21T00:00:00Z"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "labels": [ + "W01", + "W02", + "W03" + ] + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "W01", + "W02", + "W03" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-19.85, 32.94, -17.25, 0.82], + [20.99, 6.25, 56.07, 2.31], + [9.29, -0.70, 13.21, -10.06] + ], + [ + [29.78, 61.46, 49.70, -80.62], + [3.40, 48.45, -62.93, 61.37], + [8.78, -50.03, 78.05, 65.77] + ] + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ] + ] + } + }, + { + "required": [ + "sum" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "intervals": [ + ["2020-01-01T00:00:00Z", "2020-01-07T00:00:00Z"], + ["2020-01-07T00:00:00Z", "2020-01-14T00:00:00Z"] + ], + "reducer": { + "process_graph": { + "sum": { + "process_id": "sum", + "arguments": { + "data": { + "from_parameter": "data" + }, + "ignore_nodata": { + "from_pataeter": "context" + } + }, + "result": true + } + } + }, + "context": false + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-01-01T00:00:00Z", + "2020-01-07T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-59.55, 98.82, -51.74, 2.47], + [62.97, 18.75, 168.22, 6.93], + [27.86, -2.09, NaN, -30.17] + ], + [ + [59.56, NaN, 99.39, -161.24], + [6.81, NaN, -125.85, 122.74], + [17.56, -100.05, NaN, 131.53] + ] + ] + } + }, + { + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "intervals": [ + [null, "2020-01-04"], + ["2020-01-04", null] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + }, + "labels": [ + "before", + "after" + ] + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "before", + "after" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [15.387, 48.765, 47.757, -28.84], + [28.91, 61.275, -9.19, 33.04], + [-17.613, -43.36, 39.655, 45.603] + ] + ] + } + }, + { + "required": [ + "median" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-more-timestamps.json5" + }, + "intervals": [ + ["06:00:00", "18:00:00"], + ["18:00:00", "06:00:00"] + ], + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "06:00:00", + "18:00:00" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ] + [ + [-12.23, 44.91, 2.38, -64.25], + [1.05, 28.45, -3.11, 51.05], + [29.5, -30.03, 25.16, 46.15] + ] + ] + } + } + ] } diff --git a/tests/assets/xytt-no-data.json5 b/tests/assets/xytt-no-data.json5 new file mode 100644 index 00000000..71ddcde8 --- /dev/null +++ b/tests/assets/xytt-no-data.json5 @@ -0,0 +1,27 @@ +{ + "type": "datacube", + "order": ["t2", "t", "y", "x"], + "dimensions": { + "t2": { + "type": "temporal", + "values": ["2019-01-01T00:00:00Z", "2020-01-01T00:00:00Z"] + }, + "t": { + "type": "temporal", + "values": ["2020-01-01T00:00:00Z", "2021-01-01T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": null +} From 16440e29c92a4dae3c2c4c696606b05b4f52db34 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 22 Dec 2023 20:14:59 +0100 Subject: [PATCH 34/39] Add tests for aggregate_temporal_period, fix aggregate_temporal --- tests/README.md | 6 +- tests/aggregate_temporal.json5 | 9 +- tests/aggregate_temporal_period.json5 | 1346 ++++++++++++++++++++++++- 3 files changed, 1353 insertions(+), 8 deletions(-) diff --git a/tests/README.md b/tests/README.md index 5d978e48..0b0585e1 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,9 +7,8 @@ This folder contains test cases for the openEO processes. - [x] absolute - [x] add - [x] add_dimension -- [ ] aggregate_spatial* - [x] aggregate_temporal -- [ ] aggregate_temporal_period* +- [x] aggregate_temporal_period - [x] all - [x] and - [x] any @@ -148,8 +147,9 @@ We don't expect that we can provide meaningful test cases for these processes. - vector_to_random_points (experimental) - vector_to_regular_points (experimental) -The following processes are experimental or part of a higher profile (L3+), so the tests will hopefully evolve over time: +The following processes are experimental, part of a higher profile (L3+), or use vector data cube, so the tests will hopefully evolve over time: +- aggregate_spatial - aggregate_spatial_window (experimental) - anomaly - apply_neighborhood diff --git a/tests/aggregate_temporal.json5 b/tests/aggregate_temporal.json5 index 23939741..a2c2e511 100644 --- a/tests/aggregate_temporal.json5 +++ b/tests/aggregate_temporal.json5 @@ -237,7 +237,7 @@ "absolute": { "process_id": "absolute", "arguments": { - "data": { + "x": { "from_node": "mean" } }, @@ -359,7 +359,7 @@ [29.78, 61.46, 49.70, -80.62], [3.40, 48.45, -62.93, 61.37], [8.78, -50.03, 78.05, 65.77] - ] + ], [ [NaN, NaN, NaN, NaN], [NaN, NaN, NaN, NaN], @@ -369,6 +369,7 @@ } }, { + "level": "L3", "required": [ "sum" ], @@ -389,7 +390,7 @@ "from_parameter": "data" }, "ignore_nodata": { - "from_pataeter": "context" + "from_parameter": "context" } }, "result": true @@ -562,7 +563,7 @@ [NaN, NaN, NaN, NaN], [NaN, NaN, NaN, NaN], [NaN, NaN, NaN, NaN] - ] + ], [ [-12.23, 44.91, 2.38, -64.25], [1.05, 28.45, -3.11, 51.05], diff --git a/tests/aggregate_temporal_period.json5 b/tests/aggregate_temporal_period.json5 index dd3d0233..ab39d61f 100644 --- a/tests/aggregate_temporal_period.json5 +++ b/tests/aggregate_temporal_period.json5 @@ -1,5 +1,1349 @@ { "id": "aggregate_temporal_period", "level": "L2", - "tests": [] + "tests": [ + { + // TooManyDimensions + "arguments": { + "data": { + "$ref": "assets/xytt-no-data.json5" + }, + "period": "day", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "throws": "TooManyDimensions" + }, + { + // DimensionNotAvailable + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyb-minimal-int.json5" + }, + "period": "day", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "throws": "DimensionNotAvailable" + }, + { + // DimensionNotAvailable + "required": [ + "mean" + ], + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "period": "day", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "time" + }, + "throws": "DimensionNotAvailable" + }, + { + // hour + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-06-01T00:00:00Z", + "2020-06-01T00:59:59Z", + "2020-06-01T01:00:00Z", + "2020-06-01T01:30:00Z", + "2020-06-01T04:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "hour", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-06-01-00", + "2020-06-02-00", + "2020-06-03-00", + "2020-06-04-00" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // day + multiple processes + "required": [ + "mean", + "absolute" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-06-01T00:00:00Z", + "2020-06-01T12:00:59Z", + "2020-06-02T00:00:00Z", + "2020-06-02T12:00:00Z", + "2020-06-04T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "day", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + } + }, + "abs": { + "process_id": "absolute", + "arguments": { + "x": { + "from_node": "mean" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-06-01-00", + "2020-06-02-00", + "2020-06-03-00", + "2020-06-04-00" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [23.075, 31.375, 47.81, 36.125], + [8.475, 27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, 17.725] + ], + [ + [29.195, 36.07, 70.445, 0.88], + [29.185, 74.1, 19.14, 16.61], + [41.17, 42.13, 1.26, 39.27] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [12.23, 61.46, 2.38, 84.76], + [28.36, 48.45, 65.85, 65.90], + [29.50, 45.82, 78.05, 58.27] + ] + ] + } + }, + { + // week + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2022-12-06T12:00:00Z", + "2022-12-07T12:00:00Z", + "2022-12-12T00:00:00Z", + "2022-12-18T23:59:59Z", + "2023-01-01T12:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "week", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2022-49", + "2022-50", + "2022-51", + "2022-52" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // dekad + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2024-01-28T00:00:00Z", + "2024-01-31T00:00:00Z", + "2024-02-01T00:00:00Z", + "2024-02-10T00:00:00Z", + "2024-02-29T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "dekad", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2024-03", + "2024-04", + "2024-05", + "2024-06" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // month + different dimension name auto-detected + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t2", "y", "x"], + "dimensions": { + "t2": { + "type": "temporal", + "values": [ + "2024-01-28T00:00:00Z", + "2024-01-31T00:00:00Z", + "2024-02-01T00:00:00Z", + "2024-02-10T00:00:00Z", + "2024-04-15T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "month", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t2", "y", "x"], + "dimensions": { + "t2": { + "type": "temporal", + "values": [ + "2024-01", + "2024-02", + "2024-03", + "2024-04" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // season + dimension = t2 + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t2", "y", "x"], + "dimensions": { + "t2": { + "type": "temporal", + "values": [ + "2023-12-28T00:00:00Z", + "2024-02-29T00:00:00Z", + "2024-03-01T00:00:00Z", + "2024-04-10T00:00:00Z", + "2024-11-31T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "season", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t2" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2023-djf", + "2024-mam", + "2024-jja", + "2024-son" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // tropical-season + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t2", "y", "x"], + "dimensions": { + "t2": { + "type": "temporal", + "values": [ + "2023-11-01T00:00:00Z", + "2024-04-30T00:00:00Z", + "2024-05-01T00:00:00Z", + "2024-10-10T00:00:00Z", + "2024-11-31T00:00:00Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "tropical-season", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + }, + "dimension": "t2" + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2023-ndjfma", + "2024-mjjaso", + "2024-ndjfma" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // year + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-01-01T00:00:00Z", + "2020-06-01T00:00:00Z", + "2022-01-01T00:00:00Z", + "2022-12-31T00:00:00Z", + "2023-06-28T12:55:12Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + }, + "period": "year", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020", + "2021", + "2022", + "2023" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ], + [ + [-12.23, 61.46, 2.38, -84.76], + [ 28.36, 48.45, -65.85, 65.90], + [ 29.50, -45.82, 78.05, 58.27] + ] + ] + } + }, + { + // decade + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-01-01T00:00:00Z", + "2029-12-31T23:48:59Z", + "2030-01-01T00:00:00Z", + "2039-12-31T23:59:59Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ] + ] + }, + "period": "decade", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020", + "2030" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ] + ] + } + }, + { + // decade-ad + "required": [ + "mean" + ], + "arguments": { + "data": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2020-01-01T00:00:00Z", + "2021-01-01T00:00:00Z", + "2030-12-31T23:48:59Z", + "2041-01-01T00:00:00Z", + "2050-12-31T23:59:59Z" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [17.5, 53.75, -27.1, -64.25], + [-18.0, 8.45, -3.11, -20.5], + [50.4, 49.24, 25.16, -81.6] + ], + [ + [-63.65, 9.0, -68.52, -8.0], + [1.05, -63.8, 73.05, 51.05], + [47.86, -21.30, NaN, 46.15] + ], + [ + [-13.40, 36.07, 43.88, 74.72], + [79.92, 74.10, 98.28, -23.62], + [-70.40, -30.03, 1.26, 5.28] + ], + [ + [71.79, NaN, 97.01, -76.48], + [-21.55, NaN, -60.00, 56.84], + [-11.94, -54.23, NaN, 73.26] + ] + ] + }, + "period": "decade-ad", + "reducer": { + "process_graph": { + "mean": { + "process_id": "mean", + "arguments": { + "data": { + "from_parameter": "data" + } + }, + "result": true + } + } + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": [ + "2011", + "2021", + "2031", + "2041" + ] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [-23.075, 31.375, -47.81, -36.125], + [-8.475, -27.675, 34.97, 15.275], + [49.13, 13.97, 25.16, -17.725] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [29.195, 36.07, 70.445, -0.88], + [29.185, 74.1, 19.14, 16.61], + [-41.17, -42.13, 1.26, 39.27] + ] + ] + } + } + ] } From 768b209bef70ceed2b0b14b2f1ca852ea1a24227 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 2 Jan 2024 22:48:27 +0100 Subject: [PATCH 35/39] Add tests for filter_bbox, filter_spatial and mask_polygon --- tests/README.md | 8 +- tests/assets/epsg25832.wkt2 | 50 ++++ tests/assets/xytb-s2-small-filtered.json5 | 157 +++++++++++ .../assets/xytb-s2-small-masked-inside.json5 | 257 ++++++++++++++++++ .../assets/xytb-s2-small-masked-outside.json5 | 257 ++++++++++++++++++ tests/assets/xytb-s2-small.json5 | 232 +++++++++++++++- tests/filter_bbox.json5 | 136 ++++++++- tests/filter_spatial.json5 | 157 ++++++++++- tests/mask_polygon.json5 | 206 +++++++++++++- 9 files changed, 1452 insertions(+), 8 deletions(-) create mode 100644 tests/assets/epsg25832.wkt2 create mode 100644 tests/assets/xytb-s2-small-filtered.json5 create mode 100644 tests/assets/xytb-s2-small-masked-inside.json5 create mode 100644 tests/assets/xytb-s2-small-masked-outside.json5 diff --git a/tests/README.md b/tests/README.md index 0b0585e1..1353fe36 100644 --- a/tests/README.md +++ b/tests/README.md @@ -58,8 +58,8 @@ This folder contains test cases for the openEO processes. - [x] exp - [x] extrema - [x] filter_bands* -- [ ] filter_bbox* -- [ ] filter_spatial* +- [x] filter_bbox* +- [x] filter_spatial* - [x] filter_temporal* - [x] first - [x] floor @@ -77,7 +77,7 @@ This folder contains test cases for the openEO processes. - [x] lt - [x] lte - [x] mask* -- [ ] mask_polygon* +- [x] mask_polygon* - [x] max - [x] mean - [x] median @@ -99,7 +99,6 @@ This folder contains test cases for the openEO processes. - [x] reduce_dimension* - [x] rename_dimension - [x] rename_labels -- [ ] resample_spatial* - [x] round - [x] sd - [x] sgn @@ -140,6 +139,7 @@ We don't expect that we can provide meaningful test cases for these processes. - load_uploaded_files (experimental) - load_url (experimental) - predict_curve (experimental) +- resample_spatial - run_udf - run_udf_externally (experimental) - sar_backscatter (experimental) diff --git a/tests/assets/epsg25832.wkt2 b/tests/assets/epsg25832.wkt2 new file mode 100644 index 00000000..fd907a46 --- /dev/null +++ b/tests/assets/epsg25832.wkt2 @@ -0,0 +1,50 @@ +PROJCRS["ETRS89 / UTM zone 32N", + BASEGEOGCRS["ETRS89", + ENSEMBLE["European Terrestrial Reference System 1989 ensemble", + MEMBER["European Terrestrial Reference Frame 1989"], + MEMBER["European Terrestrial Reference Frame 1990"], + MEMBER["European Terrestrial Reference Frame 1991"], + MEMBER["European Terrestrial Reference Frame 1992"], + MEMBER["European Terrestrial Reference Frame 1993"], + MEMBER["European Terrestrial Reference Frame 1994"], + MEMBER["European Terrestrial Reference Frame 1996"], + MEMBER["European Terrestrial Reference Frame 1997"], + MEMBER["European Terrestrial Reference Frame 2000"], + MEMBER["European Terrestrial Reference Frame 2005"], + MEMBER["European Terrestrial Reference Frame 2014"], + ELLIPSOID["GRS 1980",6378137,298.257222101, + LENGTHUNIT["metre",1]], + ENSEMBLEACCURACY[0.1]], + PRIMEM["Greenwich",0, + ANGLEUNIT["degree",0.0174532925199433]], + ID["EPSG",4258]], + CONVERSION["UTM zone 32N", + METHOD["Transverse Mercator", + ID["EPSG",9807]], + PARAMETER["Latitude of natural origin",0, + ANGLEUNIT["degree",0.0174532925199433], + ID["EPSG",8801]], + PARAMETER["Longitude of natural origin",9, + ANGLEUNIT["degree",0.0174532925199433], + ID["EPSG",8802]], + PARAMETER["Scale factor at natural origin",0.9996, + SCALEUNIT["unity",1], + ID["EPSG",8805]], + PARAMETER["False easting",500000, + LENGTHUNIT["metre",1], + ID["EPSG",8806]], + PARAMETER["False northing",0, + LENGTHUNIT["metre",1], + ID["EPSG",8807]]], + CS[Cartesian,2], + AXIS["(E)",east, + ORDER[1], + LENGTHUNIT["metre",1]], + AXIS["(N)",north, + ORDER[2], + LENGTHUNIT["metre",1]], + USAGE[ + SCOPE["Engineering survey, topographic mapping."], + AREA["Europe between 6°E and 12°E: Austria; Belgium; Denmark - onshore and offshore; Germany - onshore and offshore; Norway including - onshore and offshore; Spain - offshore."], + BBOX[38.76,6,84.33,12.01]], + ID["EPSG",25832]] \ No newline at end of file diff --git a/tests/assets/xytb-s2-small-filtered.json5 b/tests/assets/xytb-s2-small-filtered.json5 new file mode 100644 index 00000000..45ef6711 --- /dev/null +++ b/tests/assets/xytb-s2-small-filtered.json5 @@ -0,0 +1,157 @@ +{ + "type": "datacube", + "nodata": NaN, + "order": ["bands", "t", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["blue", "green", "red", "nir"], + }, + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"], + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404865.0, 404875.0, 404885.0, 404895.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [ + [1037.0, 1087.0, 1124.0, 1197.0], + [921.0, 1030.0, 1051.0, 1138.0], + [793.0, 796.0, 795.0, 905.0] + ], + [ + [2006.0, 2005.0, 2000.0, 2015.0], + [1969.0, 1965.0, 1979.0, 2025.0], + [1950.0, 1963.0, 1988.0, 2021.0] + ], + [ + [6379.0, 6360.0, 6253.0, 6205.0], + [6261.0, 5995.0, 5545.0, 5389.0], + [6016.0, 5738.0, 5521.0, 5135.0] + ], + [ + [7246.0, 7317.0, 7301.0, 7279.0], + [7303.0, 7281.0, 7292.0, 7320.0], + [7288.0, 7258.0, 7270.0, 7282.0] + ], + [ + [1714.0, 1785.0, 1908.0, 1998.0], + [1561.0, 1690.0, 1840.0, 1930.0], + [1523.0, 1646.0, 1757.0, 1789.0] + ], + [ + [1083.0, 1250.0, 1207.0, 1302.0], + [1006.0, 1114.0, 1102.0, 1227.0], + [962.0, 958.0, 950.0, 1054.0] + ] + ], + [ + [ + [971.0, 983.0, 1030.0, 1071.0], + [806.0, 886.0, 850.0, 962.0], + [636.0, 627.0, 591.0, 795.0] + ], + [ + [1905.0, 1914.0, 1900.0, 1891.0], + [1778.0, 1801.0, 1816.0, 1834.0], + [1772.0, 1764.0, 1765.0, 1811.0] + ], + [ + [6301.0, 6300.0, 6244.0, 6295.0], + [6162.0, 6154.0, 6128.0, 6053.0], + [5847.0, 5532.0, 5515.0, 5408.0] + ], + [ + [6802.0, 6809.0, 6799.0, 6767.0], + [6844.0, 6853.0, 6837.0, 6820.0], + [6871.0, 6876.0, 6867.0, 6839.0] + ], + [ + [1703.0, 1729.0, 1795.0, 1793.0], + [1435.0, 1508.0, 1638.0, 1746.0], + [1329.0, 1466.0, 1576.0, 1645.0] + ], + [ + [997.0, 1091.0, 1079.0, 1120.0], + [847.0, 935.0, 927.0, 1025.0], + [796.0, 765.0, 765.0, 851.0] + ] + ], + [ + [ + [789.0, 911.0, 943.0, 974.0], + [560.0, 726.0, 714.0, 877.0], + [407.0, 452.0, 439.0, 568.0] + ], + [ + [1947.0, 1890.0, 1848.0, 1828.0], + [1916.0, 1877.0, 1838.0, 1814.0], + [1867.0, 1822.0, 1788.0, 1791.0] + ], + [ + [6921.0, 7022.0, 7121.0, 7217.0], + [6845.0, 6790.0, 6874.0, 6936.0], + [6706.0, 6719.0, 6627.0, 6561.0] + ], + [ + [7125.0, 7102.0, 7102.0, 7058.0], + [7113.0, 7099.0, 7116.0, 7092.0], + [7176.0, 7158.0, 7156.0, 7119.0] + ], + [ + [1759.0, 1888.0, 1824.0, 1704.0], + [1336.0, 1417.0, 1541.0, 1647.0], + [1205.0, 1313.0, 1464.0, 1555.0] + ], + [ + [727.0, 948.0, 960.0, 1034.0], + [573.0, 726.0, 698.0, 851.0], + [523.0, 513.0, 516.0, 643.0] + ] + ], + [ + [ + [2705.0, 2019.0, 1872.0, 1629.0], + [2523.0, 1632.0, 1478.0, 1443.0], + [2458.0, 1504.0, 1206.0, 1287.0] + ], + [ + [2868.0, 2787.0, 2729.0, 2676.0], + [2908.0, 2782.0, 2691.0, 2662.0], + [2955.0, 2808.0, 2771.0, 2785.0] + ], + [ + [7451.0, 7567.0, 7565.0, 7595.0], + [7338.0, 7169.0, 7027.0, 6983.0], + [7022.0, 6554.0, 6165.0, 6084.0] + ], + [ + [7470.0, 7410.0, 7424.0, 7407.0], + [7474.0, 7467.0, 7456.0, 7470.0], + [7487.0, 7485.0, 7487.0, 7515.0] + ], + [ + [2862.0, 2772.0, 2746.0, 2716.0], + [2788.0, 2613.0, 2631.0, 2723.0], + [2916.0, 2607.0, 2618.0, 2641.0] + ], + [ + [3151.0, 2241.0, 2058.0, 1645.0], + [2592.0, 1917.0, 1577.0, 1408.0], + [2851.0, 2079.0, 1787.0, 1753.0] + ] + ] + ] +} diff --git a/tests/assets/xytb-s2-small-masked-inside.json5 b/tests/assets/xytb-s2-small-masked-inside.json5 new file mode 100644 index 00000000..fd4c1857 --- /dev/null +++ b/tests/assets/xytb-s2-small-masked-inside.json5 @@ -0,0 +1,257 @@ +{ + "type": "datacube", + "nodata": NaN, + "order": ["bands", "t", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["blue", "green", "red", "nir"] + }, + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0, 5757465.0, 5757455.0, 5757445.0, 5757435.0, 5757425.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0, 404875.0, 404885.0, 404895.0, 404905.0, 404915.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [ + [770.0, 780.0, 838.0, NaN, NaN, NaN, NaN, 1182.0, 1014.0], + [860.0, 799.0, 778.0, NaN, NaN, NaN, NaN, 1059.0, 1044.0], + [1007.0, 815.0, 775.0, NaN, NaN, NaN, NaN, 1043.0, 1098.0], + [956.0, 898.0, 782.0, 774.0, 774.0, 804.0, 831.0, 995.0, 1023.0], + [882.0, 1105.0, 946.0, 760.0, 805.0, 839.0, 870.0, 951.0, 1010.0], + [816.0, 964.0, 1132.0, 849.0, 798.0, 835.0, 980.0, 1012.0, 1015.0], + [844.0, 864.0, 1079.0, 929.0, 804.0, 817.0, 1004.0, 1074.0, 1144.0], + [832.0, 816.0, 893.0, 956.0, 807.0, 793.0, 875.0, 1106.0, 1200.0] + ],[ + [2049.0, 2006.0, 1990.0, NaN, NaN, NaN, NaN, 2015.0, 2027.0], + [2041.0, 2013.0, 1979.0, NaN, NaN, NaN, NaN, 2032.0, 2012.0], + [2005.0, 2009.0, 1979.0, NaN, NaN, NaN, NaN, 2049.0, 2051.0], + [1997.0, 1999.0, 1996.0, 1976.0, 2021.0, 2026.0, 2055.0, 2087.0, 2088.0], + [1970.0, 1990.0, 2025.0, 2027.0, 2039.0, 2057.0, 2090.0, 2094.0, 2115.0], + [1964.0, 1971.0, 2044.0, 2107.0, 2094.0, 2099.0, 2135.0, 2155.0, 2159.0], + [1963.0, 1977.0, 2059.0, 2132.0, 2137.0, 2146.0, 2181.0, 2203.0, 2182.0], + [1980.0, 2029.0, 2067.0, 2156.0, 2175.0, 2183.0, 2189.0, 2196.0, 2187.0] + ],[ + [5465.0, 5864.0, 6180.0, NaN, NaN, NaN, NaN, 6092.0, 5834.0], + [5736.0, 6040.0, 6264.0, NaN, NaN, NaN, NaN, 5386.0, 5362.0], + [6038.0, 6265.0, 6324.0, NaN, NaN, NaN, NaN, 5033.0, 5271.0], + [6145.0, 6245.0, 6098.0, 5732.0, 5519.0, 5519.0, 5318.0, 5147.0, 5228.0], + [6038.0, 6009.0, 5828.0, 5558.0, 5466.0, 5475.0, 5387.0, 5290.0, 5325.0], + [5941.0, 5853.0, 5749.0, 5564.0, 5459.0, 5419.0, 5371.0, 5397.0, 5483.0], + [6133.0, 6008.0, 5841.0, 5643.0, 5475.0, 5368.0, 5388.0, 5503.0, 5623.0], + [6117.0, 6058.0, 5913.0, 5668.0, 5476.0, 5480.0, 5644.0, 5799.0, 5815.0] + ],[ + [7200.0, 7226.0, 7254.0, NaN, NaN, NaN, NaN, 7274.0, 7232.0], + [7258.0, 7253.0, 7294.0, NaN, NaN, NaN, NaN, 7246.0, 7258.0], + [7227.0, 7228.0, 7319.0, NaN, NaN, NaN, NaN, 7253.0, 7285.0], + [7199.0, 7212.0, 7227.0, 7206.0, 7194.0, 7154.0, 7185.0, 7166.0, 7191.0], + [7115.0, 7170.0, 7170.0, 7128.0, 7115.0, 7085.0, 7013.0, 7027.0, 6978.0], + [6976.0, 7094.0, 7109.0, 7097.0, 7080.0, 7002.0, 6936.0, 6909.0, 6806.0], + [6944.0, 7036.0, 7025.0, 7033.0, 7036.0, 6967.0, 6905.0, 6821.0, 6726.0], + [6994.0, 6988.0, 6988.0, 6923.0, 6923.0, 6926.0, 6907.0, 6836.0, 6702.0] + ],[ + [1787.0, 1764.0, 1717.0, NaN, NaN, NaN, NaN, 2100.0, 2609.0], + [1798.0, 1602.0, 1560.0, NaN, NaN, NaN, NaN, 2128.0, 2702.0], + [1697.0, 1560.0, 1484.0, NaN, NaN, NaN, NaN, 2045.0, 2553.0], + [1440.0, 1509.0, 1504.0, 1615.0, 1655.0, 1698.0, 1730.0, 1998.0, 2444.0], + [1287.0, 1428.0, 1596.0, 1645.0, 1576.0, 1587.0, 1761.0, 2310.0, 2563.0], + [1310.0, 1376.0, 1586.0, 1594.0, 1516.0, 1414.0, 1719.0, 2359.0, 2543.0], + [1371.0, 1439.0, 1505.0, 1435.0, 1335.0, 1305.0, 1827.0, 2532.0, 2633.0], + [1324.0, 1459.0, 1385.0, 1285.0, 1176.0, 1264.0, 1809.0, 2724.0, 2918.0] + ],[ + [964.0, 961.0, 977.0, NaN, NaN, NaN, NaN, 1278.0, 1162.0], + [1099.0, 1052.0, 961.0, NaN, NaN, NaN, NaN, 1185.0, 1275.0], + [1129.0, 1085.0, 937.0, NaN, NaN, NaN, NaN, 1202.0, 1235.0], + [993.0, 1116.0, 1020.0, 977.0, 969.0, 983.0, 1012.0, 1104.0, 1179.0], + [983.0, 1106.0, 1215.0, 980.0, 983.0, 1006.0, 1049.0, 1126.0, 1186.0], + [979.0, 998.0, 1188.0, 1128.0, 967.0, 986.0, 1090.0, 1187.0, 1177.0], + [994.0, 974.0, 1064.0, 1170.0, 1003.0, 965.0, 1064.0, 1191.0, 1261.0], + [956.0, 959.0, 989.0, 1083.0, 1033.0, 981.0, 980.0, 1118.0, 1246.0] + ] + ], + [ + [ + [620.0, 687.0, 774.0, NaN, NaN, NaN, NaN, 1023.0, 985.0], + [817.0, 677.0, 687.0, NaN, NaN, NaN, NaN, 935.0, 924.0], + [958.0, 705.0, 650.0, NaN, NaN, NaN, NaN, 885.0, 906.0], + [791.0, 929.0, 736.0, 659.0, 635.0, 675.0, 797.0, 837.0, 835.0], + [758.0, 1101.0, 877.0, 686.0, 704.0, 823.0, 915.0, 830.0, 808.0], + [689.0, 956.0, 1064.0, 710.0, 739.0, 773.0, 898.0, 937.0, 840.0], + [753.0, 807.0, 1065.0, 921.0, 709.0, 687.0, 895.0, 1049.0, 954.0], + [697.0, 703.0, 814.0, 911.0, 716.0, 696.0, 749.0, 1007.0, 1070.0] + ],[ + [1979.0, 1940.0, 1900.0, NaN, NaN, NaN, NaN, 1903.0, 1906.0], + [1900.0, 1833.0, 1772.0, NaN, NaN, NaN, NaN, 1836.0, 1876.0], + [1847.0, 1800.0, 1763.0, NaN, NaN, NaN, NaN, 1839.0, 1848.0], + [1819.0, 1813.0, 1793.0, 1742.0, 1748.0, 1765.0, 1791.0, 1814.0, 1810.0], + [1793.0, 1809.0, 1800.0, 1745.0, 1755.0, 1788.0, 1792.0, 1764.0, 1790.0], + [1798.0, 1767.0, 1773.0, 1772.0, 1756.0, 1789.0, 1799.0, 1768.0, 1765.0], + [1780.0, 1761.0, 1804.0, 1815.0, 1797.0, 1822.0, 1826.0, 1821.0, 1802.0], + [1766.0, 1809.0, 1838.0, 1852.0, 1848.0, 1863.0, 1874.0, 1864.0, 1836.0] + ],[ + [5573.0, 5880.0, 6129.0, NaN, NaN, NaN, NaN, 6313.0, 6303.0], + [5619.0, 5899.0, 6097.0, NaN, NaN, NaN, NaN, 5872.0, 5898.0], + [5673.0, 5945.0, 6069.0, NaN, NaN, NaN, NaN, 5229.0, 5216.0], + [5882.0, 6026.0, 5857.0, 5499.0, 5058.0, 4818.0, 4802.0, 5005.0, 5011.0], + [6008.0, 5919.0, 5500.0, 5321.0, 5173.0, 4918.0, 4792.0, 4987.0, 5016.0], + [5809.0, 5635.0, 5313.0, 5206.0, 5181.0, 4998.0, 4925.0, 4943.0, 5052.0], + [5557.0, 5435.0, 5231.0, 5168.0, 5154.0, 5020.0, 5025.0, 5077.0, 5176.0], + [5514.0, 5427.0, 5291.0, 5196.0, 5100.0, 5011.0, 5130.0, 5221.0, 5352.0] + ],[ + [6820.0, 6828.0, 6823.0, NaN, NaN, NaN, NaN, 6719.0, 6707.0], + [6765.0, 6812.0, 6831.0, NaN, NaN, NaN, NaN, 6771.0, 6726.0], + [6835.0, 6845.0, 6859.0, NaN, NaN, NaN, NaN, 6778.0, 6756.0], + [6883.0, 6871.0, 6874.0, 6865.0, 6855.0, 6859.0, 6865.0, 6810.0, 6826.0], + [6813.0, 6841.0, 6862.0, 6851.0, 6799.0, 6800.0, 6821.0, 6785.0, 6747.0], + [6809.0, 6829.0, 6770.0, 6763.0, 6735.0, 6704.0, 6687.0, 6660.0, 6651.0], + [6686.0, 6752.0, 6735.0, 6726.0, 6681.0, 6584.0, 6551.0, 6515.0, 6485.0], + [6571.0, 6670.0, 6691.0, 6669.0, 6621.0, 6505.0, 6505.0, 6422.0, 6356.0] + ],[ + [1644.0, 1672.0, 1653.0, NaN, NaN, NaN, NaN, 1843.0, 2309.0], + [1702.0, 1547.0, 1469.0, NaN, NaN, NaN, NaN, 1944.0, 2458.0], + [1667.0, 1484.0, 1353.0, NaN, NaN, NaN, NaN, 1839.0, 2423.0], + [1431.0, 1419.0, 1366.0, 1416.0, 1471.0, 1511.0, 1562.0, 1774.0, 2349.0], + [1203.0, 1307.0, 1476.0, 1493.0, 1433.0, 1446.0, 1597.0, 1955.0, 2346.0], + [1184.0, 1248.0, 1484.0, 1481.0, 1369.0, 1321.0, 1526.0, 2136.0, 2468.0], + [1215.0, 1286.0, 1405.0, 1368.0, 1229.0, 1197.0, 1507.0, 2294.0, 2460.0], + [1219.0, 1329.0, 1307.0, 1186.0, 1080.0, 1090.0, 1571.0, 2488.0, 2620.0] + ],[ + [821.0, 833.0, 857.0, NaN, NaN, NaN, NaN, 1113.0, 1097.0], + [987.0, 909.0, 821.0, NaN, NaN, NaN, NaN, 1083.0, 1105.0], + [1032.0, 991.0, 798.0, NaN, NaN, NaN, NaN, 1031.0, 1028.0], + [871.0, 1077.0, 969.0, 799.0, 819.0, 907.0, 935.0, 978.0, 921.0], + [846.0, 1028.0, 1091.0, 880.0, 853.0, 927.0, 1000.0, 967.0, 928.0], + [807.0, 888.0, 1138.0, 1015.0, 862.0, 872.0, 967.0, 1027.0, 961.0], + [874.0, 817.0, 1012.0, 1074.0, 877.0, 829.0, 892.0, 1097.0, 1105.0], + [841.0, 798.0, 874.0, 966.0, 953.0, 843.0, 847.0, 1004.0, 1120.0] + ] + ], + [ + [ + [384.0, 378.0, 455.0, NaN, NaN, NaN, NaN, 975.0, 850.0], + [512.0, 413.0, 380.0, NaN, NaN, NaN, NaN, 852.0, 772.0], + [781.0, 452.0, 356.0, NaN, NaN, NaN, NaN, 750.0, 802.0], + [621.0, 686.0, 452.0, 398.0, 402.0, 400.0, 487.0, 699.0, 721.0], + [517.0, 876.0, 655.0, 380.0, 414.0, 445.0, 529.0, 680.0, 688.0], + [448.0, 769.0, 924.0, 490.0, 386.0, 469.0, 706.0, 819.0, 730.0], + [455.0, 469.0, 889.0, 691.0, 403.0, 441.0, 738.0, 971.0, 927.0], + [429.0, 413.0, 569.0, 663.0, 427.0, 406.0, 553.0, 957.0, 1039.0] + ],[ + [2022.0, 2013.0, 1994.0, NaN, NaN, NaN, NaN, 1826.0, 1813.0], + [1998.0, 1980.0, 1947.0, NaN, NaN, NaN, NaN, 1819.0, 1819.0], + [1933.0, 1897.0, 1886.0, NaN, NaN, NaN, NaN, 1812.0, 1834.0], + [1824.0, 1803.0, 1803.0, 1781.0, 1748.0, 1736.0, 1771.0, 1799.0, 1807.0], + [1693.0, 1690.0, 1742.0, 1707.0, 1686.0, 1683.0, 1717.0, 1771.0, 1777.0], + [1681.0, 1674.0, 1703.0, 1670.0, 1654.0, 1676.0, 1690.0, 1759.0, 1776.0], + [1665.0, 1642.0, 1677.0, 1692.0, 1645.0, 1643.0, 1672.0, 1731.0, 1774.0], + [1651.0, 1646.0, 1637.0, 1668.0, 1660.0, 1631.0, 1643.0, 1683.0, 1754.0] + ],[ + [6446.0, 6649.0, 6776.0, NaN, NaN, NaN, NaN, 7214.0, 7195.0], + [6381.0, 6639.0, 6834.0, NaN, NaN, NaN, NaN, 6876.0, 6869.0], + [6374.0, 6639.0, 6708.0, NaN, NaN, NaN, NaN, 6573.0, 6555.0], + [6392.0, 6543.0, 6400.0, 6178.0, 6112.0, 5961.0, 5751.0, 5711.0, 5812.0], + [6442.0, 6360.0, 5966.0, 5448.0, 5243.0, 5261.0, 5322.0, 5314.0, 5245.0], + [6406.0, 6037.0, 5704.0, 5446.0, 5119.0, 5051.0, 5286.0, 5335.0, 5180.0], + [6068.0, 5691.0, 5545.0, 5488.0, 5273.0, 5159.0, 5261.0, 5318.0, 5294.0], + [5802.0, 5541.0, 5457.0, 5450.0, 5305.0, 5297.0, 5326.0, 5452.0, 5570.0] + ],[ + [7168.0, 7178.0, 7176.0, NaN, NaN, NaN, NaN, 7047.0, 7050.0], + [7162.0, 7168.0, 7148.0, NaN, NaN, NaN, NaN, 7031.0, 7014.0], + [7136.0, 7135.0, 7127.0, NaN, NaN, NaN, NaN, 7047.0, 7048.0], + [7169.0, 7189.0, 7186.0, 7189.0, 7174.0, 7208.0, 7173.0, 7118.0, 7064.0], + [7208.0, 7233.0, 7248.0, 7212.0, 7206.0, 7219.0, 7183.0, 7155.0, 7083.0], + [7176.0, 7181.0, 7223.0, 7228.0, 7190.0, 7177.0, 7167.0, 7152.0, 7098.0], + [7174.0, 7207.0, 7198.0, 7141.0, 7118.0, 7095.0, 7065.0, 7052.0, 6986.0], + [7117.0, 7128.0, 7116.0, 7066.0, 7000.0, 6950.0, 6941.0, 6885.0, 6820.0] + ],[ + [1563.0, 1631.0, 1629.0, NaN, NaN, NaN, NaN, 1735.0, 2190.0], + [1621.0, 1490.0, 1404.0, NaN, NaN, NaN, NaN, 1791.0, 2374.0], + [1580.0, 1332.0, 1201.0, NaN, NaN, NaN, NaN, 1742.0, 2490.0], + [1287.0, 1282.0, 1177.0, 1208.0, 1289.0, 1378.0, 1423.0, 1699.0, 2363.0], + [993.0, 1200.0, 1277.0, 1279.0, 1309.0, 1317.0, 1379.0, 1741.0, 2291.0], + [874.0, 1047.0, 1333.0, 1301.0, 1230.0, 1186.0, 1374.0, 2044.0, 2398.0], + [952.0, 1005.0, 1258.0, 1211.0, 1041.0, 967.0, 1342.0, 2194.0, 2399.0], + [950.0, 1057.0, 1127.0, 999.0, 835.0, 817.0, 1400.0, 2354.0, 2531.0] + ],[ + [503.0, 510.0, 550.0, NaN, NaN, NaN, NaN, 1016.0, 934.0], + [735.0, 674.0, 490.0, NaN, NaN, NaN, NaN, 930.0, 981.0], + [740.0, 690.0, 502.0, NaN, NaN, NaN, NaN, 875.0, 898.0], + [587.0, 787.0, 667.0, 536.0, 502.0, 507.0, 590.0, 724.0, 800.0], + [540.0, 829.0, 940.0, 558.0, 521.0, 541.0, 680.0, 798.0, 813.0], + [512.0, 628.0, 907.0, 783.0, 530.0, 553.0, 724.0, 903.0, 840.0], + [528.0, 533.0, 698.0, 861.0, 639.0, 520.0, 679.0, 968.0, 1001.0], + [519.0, 516.0, 540.0, 703.0, 630.0, 524.0, 558.0, 816.0, 999.0] + ] + ], + [ + [ + [2811.0, 3581.0, 3633.0, NaN, NaN, NaN, NaN, 1588.0, 2416.0], + [3713.0, 3539.0, 3377.0, NaN, NaN, NaN, NaN, 1875.0, 1823.0], + [3276.0, 3569.0, 3249.0, NaN, NaN, NaN, NaN, 1471.0, 1147.0], + [3193.0, 3955.0, 3440.0, 3145.0, 2475.0, 2488.0, 2451.0, 1620.0, 1001.0], + [2191.0, 3473.0, 3411.0, 3577.0, 3529.0, 3481.0, 3447.0, 1894.0, 1009.0], + [1323.0, 2638.0, 3324.0, 3763.0, 3841.0, 3121.0, 2606.0, 1833.0, 1058.0], + [1687.0, 2001.0, 3160.0, 3933.0, 3937.0, 3285.0, 2383.0, 2352.0, 1648.0], + [2015.0, 1318.0, 2582.0, 3281.0, 3511.0, 3432.0, 2620.0, 2382.0, 2100.0] + ],[ + [3074.0, 3067.0, 3034.0, NaN, NaN, NaN, NaN, 2704.0, 2759.0], + [3032.0, 3045.0, 2984.0, NaN, NaN, NaN, NaN, 2680.0, 2703.0], + [2956.0, 3035.0, 2994.0, NaN, NaN, NaN, NaN, 2660.0, 2553.0], + [2860.0, 2985.0, 2967.0, 2978.0, 2932.0, 2947.0, 2970.0, 2746.0, 2526.0], + [2712.0, 2831.0, 2918.0, 3021.0, 3050.0, 3033.0, 3013.0, 2777.0, 2585.0], + [2723.0, 2767.0, 2971.0, 3099.0, 3110.0, 3017.0, 2928.0, 2828.0, 2708.0], + [2883.0, 2685.0, 2935.0, 3073.0, 3119.0, 3113.0, 3040.0, 2950.0, 2837.0], + [2943.0, 2786.0, 2911.0, 3046.0, 3102.0, 3173.0, 3112.0, 3038.0, 2944.0] + ],[ + [6470.0, 6929.0, 7344.0, NaN, NaN, NaN, NaN, 7504.0, 7452.0], + [6567.0, 6995.0, 7336.0, NaN, NaN, NaN, NaN, 6812.0, 6587.0], + [6839.0, 7139.0, 7222.0, NaN, NaN, NaN, NaN, 6126.0, 6195.0], + [7090.0, 7208.0, 7034.0, 6701.0, 6425.0, 6119.0, 5872.0, 5943.0, 6125.0], + [7016.0, 6994.0, 6733.0, 6360.0, 6282.0, 6212.0, 5950.0, 5894.0, 6025.0], + [6769.0, 6684.0, 6448.0, 6194.0, 6200.0, 6145.0, 5975.0, 6006.0, 6088.0], + [6698.0, 6575.0, 6414.0, 6237.0, 6177.0, 6061.0, 6036.0, 6143.0, 6179.0], + [6909.0, 6700.0, 6464.0, 6248.0, 6130.0, 6056.0, 6086.0, 6228.0, 6338.0] + ],[ + [7435.0, 7468.0, 7447.0, NaN, NaN, NaN, NaN, 7364.0, 7321.0], + [7463.0, 7486.0, 7493.0, NaN, NaN, NaN, NaN, 7398.0, 7343.0], + [7483.0, 7535.0, 7533.0, NaN, NaN, NaN, NaN, 7441.0, 7363.0], + [7470.0, 7493.0, 7535.0, 7473.0, 7471.0, 7472.0, 7451.0, 7426.0, 7375.0], + [7415.0, 7430.0, 7472.0, 7405.0, 7417.0, 7361.0, 7321.0, 7280.0, 7294.0], + [7360.0, 7390.0, 7362.0, 7338.0, 7343.0, 7223.0, 7168.0, 7162.0, 7124.0], + [7204.0, 7293.0, 7319.0, 7291.0, 7280.0, 7171.0, 7088.0, 7067.0, 6935.0], + [7192.0, 7254.0, 7241.0, 7227.0, 7219.0, 7123.0, 7026.0, 6938.0, 6810.0] + ],[ + [3460.0, 3527.0, 3254.0, NaN, NaN, NaN, NaN, 2840.0, 3317.0], + [3586.0, 3577.0, 3211.0, NaN, NaN, NaN, NaN, 2881.0, 3455.0], + [3601.0, 3620.0, 3265.0, NaN, NaN, NaN, NaN, 2795.0, 3393.0], + [3540.0, 3675.0, 3424.0, 3103.0, 2776.0, 2743.0, 2792.0, 2908.0, 3299.0], + [2684.0, 3140.0, 3349.0, 3253.0, 2958.0, 2900.0, 2928.0, 3101.0, 3394.0], + [2135.0, 2828.0, 3434.0, 3456.0, 3341.0, 3037.0, 2805.0, 3286.0, 3493.0], + [2714.0, 2572.0, 3349.0, 3563.0, 3708.0, 3324.0, 3028.0, 3459.0, 3502.0], + [2973.0, 2404.0, 3002.0, 3211.0, 3823.0, 3821.0, 3472.0, 3662.0, 3764.0] + ],[ + [3436.0, 3488.0, 3577.0, NaN, NaN, NaN, NaN, 1562.0, 2067.0], + [3624.0, 3787.0, 3280.0, NaN, NaN, NaN, NaN, 1799.0, 1795.0], + [3096.0, 3680.0, 3402.0, 2851.0, 2079.0, 1787.0, 1753.0, 1523.0, 1226.0], + [2661.0, 3689.0, 3683.0, 3481.0, 3170.0, 3283.0, 3128.0, 1934.0, 1161.0], + [1605.0, 2656.0, 3303.0, 3755.0, 3861.0, 3747.0, 3401.0, 1993.0, 1152.0], + [1477.0, 2018.0, 3058.0, 3842.0, 3970.0, 3166.0, 2343.0, 1908.0, 1342.0], + [2413.0, 1424.0, 2631.0, 3646.0, 3820.0, 3413.0, 2653.0, 2211.0, 1808.0], + [2581.0, 1579.0, 1912.0, 2861.0, 3406.0, 3499.0, 2904.0, 2388.0, 2066.0] + ] + ] + ] +} diff --git a/tests/assets/xytb-s2-small-masked-outside.json5 b/tests/assets/xytb-s2-small-masked-outside.json5 new file mode 100644 index 00000000..1b7160c5 --- /dev/null +++ b/tests/assets/xytb-s2-small-masked-outside.json5 @@ -0,0 +1,257 @@ +{ + "type": "datacube", + "nodata": NaN, + "order": ["bands", "t", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["blue", "green", "red", "nir"] + }, + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0, 5757465.0, 5757455.0, 5757445.0, 5757435.0, 5757425.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0, 404875.0, 404885.0, 404895.0, 404905.0, 404915.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [ + [NaN, NaN, NaN, 1037.0, 1087.0, 1124.0, 1197.0, NaN, NaN], + [NaN, NaN, NaN, 921.0, 1030.0, 1051.0, 1138.0, NaN, NaN], + [NaN, NaN, NaN, 793.0, 796.0, 795.0, 905.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 2006.0, 2005.0, 2000.0, 2015.0, NaN, NaN], + [NaN, NaN, NaN, 1969.0, 1965.0, 1979.0, 2025.0, NaN, NaN], + [NaN, NaN, NaN, 1950.0, 1963.0, 1988.0, 2021.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 6379.0, 6360.0, 6253.0, 6205.0, NaN, NaN], + [NaN, NaN, NaN, 6261.0, 5995.0, 5545.0, 5389.0, NaN, NaN], + [NaN, NaN, NaN, 6016.0, 5738.0, 5521.0, 5135.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 7246.0, 7317.0, 7301.0, 7279.0, NaN, NaN], + [NaN, NaN, NaN, 7303.0, 7281.0, 7292.0, 7320.0, NaN, NaN], + [NaN, NaN, NaN, 7288.0, 7258.0, 7270.0, 7282.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 1714.0, 1785.0, 1908.0, 1998.0, NaN, NaN], + [NaN, NaN, NaN, 1561.0, 1690.0, 1840.0, 1930.0, NaN, NaN], + [NaN, NaN, NaN, 1523.0, 1646.0, 1757.0, 1789.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 1083.0, 1250.0, 1207.0, 1302.0, NaN, NaN], + [NaN, NaN, NaN, 1006.0, 1114.0, 1102.0, 1227.0, NaN, NaN], + [NaN, NaN, NaN, 962.0, 958.0, 950.0, 1054.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ] + ], + [ + [ + [NaN, NaN, NaN, 971.0, 983.0, 1030.0, 1071.0, NaN, NaN], + [NaN, NaN, NaN, 806.0, 886.0, 850.0, 962.0, NaN, NaN], + [NaN, NaN, NaN, 636.0, 627.0, 591.0, 795.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 1905.0, 1914.0, 1900.0, 1891.0, NaN, NaN], + [NaN, NaN, NaN, 1778.0, 1801.0, 1816.0, 1834.0, NaN, NaN], + [NaN, NaN, NaN, 1772.0, 1764.0, 1765.0, 1811.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 6301.0, 6300.0, 6244.0, 6295.0, NaN, NaN], + [NaN, NaN, NaN, 6162.0, 6154.0, 6128.0, 6053.0, NaN, NaN], + [NaN, NaN, NaN, 5847.0, 5532.0, 5515.0, 5408.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 6802.0, 6809.0, 6799.0, 6767.0, NaN, NaN], + [NaN, NaN, NaN, 6844.0, 6853.0, 6837.0, 6820.0, NaN, NaN], + [NaN, NaN, NaN, 6871.0, 6876.0, 6867.0, 6839.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 1703.0, 1729.0, 1795.0, 1793.0, NaN, NaN], + [NaN, NaN, NaN, 1435.0, 1508.0, 1638.0, 1746.0, NaN, NaN], + [NaN, NaN, NaN, 1329.0, 1466.0, 1576.0, 1645.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 997.0, 1091.0, 1079.0, 1120.0, NaN, NaN], + [NaN, NaN, NaN, 847.0, 935.0, 927.0, 1025.0, NaN, NaN], + [NaN, NaN, NaN, 796.0, 765.0, 765.0, 851.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ] + ], + [ + [ + [NaN, NaN, NaN, 789.0, 911.0, 943.0, 974.0, NaN, NaN], + [NaN, NaN, NaN, 560.0, 726.0, 714.0, 877.0, NaN, NaN], + [NaN, NaN, NaN, 407.0, 452.0, 439.0, 568.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 1947.0, 1890.0, 1848.0, 1828.0, NaN, NaN], + [NaN, NaN, NaN, 1916.0, 1877.0, 1838.0, 1814.0, NaN, NaN], + [NaN, NaN, NaN, 1867.0, 1822.0, 1788.0, 1791.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 6921.0, 7022.0, 7121.0, 7217.0, NaN, NaN], + [NaN, NaN, NaN, 6845.0, 6790.0, 6874.0, 6936.0, NaN, NaN], + [NaN, NaN, NaN, 6706.0, 6719.0, 6627.0, 6561.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 7125.0, 7102.0, 7102.0, 7058.0, NaN, NaN], + [NaN, NaN, NaN, 7113.0, 7099.0, 7116.0, 7092.0, NaN, NaN], + [NaN, NaN, NaN, 7176.0, 7158.0, 7156.0, 7119.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 1759.0, 1888.0, 1824.0, 1704.0, NaN, NaN], + [NaN, NaN, NaN, 1336.0, 1417.0, 1541.0, 1647.0, NaN, NaN], + [NaN, NaN, NaN, 1205.0, 1313.0, 1464.0, 1555.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 727.0, 948.0, 960.0, 1034.0, NaN, NaN], + [NaN, NaN, NaN, 573.0, 726.0, 698.0, 851.0, NaN, NaN], + [NaN, NaN, NaN, 523.0, 513.0, 516.0, 643.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ] + ], + [ + [ + [NaN, NaN, NaN, 2705.0, 2019.0, 1872.0, 1629.0, NaN, NaN], + [NaN, NaN, NaN, 2523.0, 1632.0, 1478.0, 1443.0, NaN, NaN], + [NaN, NaN, NaN, 2458.0, 1504.0, 1206.0, 1287.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 2868.0, 2787.0, 2729.0, 2676.0, NaN, NaN], + [NaN, NaN, NaN, 2908.0, 2782.0, 2691.0, 2662.0, NaN, NaN], + [NaN, NaN, NaN, 2955.0, 2808.0, 2771.0, 2785.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 7451.0, 7567.0, 7565.0, 7595.0, NaN, NaN], + [NaN, NaN, NaN, 7338.0, 7169.0, 7027.0, 6983.0, NaN, NaN], + [NaN, NaN, NaN, 7022.0, 6554.0, 6165.0, 6084.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 7470.0, 7410.0, 7424.0, 7407.0, NaN, NaN], + [NaN, NaN, NaN, 7474.0, 7467.0, 7456.0, 7470.0, NaN, NaN], + [NaN, NaN, NaN, 7487.0, 7485.0, 7487.0, 7515.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 2862.0, 2772.0, 2746.0, 2716.0, NaN, NaN], + [NaN, NaN, NaN, 2788.0, 2613.0, 2631.0, 2723.0, NaN, NaN], + [NaN, NaN, NaN, 2916.0, 2607.0, 2618.0, 2641.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ],[ + [NaN, NaN, NaN, 3151.0, 2241.0, 2058.0, 1645.0, NaN, NaN], + [NaN, NaN, NaN, 2592.0, 1917.0, 1577.0, 1408.0, NaN, NaN], + [NaN, NaN, NaN, 2851.0, 2079.0, 1787.0, 1753.0, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN] + ] + ] + ] +} diff --git a/tests/assets/xytb-s2-small.json5 b/tests/assets/xytb-s2-small.json5 index 4df1037b..bc07c1e8 100644 --- a/tests/assets/xytb-s2-small.json5 +++ b/tests/assets/xytb-s2-small.json5 @@ -1,5 +1,6 @@ { "type": "datacube", + "nodata": NaN, "order": ["bands", "t", "y", "x"], "dimensions": { "bands": { @@ -23,5 +24,234 @@ "reference_system": "EPSG:25832" } }, - "data": [[[[770.0, 780.0, 838.0, 1037.0, 1087.0, 1124.0, 1197.0, 1182.0, 1014.0], [860.0, 799.0, 778.0, 921.0, 1030.0, 1051.0, 1138.0, 1059.0, 1044.0], [1007.0, 815.0, 775.0, 793.0, 796.0, 795.0, 905.0, 1043.0, 1098.0], [956.0, 898.0, 782.0, 774.0, 774.0, 804.0, 831.0, 995.0, 1023.0], [882.0, 1105.0, 946.0, 760.0, 805.0, 839.0, 870.0, 951.0, 1010.0], [816.0, 964.0, 1132.0, 849.0, 798.0, 835.0, 980.0, 1012.0, 1015.0], [844.0, 864.0, 1079.0, 929.0, 804.0, 817.0, 1004.0, 1074.0, 1144.0], [832.0, 816.0, 893.0, 956.0, 807.0, 793.0, 875.0, 1106.0, 1200.0]], [[2049.0, 2006.0, 1990.0, 2006.0, 2005.0, 2000.0, 2015.0, 2015.0, 2027.0], [2041.0, 2013.0, 1979.0, 1969.0, 1965.0, 1979.0, 2025.0, 2032.0, 2012.0], [2005.0, 2009.0, 1979.0, 1950.0, 1963.0, 1988.0, 2021.0, 2049.0, 2051.0], [1997.0, 1999.0, 1996.0, 1976.0, 2021.0, 2026.0, 2055.0, 2087.0, 2088.0], [1970.0, 1990.0, 2025.0, 2027.0, 2039.0, 2057.0, 2090.0, 2094.0, 2115.0], [1964.0, 1971.0, 2044.0, 2107.0, 2094.0, 2099.0, 2135.0, 2155.0, 2159.0], [1963.0, 1977.0, 2059.0, 2132.0, 2137.0, 2146.0, 2181.0, 2203.0, 2182.0], [1980.0, 2029.0, 2067.0, 2156.0, 2175.0, 2183.0, 2189.0, 2196.0, 2187.0]], [[5465.0, 5864.0, 6180.0, 6379.0, 6360.0, 6253.0, 6205.0, 6092.0, 5834.0], [5736.0, 6040.0, 6264.0, 6261.0, 5995.0, 5545.0, 5389.0, 5386.0, 5362.0], [6038.0, 6265.0, 6324.0, 6016.0, 5738.0, 5521.0, 5135.0, 5033.0, 5271.0], [6145.0, 6245.0, 6098.0, 5732.0, 5519.0, 5519.0, 5318.0, 5147.0, 5228.0], [6038.0, 6009.0, 5828.0, 5558.0, 5466.0, 5475.0, 5387.0, 5290.0, 5325.0], [5941.0, 5853.0, 5749.0, 5564.0, 5459.0, 5419.0, 5371.0, 5397.0, 5483.0], [6133.0, 6008.0, 5841.0, 5643.0, 5475.0, 5368.0, 5388.0, 5503.0, 5623.0], [6117.0, 6058.0, 5913.0, 5668.0, 5476.0, 5480.0, 5644.0, 5799.0, 5815.0]], [[7200.0, 7226.0, 7254.0, 7246.0, 7317.0, 7301.0, 7279.0, 7274.0, 7232.0], [7258.0, 7253.0, 7294.0, 7303.0, 7281.0, 7292.0, 7320.0, 7246.0, 7258.0], [7227.0, 7228.0, 7319.0, 7288.0, 7258.0, 7270.0, 7282.0, 7253.0, 7285.0], [7199.0, 7212.0, 7227.0, 7206.0, 7194.0, 7154.0, 7185.0, 7166.0, 7191.0], [7115.0, 7170.0, 7170.0, 7128.0, 7115.0, 7085.0, 7013.0, 7027.0, 6978.0], [6976.0, 7094.0, 7109.0, 7097.0, 7080.0, 7002.0, 6936.0, 6909.0, 6806.0], [6944.0, 7036.0, 7025.0, 7033.0, 7036.0, 6967.0, 6905.0, 6821.0, 6726.0], [6994.0, 6988.0, 6988.0, 6923.0, 6923.0, 6926.0, 6907.0, 6836.0, 6702.0]], [[1787.0, 1764.0, 1717.0, 1714.0, 1785.0, 1908.0, 1998.0, 2100.0, 2609.0], [1798.0, 1602.0, 1560.0, 1561.0, 1690.0, 1840.0, 1930.0, 2128.0, 2702.0], [1697.0, 1560.0, 1484.0, 1523.0, 1646.0, 1757.0, 1789.0, 2045.0, 2553.0], [1440.0, 1509.0, 1504.0, 1615.0, 1655.0, 1698.0, 1730.0, 1998.0, 2444.0], [1287.0, 1428.0, 1596.0, 1645.0, 1576.0, 1587.0, 1761.0, 2310.0, 2563.0], [1310.0, 1376.0, 1586.0, 1594.0, 1516.0, 1414.0, 1719.0, 2359.0, 2543.0], [1371.0, 1439.0, 1505.0, 1435.0, 1335.0, 1305.0, 1827.0, 2532.0, 2633.0], [1324.0, 1459.0, 1385.0, 1285.0, 1176.0, 1264.0, 1809.0, 2724.0, 2918.0]], [[964.0, 961.0, 977.0, 1083.0, 1250.0, 1207.0, 1302.0, 1278.0, 1162.0], [1099.0, 1052.0, 961.0, 1006.0, 1114.0, 1102.0, 1227.0, 1185.0, 1275.0], [1129.0, 1085.0, 937.0, 962.0, 958.0, 950.0, 1054.0, 1202.0, 1235.0], [993.0, 1116.0, 1020.0, 977.0, 969.0, 983.0, 1012.0, 1104.0, 1179.0], [983.0, 1106.0, 1215.0, 980.0, 983.0, 1006.0, 1049.0, 1126.0, 1186.0], [979.0, 998.0, 1188.0, 1128.0, 967.0, 986.0, 1090.0, 1187.0, 1177.0], [994.0, 974.0, 1064.0, 1170.0, 1003.0, 965.0, 1064.0, 1191.0, 1261.0], [956.0, 959.0, 989.0, 1083.0, 1033.0, 981.0, 980.0, 1118.0, 1246.0]]], [[[620.0, 687.0, 774.0, 971.0, 983.0, 1030.0, 1071.0, 1023.0, 985.0], [817.0, 677.0, 687.0, 806.0, 886.0, 850.0, 962.0, 935.0, 924.0], [958.0, 705.0, 650.0, 636.0, 627.0, 591.0, 795.0, 885.0, 906.0], [791.0, 929.0, 736.0, 659.0, 635.0, 675.0, 797.0, 837.0, 835.0], [758.0, 1101.0, 877.0, 686.0, 704.0, 823.0, 915.0, 830.0, 808.0], [689.0, 956.0, 1064.0, 710.0, 739.0, 773.0, 898.0, 937.0, 840.0], [753.0, 807.0, 1065.0, 921.0, 709.0, 687.0, 895.0, 1049.0, 954.0], [697.0, 703.0, 814.0, 911.0, 716.0, 696.0, 749.0, 1007.0, 1070.0]], [[1979.0, 1940.0, 1900.0, 1905.0, 1914.0, 1900.0, 1891.0, 1903.0, 1906.0], [1900.0, 1833.0, 1772.0, 1778.0, 1801.0, 1816.0, 1834.0, 1836.0, 1876.0], [1847.0, 1800.0, 1763.0, 1772.0, 1764.0, 1765.0, 1811.0, 1839.0, 1848.0], [1819.0, 1813.0, 1793.0, 1742.0, 1748.0, 1765.0, 1791.0, 1814.0, 1810.0], [1793.0, 1809.0, 1800.0, 1745.0, 1755.0, 1788.0, 1792.0, 1764.0, 1790.0], [1798.0, 1767.0, 1773.0, 1772.0, 1756.0, 1789.0, 1799.0, 1768.0, 1765.0], [1780.0, 1761.0, 1804.0, 1815.0, 1797.0, 1822.0, 1826.0, 1821.0, 1802.0], [1766.0, 1809.0, 1838.0, 1852.0, 1848.0, 1863.0, 1874.0, 1864.0, 1836.0]], [[5573.0, 5880.0, 6129.0, 6301.0, 6300.0, 6244.0, 6295.0, 6313.0, 6303.0], [5619.0, 5899.0, 6097.0, 6162.0, 6154.0, 6128.0, 6053.0, 5872.0, 5898.0], [5673.0, 5945.0, 6069.0, 5847.0, 5532.0, 5515.0, 5408.0, 5229.0, 5216.0], [5882.0, 6026.0, 5857.0, 5499.0, 5058.0, 4818.0, 4802.0, 5005.0, 5011.0], [6008.0, 5919.0, 5500.0, 5321.0, 5173.0, 4918.0, 4792.0, 4987.0, 5016.0], [5809.0, 5635.0, 5313.0, 5206.0, 5181.0, 4998.0, 4925.0, 4943.0, 5052.0], [5557.0, 5435.0, 5231.0, 5168.0, 5154.0, 5020.0, 5025.0, 5077.0, 5176.0], [5514.0, 5427.0, 5291.0, 5196.0, 5100.0, 5011.0, 5130.0, 5221.0, 5352.0]], [[6820.0, 6828.0, 6823.0, 6802.0, 6809.0, 6799.0, 6767.0, 6719.0, 6707.0], [6765.0, 6812.0, 6831.0, 6844.0, 6853.0, 6837.0, 6820.0, 6771.0, 6726.0], [6835.0, 6845.0, 6859.0, 6871.0, 6876.0, 6867.0, 6839.0, 6778.0, 6756.0], [6883.0, 6871.0, 6874.0, 6865.0, 6855.0, 6859.0, 6865.0, 6810.0, 6826.0], [6813.0, 6841.0, 6862.0, 6851.0, 6799.0, 6800.0, 6821.0, 6785.0, 6747.0], [6809.0, 6829.0, 6770.0, 6763.0, 6735.0, 6704.0, 6687.0, 6660.0, 6651.0], [6686.0, 6752.0, 6735.0, 6726.0, 6681.0, 6584.0, 6551.0, 6515.0, 6485.0], [6571.0, 6670.0, 6691.0, 6669.0, 6621.0, 6505.0, 6505.0, 6422.0, 6356.0]], [[1644.0, 1672.0, 1653.0, 1703.0, 1729.0, 1795.0, 1793.0, 1843.0, 2309.0], [1702.0, 1547.0, 1469.0, 1435.0, 1508.0, 1638.0, 1746.0, 1944.0, 2458.0], [1667.0, 1484.0, 1353.0, 1329.0, 1466.0, 1576.0, 1645.0, 1839.0, 2423.0], [1431.0, 1419.0, 1366.0, 1416.0, 1471.0, 1511.0, 1562.0, 1774.0, 2349.0], [1203.0, 1307.0, 1476.0, 1493.0, 1433.0, 1446.0, 1597.0, 1955.0, 2346.0], [1184.0, 1248.0, 1484.0, 1481.0, 1369.0, 1321.0, 1526.0, 2136.0, 2468.0], [1215.0, 1286.0, 1405.0, 1368.0, 1229.0, 1197.0, 1507.0, 2294.0, 2460.0], [1219.0, 1329.0, 1307.0, 1186.0, 1080.0, 1090.0, 1571.0, 2488.0, 2620.0]], [[821.0, 833.0, 857.0, 997.0, 1091.0, 1079.0, 1120.0, 1113.0, 1097.0], [987.0, 909.0, 821.0, 847.0, 935.0, 927.0, 1025.0, 1083.0, 1105.0], [1032.0, 991.0, 798.0, 796.0, 765.0, 765.0, 851.0, 1031.0, 1028.0], [871.0, 1077.0, 969.0, 799.0, 819.0, 907.0, 935.0, 978.0, 921.0], [846.0, 1028.0, 1091.0, 880.0, 853.0, 927.0, 1000.0, 967.0, 928.0], [807.0, 888.0, 1138.0, 1015.0, 862.0, 872.0, 967.0, 1027.0, 961.0], [874.0, 817.0, 1012.0, 1074.0, 877.0, 829.0, 892.0, 1097.0, 1105.0], [841.0, 798.0, 874.0, 966.0, 953.0, 843.0, 847.0, 1004.0, 1120.0]]], [[[384.0, 378.0, 455.0, 789.0, 911.0, 943.0, 974.0, 975.0, 850.0], [512.0, 413.0, 380.0, 560.0, 726.0, 714.0, 877.0, 852.0, 772.0], [781.0, 452.0, 356.0, 407.0, 452.0, 439.0, 568.0, 750.0, 802.0], [621.0, 686.0, 452.0, 398.0, 402.0, 400.0, 487.0, 699.0, 721.0], [517.0, 876.0, 655.0, 380.0, 414.0, 445.0, 529.0, 680.0, 688.0], [448.0, 769.0, 924.0, 490.0, 386.0, 469.0, 706.0, 819.0, 730.0], [455.0, 469.0, 889.0, 691.0, 403.0, 441.0, 738.0, 971.0, 927.0], [429.0, 413.0, 569.0, 663.0, 427.0, 406.0, 553.0, 957.0, 1039.0]], [[2022.0, 2013.0, 1994.0, 1947.0, 1890.0, 1848.0, 1828.0, 1826.0, 1813.0], [1998.0, 1980.0, 1947.0, 1916.0, 1877.0, 1838.0, 1814.0, 1819.0, 1819.0], [1933.0, 1897.0, 1886.0, 1867.0, 1822.0, 1788.0, 1791.0, 1812.0, 1834.0], [1824.0, 1803.0, 1803.0, 1781.0, 1748.0, 1736.0, 1771.0, 1799.0, 1807.0], [1693.0, 1690.0, 1742.0, 1707.0, 1686.0, 1683.0, 1717.0, 1771.0, 1777.0], [1681.0, 1674.0, 1703.0, 1670.0, 1654.0, 1676.0, 1690.0, 1759.0, 1776.0], [1665.0, 1642.0, 1677.0, 1692.0, 1645.0, 1643.0, 1672.0, 1731.0, 1774.0], [1651.0, 1646.0, 1637.0, 1668.0, 1660.0, 1631.0, 1643.0, 1683.0, 1754.0]], [[6446.0, 6649.0, 6776.0, 6921.0, 7022.0, 7121.0, 7217.0, 7214.0, 7195.0], [6381.0, 6639.0, 6834.0, 6845.0, 6790.0, 6874.0, 6936.0, 6876.0, 6869.0], [6374.0, 6639.0, 6708.0, 6706.0, 6719.0, 6627.0, 6561.0, 6573.0, 6555.0], [6392.0, 6543.0, 6400.0, 6178.0, 6112.0, 5961.0, 5751.0, 5711.0, 5812.0], [6442.0, 6360.0, 5966.0, 5448.0, 5243.0, 5261.0, 5322.0, 5314.0, 5245.0], [6406.0, 6037.0, 5704.0, 5446.0, 5119.0, 5051.0, 5286.0, 5335.0, 5180.0], [6068.0, 5691.0, 5545.0, 5488.0, 5273.0, 5159.0, 5261.0, 5318.0, 5294.0], [5802.0, 5541.0, 5457.0, 5450.0, 5305.0, 5297.0, 5326.0, 5452.0, 5570.0]], [[7168.0, 7178.0, 7176.0, 7125.0, 7102.0, 7102.0, 7058.0, 7047.0, 7050.0], [7162.0, 7168.0, 7148.0, 7113.0, 7099.0, 7116.0, 7092.0, 7031.0, 7014.0], [7136.0, 7135.0, 7127.0, 7176.0, 7158.0, 7156.0, 7119.0, 7047.0, 7048.0], [7169.0, 7189.0, 7186.0, 7189.0, 7174.0, 7208.0, 7173.0, 7118.0, 7064.0], [7208.0, 7233.0, 7248.0, 7212.0, 7206.0, 7219.0, 7183.0, 7155.0, 7083.0], [7176.0, 7181.0, 7223.0, 7228.0, 7190.0, 7177.0, 7167.0, 7152.0, 7098.0], [7174.0, 7207.0, 7198.0, 7141.0, 7118.0, 7095.0, 7065.0, 7052.0, 6986.0], [7117.0, 7128.0, 7116.0, 7066.0, 7000.0, 6950.0, 6941.0, 6885.0, 6820.0]], [[1563.0, 1631.0, 1629.0, 1759.0, 1888.0, 1824.0, 1704.0, 1735.0, 2190.0], [1621.0, 1490.0, 1404.0, 1336.0, 1417.0, 1541.0, 1647.0, 1791.0, 2374.0], [1580.0, 1332.0, 1201.0, 1205.0, 1313.0, 1464.0, 1555.0, 1742.0, 2490.0], [1287.0, 1282.0, 1177.0, 1208.0, 1289.0, 1378.0, 1423.0, 1699.0, 2363.0], [993.0, 1200.0, 1277.0, 1279.0, 1309.0, 1317.0, 1379.0, 1741.0, 2291.0], [874.0, 1047.0, 1333.0, 1301.0, 1230.0, 1186.0, 1374.0, 2044.0, 2398.0], [952.0, 1005.0, 1258.0, 1211.0, 1041.0, 967.0, 1342.0, 2194.0, 2399.0], [950.0, 1057.0, 1127.0, 999.0, 835.0, 817.0, 1400.0, 2354.0, 2531.0]], [[503.0, 510.0, 550.0, 727.0, 948.0, 960.0, 1034.0, 1016.0, 934.0], [735.0, 674.0, 490.0, 573.0, 726.0, 698.0, 851.0, 930.0, 981.0], [740.0, 690.0, 502.0, 523.0, 513.0, 516.0, 643.0, 875.0, 898.0], [587.0, 787.0, 667.0, 536.0, 502.0, 507.0, 590.0, 724.0, 800.0], [540.0, 829.0, 940.0, 558.0, 521.0, 541.0, 680.0, 798.0, 813.0], [512.0, 628.0, 907.0, 783.0, 530.0, 553.0, 724.0, 903.0, 840.0], [528.0, 533.0, 698.0, 861.0, 639.0, 520.0, 679.0, 968.0, 1001.0], [519.0, 516.0, 540.0, 703.0, 630.0, 524.0, 558.0, 816.0, 999.0]]], [[[2811.0, 3581.0, 3633.0, 2705.0, 2019.0, 1872.0, 1629.0, 1588.0, 2416.0], [3713.0, 3539.0, 3377.0, 2523.0, 1632.0, 1478.0, 1443.0, 1875.0, 1823.0], [3276.0, 3569.0, 3249.0, 2458.0, 1504.0, 1206.0, 1287.0, 1471.0, 1147.0], [3193.0, 3955.0, 3440.0, 3145.0, 2475.0, 2488.0, 2451.0, 1620.0, 1001.0], [2191.0, 3473.0, 3411.0, 3577.0, 3529.0, 3481.0, 3447.0, 1894.0, 1009.0], [1323.0, 2638.0, 3324.0, 3763.0, 3841.0, 3121.0, 2606.0, 1833.0, 1058.0], [1687.0, 2001.0, 3160.0, 3933.0, 3937.0, 3285.0, 2383.0, 2352.0, 1648.0], [2015.0, 1318.0, 2582.0, 3281.0, 3511.0, 3432.0, 2620.0, 2382.0, 2100.0]], [[3074.0, 3067.0, 3034.0, 2868.0, 2787.0, 2729.0, 2676.0, 2704.0, 2759.0], [3032.0, 3045.0, 2984.0, 2908.0, 2782.0, 2691.0, 2662.0, 2680.0, 2703.0], [2956.0, 3035.0, 2994.0, 2955.0, 2808.0, 2771.0, 2785.0, 2660.0, 2553.0], [2860.0, 2985.0, 2967.0, 2978.0, 2932.0, 2947.0, 2970.0, 2746.0, 2526.0], [2712.0, 2831.0, 2918.0, 3021.0, 3050.0, 3033.0, 3013.0, 2777.0, 2585.0], [2723.0, 2767.0, 2971.0, 3099.0, 3110.0, 3017.0, 2928.0, 2828.0, 2708.0], [2883.0, 2685.0, 2935.0, 3073.0, 3119.0, 3113.0, 3040.0, 2950.0, 2837.0], [2943.0, 2786.0, 2911.0, 3046.0, 3102.0, 3173.0, 3112.0, 3038.0, 2944.0]], [[6470.0, 6929.0, 7344.0, 7451.0, 7567.0, 7565.0, 7595.0, 7504.0, 7452.0], [6567.0, 6995.0, 7336.0, 7338.0, 7169.0, 7027.0, 6983.0, 6812.0, 6587.0], [6839.0, 7139.0, 7222.0, 7022.0, 6554.0, 6165.0, 6084.0, 6126.0, 6195.0], [7090.0, 7208.0, 7034.0, 6701.0, 6425.0, 6119.0, 5872.0, 5943.0, 6125.0], [7016.0, 6994.0, 6733.0, 6360.0, 6282.0, 6212.0, 5950.0, 5894.0, 6025.0], [6769.0, 6684.0, 6448.0, 6194.0, 6200.0, 6145.0, 5975.0, 6006.0, 6088.0], [6698.0, 6575.0, 6414.0, 6237.0, 6177.0, 6061.0, 6036.0, 6143.0, 6179.0], [6909.0, 6700.0, 6464.0, 6248.0, 6130.0, 6056.0, 6086.0, 6228.0, 6338.0]], [[7435.0, 7468.0, 7447.0, 7470.0, 7410.0, 7424.0, 7407.0, 7364.0, 7321.0], [7463.0, 7486.0, 7493.0, 7474.0, 7467.0, 7456.0, 7470.0, 7398.0, 7343.0], [7483.0, 7535.0, 7533.0, 7487.0, 7485.0, 7487.0, 7515.0, 7441.0, 7363.0], [7470.0, 7493.0, 7535.0, 7473.0, 7471.0, 7472.0, 7451.0, 7426.0, 7375.0], [7415.0, 7430.0, 7472.0, 7405.0, 7417.0, 7361.0, 7321.0, 7280.0, 7294.0], [7360.0, 7390.0, 7362.0, 7338.0, 7343.0, 7223.0, 7168.0, 7162.0, 7124.0], [7204.0, 7293.0, 7319.0, 7291.0, 7280.0, 7171.0, 7088.0, 7067.0, 6935.0], [7192.0, 7254.0, 7241.0, 7227.0, 7219.0, 7123.0, 7026.0, 6938.0, 6810.0]], [[3460.0, 3527.0, 3254.0, 2862.0, 2772.0, 2746.0, 2716.0, 2840.0, 3317.0], [3586.0, 3577.0, 3211.0, 2788.0, 2613.0, 2631.0, 2723.0, 2881.0, 3455.0], [3601.0, 3620.0, 3265.0, 2916.0, 2607.0, 2618.0, 2641.0, 2795.0, 3393.0], [3540.0, 3675.0, 3424.0, 3103.0, 2776.0, 2743.0, 2792.0, 2908.0, 3299.0], [2684.0, 3140.0, 3349.0, 3253.0, 2958.0, 2900.0, 2928.0, 3101.0, 3394.0], [2135.0, 2828.0, 3434.0, 3456.0, 3341.0, 3037.0, 2805.0, 3286.0, 3493.0], [2714.0, 2572.0, 3349.0, 3563.0, 3708.0, 3324.0, 3028.0, 3459.0, 3502.0], [2973.0, 2404.0, 3002.0, 3211.0, 3823.0, 3821.0, 3472.0, 3662.0, 3764.0]], [[3436.0, 3488.0, 3577.0, 3151.0, 2241.0, 2058.0, 1645.0, 1562.0, 2067.0], [3624.0, 3787.0, 3280.0, 2592.0, 1917.0, 1577.0, 1408.0, 1799.0, 1795.0], [3096.0, 3680.0, 3402.0, 2851.0, 2079.0, 1787.0, 1753.0, 1523.0, 1226.0], [2661.0, 3689.0, 3683.0, 3481.0, 3170.0, 3283.0, 3128.0, 1934.0, 1161.0], [1605.0, 2656.0, 3303.0, 3755.0, 3861.0, 3747.0, 3401.0, 1993.0, 1152.0], [1477.0, 2018.0, 3058.0, 3842.0, 3970.0, 3166.0, 2343.0, 1908.0, 1342.0], [2413.0, 1424.0, 2631.0, 3646.0, 3820.0, 3413.0, 2653.0, 2211.0, 1808.0], [2581.0, 1579.0, 1912.0, 2861.0, 3406.0, 3499.0, 2904.0, 2388.0, 2066.0]]]] + "data": [ + [ + [ + [770.0, 780.0, 838.0, 1037.0, 1087.0, 1124.0, 1197.0, 1182.0, 1014.0], + [860.0, 799.0, 778.0, 921.0, 1030.0, 1051.0, 1138.0, 1059.0, 1044.0], + [1007.0, 815.0, 775.0, 793.0, 796.0, 795.0, 905.0, 1043.0, 1098.0], + [956.0, 898.0, 782.0, 774.0, 774.0, 804.0, 831.0, 995.0, 1023.0], + [882.0, 1105.0, 946.0, 760.0, 805.0, 839.0, 870.0, 951.0, 1010.0], + [816.0, 964.0, 1132.0, 849.0, 798.0, 835.0, 980.0, 1012.0, 1015.0], + [844.0, 864.0, 1079.0, 929.0, 804.0, 817.0, 1004.0, 1074.0, 1144.0], + [832.0, 816.0, 893.0, 956.0, 807.0, 793.0, 875.0, 1106.0, 1200.0] + ],[ + [2049.0, 2006.0, 1990.0, 2006.0, 2005.0, 2000.0, 2015.0, 2015.0, 2027.0], + [2041.0, 2013.0, 1979.0, 1969.0, 1965.0, 1979.0, 2025.0, 2032.0, 2012.0], + [2005.0, 2009.0, 1979.0, 1950.0, 1963.0, 1988.0, 2021.0, 2049.0, 2051.0], + [1997.0, 1999.0, 1996.0, 1976.0, 2021.0, 2026.0, 2055.0, 2087.0, 2088.0], + [1970.0, 1990.0, 2025.0, 2027.0, 2039.0, 2057.0, 2090.0, 2094.0, 2115.0], + [1964.0, 1971.0, 2044.0, 2107.0, 2094.0, 2099.0, 2135.0, 2155.0, 2159.0], + [1963.0, 1977.0, 2059.0, 2132.0, 2137.0, 2146.0, 2181.0, 2203.0, 2182.0], + [1980.0, 2029.0, 2067.0, 2156.0, 2175.0, 2183.0, 2189.0, 2196.0, 2187.0] + ],[ + [5465.0, 5864.0, 6180.0, 6379.0, 6360.0, 6253.0, 6205.0, 6092.0, 5834.0], + [5736.0, 6040.0, 6264.0, 6261.0, 5995.0, 5545.0, 5389.0, 5386.0, 5362.0], + [6038.0, 6265.0, 6324.0, 6016.0, 5738.0, 5521.0, 5135.0, 5033.0, 5271.0], + [6145.0, 6245.0, 6098.0, 5732.0, 5519.0, 5519.0, 5318.0, 5147.0, 5228.0], + [6038.0, 6009.0, 5828.0, 5558.0, 5466.0, 5475.0, 5387.0, 5290.0, 5325.0], + [5941.0, 5853.0, 5749.0, 5564.0, 5459.0, 5419.0, 5371.0, 5397.0, 5483.0], + [6133.0, 6008.0, 5841.0, 5643.0, 5475.0, 5368.0, 5388.0, 5503.0, 5623.0], + [6117.0, 6058.0, 5913.0, 5668.0, 5476.0, 5480.0, 5644.0, 5799.0, 5815.0] + ],[ + [7200.0, 7226.0, 7254.0, 7246.0, 7317.0, 7301.0, 7279.0, 7274.0, 7232.0], + [7258.0, 7253.0, 7294.0, 7303.0, 7281.0, 7292.0, 7320.0, 7246.0, 7258.0], + [7227.0, 7228.0, 7319.0, 7288.0, 7258.0, 7270.0, 7282.0, 7253.0, 7285.0], + [7199.0, 7212.0, 7227.0, 7206.0, 7194.0, 7154.0, 7185.0, 7166.0, 7191.0], + [7115.0, 7170.0, 7170.0, 7128.0, 7115.0, 7085.0, 7013.0, 7027.0, 6978.0], + [6976.0, 7094.0, 7109.0, 7097.0, 7080.0, 7002.0, 6936.0, 6909.0, 6806.0], + [6944.0, 7036.0, 7025.0, 7033.0, 7036.0, 6967.0, 6905.0, 6821.0, 6726.0], + [6994.0, 6988.0, 6988.0, 6923.0, 6923.0, 6926.0, 6907.0, 6836.0, 6702.0] + ],[ + [1787.0, 1764.0, 1717.0, 1714.0, 1785.0, 1908.0, 1998.0, 2100.0, 2609.0], + [1798.0, 1602.0, 1560.0, 1561.0, 1690.0, 1840.0, 1930.0, 2128.0, 2702.0], + [1697.0, 1560.0, 1484.0, 1523.0, 1646.0, 1757.0, 1789.0, 2045.0, 2553.0], + [1440.0, 1509.0, 1504.0, 1615.0, 1655.0, 1698.0, 1730.0, 1998.0, 2444.0], + [1287.0, 1428.0, 1596.0, 1645.0, 1576.0, 1587.0, 1761.0, 2310.0, 2563.0], + [1310.0, 1376.0, 1586.0, 1594.0, 1516.0, 1414.0, 1719.0, 2359.0, 2543.0], + [1371.0, 1439.0, 1505.0, 1435.0, 1335.0, 1305.0, 1827.0, 2532.0, 2633.0], + [1324.0, 1459.0, 1385.0, 1285.0, 1176.0, 1264.0, 1809.0, 2724.0, 2918.0] + ],[ + [964.0, 961.0, 977.0, 1083.0, 1250.0, 1207.0, 1302.0, 1278.0, 1162.0], + [1099.0, 1052.0, 961.0, 1006.0, 1114.0, 1102.0, 1227.0, 1185.0, 1275.0], + [1129.0, 1085.0, 937.0, 962.0, 958.0, 950.0, 1054.0, 1202.0, 1235.0], + [993.0, 1116.0, 1020.0, 977.0, 969.0, 983.0, 1012.0, 1104.0, 1179.0], + [983.0, 1106.0, 1215.0, 980.0, 983.0, 1006.0, 1049.0, 1126.0, 1186.0], + [979.0, 998.0, 1188.0, 1128.0, 967.0, 986.0, 1090.0, 1187.0, 1177.0], + [994.0, 974.0, 1064.0, 1170.0, 1003.0, 965.0, 1064.0, 1191.0, 1261.0], + [956.0, 959.0, 989.0, 1083.0, 1033.0, 981.0, 980.0, 1118.0, 1246.0] + ] + ], + [ + [ + [620.0, 687.0, 774.0, 971.0, 983.0, 1030.0, 1071.0, 1023.0, 985.0], + [817.0, 677.0, 687.0, 806.0, 886.0, 850.0, 962.0, 935.0, 924.0], + [958.0, 705.0, 650.0, 636.0, 627.0, 591.0, 795.0, 885.0, 906.0], + [791.0, 929.0, 736.0, 659.0, 635.0, 675.0, 797.0, 837.0, 835.0], + [758.0, 1101.0, 877.0, 686.0, 704.0, 823.0, 915.0, 830.0, 808.0], + [689.0, 956.0, 1064.0, 710.0, 739.0, 773.0, 898.0, 937.0, 840.0], + [753.0, 807.0, 1065.0, 921.0, 709.0, 687.0, 895.0, 1049.0, 954.0], + [697.0, 703.0, 814.0, 911.0, 716.0, 696.0, 749.0, 1007.0, 1070.0] + ],[ + [1979.0, 1940.0, 1900.0, 1905.0, 1914.0, 1900.0, 1891.0, 1903.0, 1906.0], + [1900.0, 1833.0, 1772.0, 1778.0, 1801.0, 1816.0, 1834.0, 1836.0, 1876.0], + [1847.0, 1800.0, 1763.0, 1772.0, 1764.0, 1765.0, 1811.0, 1839.0, 1848.0], + [1819.0, 1813.0, 1793.0, 1742.0, 1748.0, 1765.0, 1791.0, 1814.0, 1810.0], + [1793.0, 1809.0, 1800.0, 1745.0, 1755.0, 1788.0, 1792.0, 1764.0, 1790.0], + [1798.0, 1767.0, 1773.0, 1772.0, 1756.0, 1789.0, 1799.0, 1768.0, 1765.0], + [1780.0, 1761.0, 1804.0, 1815.0, 1797.0, 1822.0, 1826.0, 1821.0, 1802.0], + [1766.0, 1809.0, 1838.0, 1852.0, 1848.0, 1863.0, 1874.0, 1864.0, 1836.0] + ],[ + [5573.0, 5880.0, 6129.0, 6301.0, 6300.0, 6244.0, 6295.0, 6313.0, 6303.0], + [5619.0, 5899.0, 6097.0, 6162.0, 6154.0, 6128.0, 6053.0, 5872.0, 5898.0], + [5673.0, 5945.0, 6069.0, 5847.0, 5532.0, 5515.0, 5408.0, 5229.0, 5216.0], + [5882.0, 6026.0, 5857.0, 5499.0, 5058.0, 4818.0, 4802.0, 5005.0, 5011.0], + [6008.0, 5919.0, 5500.0, 5321.0, 5173.0, 4918.0, 4792.0, 4987.0, 5016.0], + [5809.0, 5635.0, 5313.0, 5206.0, 5181.0, 4998.0, 4925.0, 4943.0, 5052.0], + [5557.0, 5435.0, 5231.0, 5168.0, 5154.0, 5020.0, 5025.0, 5077.0, 5176.0], + [5514.0, 5427.0, 5291.0, 5196.0, 5100.0, 5011.0, 5130.0, 5221.0, 5352.0] + ],[ + [6820.0, 6828.0, 6823.0, 6802.0, 6809.0, 6799.0, 6767.0, 6719.0, 6707.0], + [6765.0, 6812.0, 6831.0, 6844.0, 6853.0, 6837.0, 6820.0, 6771.0, 6726.0], + [6835.0, 6845.0, 6859.0, 6871.0, 6876.0, 6867.0, 6839.0, 6778.0, 6756.0], + [6883.0, 6871.0, 6874.0, 6865.0, 6855.0, 6859.0, 6865.0, 6810.0, 6826.0], + [6813.0, 6841.0, 6862.0, 6851.0, 6799.0, 6800.0, 6821.0, 6785.0, 6747.0], + [6809.0, 6829.0, 6770.0, 6763.0, 6735.0, 6704.0, 6687.0, 6660.0, 6651.0], + [6686.0, 6752.0, 6735.0, 6726.0, 6681.0, 6584.0, 6551.0, 6515.0, 6485.0], + [6571.0, 6670.0, 6691.0, 6669.0, 6621.0, 6505.0, 6505.0, 6422.0, 6356.0] + ],[ + [1644.0, 1672.0, 1653.0, 1703.0, 1729.0, 1795.0, 1793.0, 1843.0, 2309.0], + [1702.0, 1547.0, 1469.0, 1435.0, 1508.0, 1638.0, 1746.0, 1944.0, 2458.0], + [1667.0, 1484.0, 1353.0, 1329.0, 1466.0, 1576.0, 1645.0, 1839.0, 2423.0], + [1431.0, 1419.0, 1366.0, 1416.0, 1471.0, 1511.0, 1562.0, 1774.0, 2349.0], + [1203.0, 1307.0, 1476.0, 1493.0, 1433.0, 1446.0, 1597.0, 1955.0, 2346.0], + [1184.0, 1248.0, 1484.0, 1481.0, 1369.0, 1321.0, 1526.0, 2136.0, 2468.0], + [1215.0, 1286.0, 1405.0, 1368.0, 1229.0, 1197.0, 1507.0, 2294.0, 2460.0], + [1219.0, 1329.0, 1307.0, 1186.0, 1080.0, 1090.0, 1571.0, 2488.0, 2620.0] + ],[ + [821.0, 833.0, 857.0, 997.0, 1091.0, 1079.0, 1120.0, 1113.0, 1097.0], + [987.0, 909.0, 821.0, 847.0, 935.0, 927.0, 1025.0, 1083.0, 1105.0], + [1032.0, 991.0, 798.0, 796.0, 765.0, 765.0, 851.0, 1031.0, 1028.0], + [871.0, 1077.0, 969.0, 799.0, 819.0, 907.0, 935.0, 978.0, 921.0], + [846.0, 1028.0, 1091.0, 880.0, 853.0, 927.0, 1000.0, 967.0, 928.0], + [807.0, 888.0, 1138.0, 1015.0, 862.0, 872.0, 967.0, 1027.0, 961.0], + [874.0, 817.0, 1012.0, 1074.0, 877.0, 829.0, 892.0, 1097.0, 1105.0], + [841.0, 798.0, 874.0, 966.0, 953.0, 843.0, 847.0, 1004.0, 1120.0] + ] + ], + [ + [ + [384.0, 378.0, 455.0, 789.0, 911.0, 943.0, 974.0, 975.0, 850.0], + [512.0, 413.0, 380.0, 560.0, 726.0, 714.0, 877.0, 852.0, 772.0], + [781.0, 452.0, 356.0, 407.0, 452.0, 439.0, 568.0, 750.0, 802.0], + [621.0, 686.0, 452.0, 398.0, 402.0, 400.0, 487.0, 699.0, 721.0], + [517.0, 876.0, 655.0, 380.0, 414.0, 445.0, 529.0, 680.0, 688.0], + [448.0, 769.0, 924.0, 490.0, 386.0, 469.0, 706.0, 819.0, 730.0], + [455.0, 469.0, 889.0, 691.0, 403.0, 441.0, 738.0, 971.0, 927.0], + [429.0, 413.0, 569.0, 663.0, 427.0, 406.0, 553.0, 957.0, 1039.0] + ],[ + [2022.0, 2013.0, 1994.0, 1947.0, 1890.0, 1848.0, 1828.0, 1826.0, 1813.0], + [1998.0, 1980.0, 1947.0, 1916.0, 1877.0, 1838.0, 1814.0, 1819.0, 1819.0], + [1933.0, 1897.0, 1886.0, 1867.0, 1822.0, 1788.0, 1791.0, 1812.0, 1834.0], + [1824.0, 1803.0, 1803.0, 1781.0, 1748.0, 1736.0, 1771.0, 1799.0, 1807.0], + [1693.0, 1690.0, 1742.0, 1707.0, 1686.0, 1683.0, 1717.0, 1771.0, 1777.0], + [1681.0, 1674.0, 1703.0, 1670.0, 1654.0, 1676.0, 1690.0, 1759.0, 1776.0], + [1665.0, 1642.0, 1677.0, 1692.0, 1645.0, 1643.0, 1672.0, 1731.0, 1774.0], + [1651.0, 1646.0, 1637.0, 1668.0, 1660.0, 1631.0, 1643.0, 1683.0, 1754.0] + ],[ + [6446.0, 6649.0, 6776.0, 6921.0, 7022.0, 7121.0, 7217.0, 7214.0, 7195.0], + [6381.0, 6639.0, 6834.0, 6845.0, 6790.0, 6874.0, 6936.0, 6876.0, 6869.0], + [6374.0, 6639.0, 6708.0, 6706.0, 6719.0, 6627.0, 6561.0, 6573.0, 6555.0], + [6392.0, 6543.0, 6400.0, 6178.0, 6112.0, 5961.0, 5751.0, 5711.0, 5812.0], + [6442.0, 6360.0, 5966.0, 5448.0, 5243.0, 5261.0, 5322.0, 5314.0, 5245.0], + [6406.0, 6037.0, 5704.0, 5446.0, 5119.0, 5051.0, 5286.0, 5335.0, 5180.0], + [6068.0, 5691.0, 5545.0, 5488.0, 5273.0, 5159.0, 5261.0, 5318.0, 5294.0], + [5802.0, 5541.0, 5457.0, 5450.0, 5305.0, 5297.0, 5326.0, 5452.0, 5570.0] + ],[ + [7168.0, 7178.0, 7176.0, 7125.0, 7102.0, 7102.0, 7058.0, 7047.0, 7050.0], + [7162.0, 7168.0, 7148.0, 7113.0, 7099.0, 7116.0, 7092.0, 7031.0, 7014.0], + [7136.0, 7135.0, 7127.0, 7176.0, 7158.0, 7156.0, 7119.0, 7047.0, 7048.0], + [7169.0, 7189.0, 7186.0, 7189.0, 7174.0, 7208.0, 7173.0, 7118.0, 7064.0], + [7208.0, 7233.0, 7248.0, 7212.0, 7206.0, 7219.0, 7183.0, 7155.0, 7083.0], + [7176.0, 7181.0, 7223.0, 7228.0, 7190.0, 7177.0, 7167.0, 7152.0, 7098.0], + [7174.0, 7207.0, 7198.0, 7141.0, 7118.0, 7095.0, 7065.0, 7052.0, 6986.0], + [7117.0, 7128.0, 7116.0, 7066.0, 7000.0, 6950.0, 6941.0, 6885.0, 6820.0] + ],[ + [1563.0, 1631.0, 1629.0, 1759.0, 1888.0, 1824.0, 1704.0, 1735.0, 2190.0], + [1621.0, 1490.0, 1404.0, 1336.0, 1417.0, 1541.0, 1647.0, 1791.0, 2374.0], + [1580.0, 1332.0, 1201.0, 1205.0, 1313.0, 1464.0, 1555.0, 1742.0, 2490.0], + [1287.0, 1282.0, 1177.0, 1208.0, 1289.0, 1378.0, 1423.0, 1699.0, 2363.0], + [993.0, 1200.0, 1277.0, 1279.0, 1309.0, 1317.0, 1379.0, 1741.0, 2291.0], + [874.0, 1047.0, 1333.0, 1301.0, 1230.0, 1186.0, 1374.0, 2044.0, 2398.0], + [952.0, 1005.0, 1258.0, 1211.0, 1041.0, 967.0, 1342.0, 2194.0, 2399.0], + [950.0, 1057.0, 1127.0, 999.0, 835.0, 817.0, 1400.0, 2354.0, 2531.0] + ],[ + [503.0, 510.0, 550.0, 727.0, 948.0, 960.0, 1034.0, 1016.0, 934.0], + [735.0, 674.0, 490.0, 573.0, 726.0, 698.0, 851.0, 930.0, 981.0], + [740.0, 690.0, 502.0, 523.0, 513.0, 516.0, 643.0, 875.0, 898.0], + [587.0, 787.0, 667.0, 536.0, 502.0, 507.0, 590.0, 724.0, 800.0], + [540.0, 829.0, 940.0, 558.0, 521.0, 541.0, 680.0, 798.0, 813.0], + [512.0, 628.0, 907.0, 783.0, 530.0, 553.0, 724.0, 903.0, 840.0], + [528.0, 533.0, 698.0, 861.0, 639.0, 520.0, 679.0, 968.0, 1001.0], + [519.0, 516.0, 540.0, 703.0, 630.0, 524.0, 558.0, 816.0, 999.0] + ] + ], + [ + [ + [2811.0, 3581.0, 3633.0, 2705.0, 2019.0, 1872.0, 1629.0, 1588.0, 2416.0], + [3713.0, 3539.0, 3377.0, 2523.0, 1632.0, 1478.0, 1443.0, 1875.0, 1823.0], + [3276.0, 3569.0, 3249.0, 2458.0, 1504.0, 1206.0, 1287.0, 1471.0, 1147.0], + [3193.0, 3955.0, 3440.0, 3145.0, 2475.0, 2488.0, 2451.0, 1620.0, 1001.0], + [2191.0, 3473.0, 3411.0, 3577.0, 3529.0, 3481.0, 3447.0, 1894.0, 1009.0], + [1323.0, 2638.0, 3324.0, 3763.0, 3841.0, 3121.0, 2606.0, 1833.0, 1058.0], + [1687.0, 2001.0, 3160.0, 3933.0, 3937.0, 3285.0, 2383.0, 2352.0, 1648.0], + [2015.0, 1318.0, 2582.0, 3281.0, 3511.0, 3432.0, 2620.0, 2382.0, 2100.0] + ],[ + [3074.0, 3067.0, 3034.0, 2868.0, 2787.0, 2729.0, 2676.0, 2704.0, 2759.0], + [3032.0, 3045.0, 2984.0, 2908.0, 2782.0, 2691.0, 2662.0, 2680.0, 2703.0], + [2956.0, 3035.0, 2994.0, 2955.0, 2808.0, 2771.0, 2785.0, 2660.0, 2553.0], + [2860.0, 2985.0, 2967.0, 2978.0, 2932.0, 2947.0, 2970.0, 2746.0, 2526.0], + [2712.0, 2831.0, 2918.0, 3021.0, 3050.0, 3033.0, 3013.0, 2777.0, 2585.0], + [2723.0, 2767.0, 2971.0, 3099.0, 3110.0, 3017.0, 2928.0, 2828.0, 2708.0], + [2883.0, 2685.0, 2935.0, 3073.0, 3119.0, 3113.0, 3040.0, 2950.0, 2837.0], + [2943.0, 2786.0, 2911.0, 3046.0, 3102.0, 3173.0, 3112.0, 3038.0, 2944.0] + ],[ + [6470.0, 6929.0, 7344.0, 7451.0, 7567.0, 7565.0, 7595.0, 7504.0, 7452.0], + [6567.0, 6995.0, 7336.0, 7338.0, 7169.0, 7027.0, 6983.0, 6812.0, 6587.0], + [6839.0, 7139.0, 7222.0, 7022.0, 6554.0, 6165.0, 6084.0, 6126.0, 6195.0], + [7090.0, 7208.0, 7034.0, 6701.0, 6425.0, 6119.0, 5872.0, 5943.0, 6125.0], + [7016.0, 6994.0, 6733.0, 6360.0, 6282.0, 6212.0, 5950.0, 5894.0, 6025.0], + [6769.0, 6684.0, 6448.0, 6194.0, 6200.0, 6145.0, 5975.0, 6006.0, 6088.0], + [6698.0, 6575.0, 6414.0, 6237.0, 6177.0, 6061.0, 6036.0, 6143.0, 6179.0], + [6909.0, 6700.0, 6464.0, 6248.0, 6130.0, 6056.0, 6086.0, 6228.0, 6338.0] + ],[ + [7435.0, 7468.0, 7447.0, 7470.0, 7410.0, 7424.0, 7407.0, 7364.0, 7321.0], + [7463.0, 7486.0, 7493.0, 7474.0, 7467.0, 7456.0, 7470.0, 7398.0, 7343.0], + [7483.0, 7535.0, 7533.0, 7487.0, 7485.0, 7487.0, 7515.0, 7441.0, 7363.0], + [7470.0, 7493.0, 7535.0, 7473.0, 7471.0, 7472.0, 7451.0, 7426.0, 7375.0], + [7415.0, 7430.0, 7472.0, 7405.0, 7417.0, 7361.0, 7321.0, 7280.0, 7294.0], + [7360.0, 7390.0, 7362.0, 7338.0, 7343.0, 7223.0, 7168.0, 7162.0, 7124.0], + [7204.0, 7293.0, 7319.0, 7291.0, 7280.0, 7171.0, 7088.0, 7067.0, 6935.0], + [7192.0, 7254.0, 7241.0, 7227.0, 7219.0, 7123.0, 7026.0, 6938.0, 6810.0] + ],[ + [3460.0, 3527.0, 3254.0, 2862.0, 2772.0, 2746.0, 2716.0, 2840.0, 3317.0], + [3586.0, 3577.0, 3211.0, 2788.0, 2613.0, 2631.0, 2723.0, 2881.0, 3455.0], + [3601.0, 3620.0, 3265.0, 2916.0, 2607.0, 2618.0, 2641.0, 2795.0, 3393.0], + [3540.0, 3675.0, 3424.0, 3103.0, 2776.0, 2743.0, 2792.0, 2908.0, 3299.0], + [2684.0, 3140.0, 3349.0, 3253.0, 2958.0, 2900.0, 2928.0, 3101.0, 3394.0], + [2135.0, 2828.0, 3434.0, 3456.0, 3341.0, 3037.0, 2805.0, 3286.0, 3493.0], + [2714.0, 2572.0, 3349.0, 3563.0, 3708.0, 3324.0, 3028.0, 3459.0, 3502.0], + [2973.0, 2404.0, 3002.0, 3211.0, 3823.0, 3821.0, 3472.0, 3662.0, 3764.0] + ],[ + [3436.0, 3488.0, 3577.0, 3151.0, 2241.0, 2058.0, 1645.0, 1562.0, 2067.0], + [3624.0, 3787.0, 3280.0, 2592.0, 1917.0, 1577.0, 1408.0, 1799.0, 1795.0], + [3096.0, 3680.0, 3402.0, 2851.0, 2079.0, 1787.0, 1753.0, 1523.0, 1226.0], + [2661.0, 3689.0, 3683.0, 3481.0, 3170.0, 3283.0, 3128.0, 1934.0, 1161.0], + [1605.0, 2656.0, 3303.0, 3755.0, 3861.0, 3747.0, 3401.0, 1993.0, 1152.0], + [1477.0, 2018.0, 3058.0, 3842.0, 3970.0, 3166.0, 2343.0, 1908.0, 1342.0], + [2413.0, 1424.0, 2631.0, 3646.0, 3820.0, 3413.0, 2653.0, 2211.0, 1808.0], + [2581.0, 1579.0, 1912.0, 2861.0, 3406.0, 3499.0, 2904.0, 2388.0, 2066.0] + ] + ] + ] } diff --git a/tests/filter_bbox.json5 b/tests/filter_bbox.json5 index 468859bf..e4d75657 100644 --- a/tests/filter_bbox.json5 +++ b/tests/filter_bbox.json5 @@ -1,5 +1,139 @@ { + // todo: tests missing for vector data cubes and the z dimension "id": "filter_bbox", "level": "L2", - "tests": [] + "tests": [ + { + // bbox doesn't intersect with data, empty result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "west": 16.1, + "south": 48.1, + "east": 16.6, + "north": 48.6 + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["bands", "t", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["blue", "green", "red", "nir"], + }, + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"], + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [], + "reference_system": "EPSG:25832" + } + }, + "data": null + } + }, + { + // bbox fully covers the data, no change result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "west": -16.1, + "south": 40.18, + "east": 32.88, + "north": 84.73 + } + }, + "returns": { + "$ref": "assets/xytb-s2-small.json5" + } + }, + { + // bbox (without crs) intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "east": 404900.0, + "south": 5757475.0, + "west": 404860.0, + "north": 5757500.0, + "crs": 25832 + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + }, + { + // bbox (without explicit crs) intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "east": 7.615929556794445, + "south": 51.95982196234872, + "west": 7.615340662408175, + "north": 51.96005351522534 + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + }, + { + // bbox (with EPSG code as crs) intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "east": 7.615929556794445, + "south": 51.95982196234872, + "west": 7.615340662408175, + "north": 51.96005351522534, + "crs": 4326 + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + }, + { + // bbox (with WKT2 code as crs) intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "east": 404900.0, + "south": 5757475.0, + "west": 404860.0, + "north": 5757500.0, + "crs": { + "$ref": "assets/epsg25832.wkt2" + } + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + } + ] } diff --git a/tests/filter_spatial.json5 b/tests/filter_spatial.json5 index a6853c5f..05f95143 100644 --- a/tests/filter_spatial.json5 +++ b/tests/filter_spatial.json5 @@ -1,5 +1,160 @@ { + // todo: GeoJSON as input for geometries is deprecated; migrate to Vector data cubes (missing the encoding yet) "id": "filter_spatial", "level": "L2A", - "tests": [] + "tests": [ + { + // geometry doesn't intersect with data, empty result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "geometries": { + "type": "Polygon", + "coordinates": [ + [ + [16.1, 48.1], + [16.1, 48.6], + [16.6, 48.6], + [16.6, 48.1], + [16.1, 48.1] + ] + ] + } + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["bands", "t", "y", "x"], + "dimensions": { + "bands": { + "type": "bands", + "values": ["blue", "green", "red", "nir"], + }, + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"], + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [], + "reference_system": "EPSG:25832" + } + }, + "data": null + } + }, + { + // geometry fully covers the data, no change result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "geometries": { + "type": "Polygon", + "coordinates": [ + [ + [-16.1, 40.18], + [-16.1, 84.73], + [32.88, 84.73], + [32.88, 40.18], + [-16.1, 40.18] + ] + ] + } + }, + "returns": { + "$ref": "assets/xytb-s2-small.json5" + } + }, + { + // Polygon intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "geometries": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + }, + { + // Feature intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "geometries": { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + }, + "properties": {} + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + }, + { + // Feature Collection intersects partially with the data, clipped result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "geometries": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + }, + "properties": {} + } + ] + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-filtered.json5" + } + } + ] } diff --git a/tests/mask_polygon.json5 b/tests/mask_polygon.json5 index b730adb0..fb3c9f2a 100644 --- a/tests/mask_polygon.json5 +++ b/tests/mask_polygon.json5 @@ -1,5 +1,209 @@ { + // todo: GeoJSON as input for mask is deprecated; migrate to Vector data cubes (missing the encoding yet) "id": "mask_polygon", "level": "L2A", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "mask": { + "type": "Polygon", + "coordinates": [ + [ + [16.1, 48.1], + [16.1, 48.6], + [16.6, 48.6], + [16.6, 48.1], + [16.1, 48.1] + ] + ] + }, + "inside": true + }, + "returns": { + "type": "datacube", + "nodata": NaN, + "order": ["t", "y", "x"], + "dimensions": { + "t": { + "type": "temporal", + "values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"] + }, + "y": { + "type": "spatial", + "axis": "y", + "values": [5757495.0, 5757485.0, 5757475.0], + "reference_system": "EPSG:25832" + }, + "x": { + "type": "spatial", + "axis": "x", + "values": [404835.0, 404845.0, 404855.0, 404865.0], + "reference_system": "EPSG:25832" + } + }, + "data": [ + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ], + [ + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN], + [NaN, NaN, NaN, NaN] + ] + ] + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xyt-minimal-float.json5" + }, + "mask": { + "type": "Polygon", + "coordinates": [ + [ + [16.1, 48.1], + [16.1, 48.6], + [16.6, 48.6], + [16.6, 48.1], + [16.1, 48.1] + ] + ] + }, + "inside": false + }, + "returns": { + "$ref": "assets/xyt-minimal-float.json5" + } + }, + { + // bbox fully covers the data, no change result + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "mask": { + "type": "Polygon", + "coordinates": [ + [ + [-16.1, 40.18], + [-16.1, 84.73], + [32.88, 84.73], + [32.88, 40.18], + [-16.1, 40.18] + ] + ] + } + }, + "returns": { + "$ref": "assets/xytb-s2-small.json5" + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "mask": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-masked-outside.json5" + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "mask": { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + } + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-masked-outside.json5" + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "mask": { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + }, + "properties": {} + } + ] + } + }, + "returns": { + "$ref": "assets/xytb-s2-small-masked-outside.json5" + } + }, + { + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "mask": { + "type": "Polygon", + "coordinates": [ + [ + [7.615340662408175, 51.95982196234872], + [7.615340662408175, 51.96005351522534], + [7.615929556794445, 51.96005351522534], + [7.615929556794445, 51.95982196234872], + [7.615340662408175, 51.95982196234872] + ] + ] + }, + "inside": true + }, + "returns": { + "$ref": "assets/xytb-s2-small-masked-inside.json5" + } + } + ] } From 86b5e078d547a0fccb59216f9aa95bafefb56bc5 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 3 Jan 2024 12:42:20 +0100 Subject: [PATCH 36/39] Use nodata type in tests properly --- tests/arcsin.json5 | 4 ++-- tests/array_element.json5 | 6 +++--- tests/array_find.json5 | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/arcsin.json5 b/tests/arcsin.json5 index 0f1a35a6..2dbdced6 100644 --- a/tests/arcsin.json5 +++ b/tests/arcsin.json5 @@ -64,9 +64,9 @@ }, { "arguments": { - "x": null + "x": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} } ] } diff --git a/tests/array_element.json5 b/tests/array_element.json5 index e2b30985..b084d0d2 100644 --- a/tests/array_element.json5 +++ b/tests/array_element.json5 @@ -32,7 +32,7 @@ "index": 0, "return_nodata": true }, - "returns": null + "returns": {"type": "nodata"} }, { "level": "L2", @@ -130,7 +130,7 @@ "index": 2, "return_nodata": true }, - "returns": null + "returns": {"type": "nodata"} }, { "level": "L2", @@ -155,7 +155,7 @@ "label": "BO4", "return_nodata": true }, - "returns": null + "returns": {"type": "nodata"} }, { "level": "L2", diff --git a/tests/array_find.json5 b/tests/array_find.json5 index b522a7c0..0d7ebf08 100644 --- a/tests/array_find.json5 +++ b/tests/array_find.json5 @@ -105,13 +105,13 @@ "arguments": { "data": [ 1, - null, + {"type": "nodata"}, 2, - null + {"type": "nodata"} ], - "value": null + "value": {"type": "nodata"} }, - "returns": null + "returns": {"type": "nodata"} }, { "arguments": { From 91ad78a658346f8dee0b91da6e73ac13eeadf3f1 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 3 Jan 2024 15:08:25 +0100 Subject: [PATCH 37/39] Add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4ec2834..a4f88de2 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 +### Added + +- Unit Tests (see folder `tests`, moved specification tests and CI tools to `dev`) + ### Changed - Clarified for various mathematical functions the defined input and output ranges. From d36405932238f78bc5e4bbb43abd5c9c22f18bfb Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Wed, 17 Jan 2024 12:09:39 +0100 Subject: [PATCH 38/39] Fix invalid datetimes --- tests/aggregate_temporal_period.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/aggregate_temporal_period.json5 b/tests/aggregate_temporal_period.json5 index ab39d61f..3658cea2 100644 --- a/tests/aggregate_temporal_period.json5 +++ b/tests/aggregate_temporal_period.json5 @@ -745,7 +745,7 @@ "2024-02-29T00:00:00Z", "2024-03-01T00:00:00Z", "2024-04-10T00:00:00Z", - "2024-11-31T00:00:00Z" + "2024-11-30T00:00:00Z" ] }, "y": { @@ -874,7 +874,7 @@ "2024-04-30T00:00:00Z", "2024-05-01T00:00:00Z", "2024-10-10T00:00:00Z", - "2024-11-31T00:00:00Z" + "2024-11-30T00:00:00Z" ] }, "y": { From 664b89d6f4e46a3d334a2eb383edb449c74a5c48 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 25 Jan 2024 21:08:57 +0100 Subject: [PATCH 39/39] Apply suggestions from code review Co-authored-by: Stefaan Lippens --- tests/vector_to_random_points.json5 | 2 +- tests/vector_to_regular_points.json5 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vector_to_random_points.json5 b/tests/vector_to_random_points.json5 index 50dfca50..d6666fc1 100644 --- a/tests/vector_to_random_points.json5 +++ b/tests/vector_to_random_points.json5 @@ -1,5 +1,5 @@ { - "id": "vector_reproject", + "id": "vector_to_random_points", "level": "L3", "experimental": true, "tests": [] diff --git a/tests/vector_to_regular_points.json5 b/tests/vector_to_regular_points.json5 index 50dfca50..ca92156c 100644 --- a/tests/vector_to_regular_points.json5 +++ b/tests/vector_to_regular_points.json5 @@ -1,5 +1,5 @@ { - "id": "vector_reproject", + "id": "vector_to_regular_points", "level": "L3", "experimental": true, "tests": []