From f563a2c1886ead3b480cf86fa8556ef4c793e11c Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 12 Oct 2023 14:16:51 +0200 Subject: [PATCH] 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