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 402d33c
Show file tree
Hide file tree
Showing 13 changed files with 876 additions and 16 deletions.
16 changes: 8 additions & 8 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 @@ -56,9 +56,9 @@ This folder contains test cases for the openEO processes.
- [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,7 +107,7 @@ 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
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 402d33c

Please sign in to comment.