Skip to content

Commit

Permalink
Add tests for reduce_dimension and apply_dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Dec 12, 2023
1 parent eed8674 commit 5e3ce04
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 2 deletions.
64 changes: 63 additions & 1 deletion tests/apply_dimension.json5
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
{
"id": "apply_dimension",
"level": "L1",
"tests": []
"tests": [
{
"required": [
"extrema"
],
"arguments": {
"data": {
"$ref": "assets/xyt-minimal.json5"
},
"process": {
"process_graph": {
"extrema": {
"process_id": "extrema",
"arguments": {
"data": {
"from_parameter": "data"
}
},
"result": true
}
}
},
"dimension": "t"
},
"returns": {
"type": "datacube",
"nodata": NaN,
"dimensions": [
{
"name": "t",
"type": "temporal",
"values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z"]
},
{
"name": "y",
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
{
"name": "x",
"type": "spatial",
"axis": "x",
"values": [404835.0, 404845.0, 404855.0, 404865.0],
"reference_system": "EPSG:25832"
}
],
"data": [
[
[-63.65, 9.0 , -68.52, -64.25],
[-18.0 , -63.8 , -3.11, -20.5 ],
[ 47.86, -21.3 , 25.16, -81.6 ]
],
[
[ 17.5 , 53.75, -27.1 , -8.0 ],
[ 1.05, 8.45, 73.05, 51.05],
[ 50.4 , 49.24, 25.16, 46.15]
]
]
}
}
]
}
52 changes: 51 additions & 1 deletion tests/reduce_dimension.json5
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
{
"id": "reduce_dimension",
"level": "L1",
"tests": []
"tests": [
{
"required": [
"sum"
],
"arguments": {
"data": {
"$ref": "assets/xyt-minimal.json5"
},
"reducer": {
"process_graph": {
"sum": {
"process_id": "sum",
"arguments": {
"data": {
"from_parameter": "data"
}
},
"result": true
}
}
},
"dimension": "t"
},
"returns": {
"type": "datacube",
"nodata": NaN,
"dimensions": [
{
"name": "y",
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
{
"name": "x",
"type": "spatial",
"axis": "x",
"values": [404835.0, 404845.0, 404855.0, 404865.0],
"reference_system": "EPSG:25832"
}
],
"data": [
[-46.15, 62.75, -95.62, -72.25],
[-16.95, -55.35, 69.94, 30.55],
[ 98.26, 27.94, 25.16, -35.45]
]
}
}
]
}

0 comments on commit 5e3ce04

Please sign in to comment.