Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 13, 2023
1 parent 5e3ce04 commit 2cb3a61
Show file tree
Hide file tree
Showing 17 changed files with 1,295 additions and 25 deletions.
22 changes: 11 additions & 11 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This folder contains test cases for the openEO processes.

- [x] absolute
- [x] add
- [ ] add_dimension
- [x] add_dimension
- [ ] aggregate_spatial
- [ ] aggregate_spatial_window (experimental)
- [ ] aggregate_temporal
Expand All @@ -15,8 +15,8 @@ This folder contains test cases for the openEO processes.
- [x] and
- [ ] anomaly
- [x] any
- [ ] apply
- [ ] apply_dimension
- [x] apply*
- [x] apply_dimension*
- [ ] apply_kernel
- [ ] apply_neighborhood
- [ ] apply_polygon (experimental)
Expand All @@ -30,11 +30,11 @@ This folder contains test cases for the openEO processes.
- [x] array_concat
- [x] array_contains
- [x] array_create
- [ ] array_create_labeled (experimental)
- [x] array_create_labeled (experimental)
- [x] array_element
- [x] array_filter
- [x] array_find
- [ ] array_find_label (experimental)
- [x] array_find_label (experimental)
- [x] array_interpolate_linear
- [x] array_labels
- [x] array_modify* (experimental)
Expand All @@ -52,13 +52,13 @@ This folder contains test cases for the openEO processes.
- [x] cummin* (experimental)
- [x] cumproduct* (experimental)
- [x] cumsum* (experimental)
- [ ] create_data_cube
- [x] create_data_cube
- [x] date_between* (experimental)
- [x] date_difference* (experimental)
- [x] date_shift* (experimental)
- [ ] dimension_labels
- [x] dimension_labels
- [x] divide
- [ ] drop_dimension
- [x] drop_dimension*
- [x] e
- [x] eq
- [x] exp
Expand Down Expand Up @@ -107,10 +107,10 @@ This folder contains test cases for the openEO processes.
- [x] product
- [x] quantiles
- [x] rearrange*
- [ ] reduce_dimension
- [x] reduce_dimension*
- [ ] reduce_spatial (experimental)
- [ ] rename_dimension
- [ ] rename_labels
- [x] rename_dimension
- [x] rename_labels
- [ ] resample_cube_spatial
- [ ] resample_cube_temporal
- [ ] resample_spatial
Expand Down
179 changes: 178 additions & 1 deletion tests/add_dimension.json5
Original file line number Diff line number Diff line change
@@ -1,5 +1,182 @@
{
"id": "add_dimension",
"level": "L2",
"tests": []
"tests": [
{
// add bands dimension
"arguments": {
"data": {
"$ref": "assets/xyt-minimal-float.json5"
},
"name": "b",
"label": "B1",
"type": "bands"
},
"returns": {
"type": "datacube",
"dimensions": [
{
"name": "b",
"type": "bands",
"values": ["B1"]
},
{
"name": "t",
"type": "temporal",
"values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"]
},
{
"name": "y",
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
{
"name": "x",
"type": "spatial",
"axis": "x",
"values": [404835.0, 404845.0, 404855.0, 404865.0],
"reference_system": "EPSG:25832"
}
],
"data": null
}
},
{
// add temporal dimension
"arguments": {
"data": {
"$ref": "assets/xyb-minimal-int.json5"
},
"name": "t",
"label": "2020-01-01T00:00:00Z",
"type": "temporal"
},
"returns": {
"type": "datacube",
"dimensions": [
{
"name": "t",
"type": "temporal",
"values": ["2020-01-01T00:00:00Z"]
},
{
"name": "bands",
"type": "bands",
"values": ["red", "green", "blue"]
},
{
"name": "y",
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
{
"name": "x",
"type": "spatial",
"axis": "x",
"values": [404835.0, 404845.0, 404855.0, 404865.0],
"reference_system": "EPSG:25832"
}
],
"data": null
}
},
{
// add second temporal dimension
"arguments": {
"data": {
"$ref": "assets/xyt-minimal-float.json5"
},
"name": "t2",
"label": "2010-01-01T00:00:00.0Z",
"type": "temporal"
},
"returns": {
"type": "datacube",
"dimensions": [
{
"name": "t2",
"type": "temporal",
"values": ["2010-01-01T00:00:00.0Z"]
},
{
"name": "t",
"type": "temporal",
"values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"]
},
{
"name": "y",
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
{
"name": "x",
"type": "spatial",
"axis": "x",
"values": [404835.0, 404845.0, 404855.0, 404865.0],
"reference_system": "EPSG:25832"
}
],
"data": null
}
},
{
// add other dimension
"arguments": {
"data": {
"$ref": "assets/xyt-minimal-float.json5"
},
"name": "var",
"label": 1,
"type": "other"
},
"returns": {
"type": "datacube",
"dimensions": [
{
"name": "var",
"type": "other",
"values": [1]
},
{
"name": "t",
"type": "temporal",
"values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"]
},
{
"name": "y",
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
{
"name": "x",
"type": "spatial",
"axis": "x",
"values": [404835.0, 404845.0, 404855.0, 404865.0],
"reference_system": "EPSG:25832"
}
],
"data": null
}
},
{
// throw for existing dimension
"arguments": {
"data": {
"$ref": "assets/xyt-minimal-float.json5"
},
"name": "t",
"label": "2020-01-01",
"type": "temporal"
},
"throws": "DimensionExists"
}
]
}
Loading

0 comments on commit 2cb3a61

Please sign in to comment.