From ccedf9f3a41cd7fedc27f9cbf32d192474119b79 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 14 Dec 2023 22:03:05 +0100 Subject: [PATCH] Special no-data handling --- tests/README.md | 21 ++++++++++++----- tests/absolute.json5 | 4 ++-- tests/add.json5 | 22 +++++++++--------- 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/filter_bbox.json5 | 17 +++++++++++++- 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/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 +++++++++--------- 74 files changed, 379 insertions(+), 357 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/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/filter_bbox.json5 b/tests/filter_bbox.json5 index 468859bf..9a798acf 100644 --- a/tests/filter_bbox.json5 +++ b/tests/filter_bbox.json5 @@ -1,5 +1,20 @@ { "id": "filter_bbox", "level": "L2", - "tests": [] + "tests": [ + { + "arguments": { + "data": { + "$ref": "assets/xytb-s2-small.json5" + }, + "extent": { + "west": 404855.0, + "south": 5757445.0, + "east": 404895.0, + "north": 5757475.0, + "crs": "EPSG:25832" + } + } + } + ] } 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/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"} } ] }