From 2097ce1f978c1cda61b5f695e3bd744786d3f071 Mon Sep 17 00:00:00 2001 From: Jeffrey Vervoort Date: Fri, 1 Dec 2023 15:12:19 +0100 Subject: [PATCH] Variance in datetime parameter. --- ...thin_an_area_with_multiple_parameters.json | 132 ++++++++---------- ...gle_location_with_multiple_parameters.json | 54 ++++--- integration-test/test_api.py | 4 +- 3 files changed, 89 insertions(+), 101 deletions(-) diff --git a/integration-test/response/collection/area/200/data_within_an_area_with_multiple_parameters.json b/integration-test/response/collection/area/200/data_within_an_area_with_multiple_parameters.json index 3f1d3b8..9d4e190 100644 --- a/integration-test/response/collection/area/200/data_within_an_area_with_multiple_parameters.json +++ b/integration-test/response/collection/area/200/data_within_an_area_with_multiple_parameters.json @@ -19,14 +19,13 @@ }, "t": { "values": [ - "2022-12-31T00:50:00Z", - "2022-12-31T01:00:00Z", - "2022-12-31T01:10:00Z", - "2022-12-31T01:20:00Z", - "2022-12-31T01:30:00Z", - "2022-12-31T01:40:00Z", - "2022-12-31T01:50:00Z", - "2022-12-31T02:00:00Z" + "2022-12-31T22:50:00Z", + "2022-12-31T23:00:00Z", + "2022-12-31T23:10:00Z", + "2022-12-31T23:20:00Z", + "2022-12-31T23:30:00Z", + "2022-12-31T23:40:00Z", + "2022-12-31T23:50:00Z" ] } }, @@ -103,19 +102,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 236.4, - 240.3, - 250.4, - 239.2, - 232.7, - 241.4, - 247.9, - 248.1 + 214.8, + 215, + 212.5, + 213.9, + 216.6, + 213.9, + 212.3 ] }, "ff": { @@ -127,19 +125,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 5.38, - 5.25, - 4.04, - 4.06, - 4.41, - 4.31, - 4.57, - 4.37 + 10.68, + 8.84, + 9.09, + 8.64, + 8.72, + 9.59, + 10.7 ] }, "rh": { @@ -151,19 +148,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 97, - 96, - 96, - 96, - 96, - 97, - 96, - 95 + 56, + 56, + 55, + 58, + 56, + 56, + 57 ] } } @@ -186,14 +182,13 @@ }, "t": { "values": [ - "2022-12-31T00:50:00Z", - "2022-12-31T01:00:00Z", - "2022-12-31T01:10:00Z", - "2022-12-31T01:20:00Z", - "2022-12-31T01:30:00Z", - "2022-12-31T01:40:00Z", - "2022-12-31T01:50:00Z", - "2022-12-31T02:00:00Z" + "2022-12-31T22:50:00Z", + "2022-12-31T23:00:00Z", + "2022-12-31T23:10:00Z", + "2022-12-31T23:20:00Z", + "2022-12-31T23:30:00Z", + "2022-12-31T23:40:00Z", + "2022-12-31T23:50:00Z" ] } }, @@ -270,19 +265,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 237.9, - 235.4, - 240, - 243.2, - 243.2, - 240, - 239.9, - 229.5 + 211.5, + 211.2, + 209.6, + 213.9, + 216.3, + 213.7, + 219.1 ] }, "ff": { @@ -294,19 +288,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 4.26, - 4.72, - 4.1, - 3.79, - 4.2, - 3.83, - 3.69, - 3.3 + 8.37, + 7.71, + 8.35, + 8.45, + 8.95, + 9.17, + 9.4 ] }, "rh": { @@ -318,19 +311,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 95, - 94, - 94, - 94, - 94, - 93, - 93, - 94 + 58, + 58, + 58, + 58, + 58, + 58, + 59 ] } } diff --git a/integration-test/response/collection/locations/200/single_location_with_multiple_parameters.json b/integration-test/response/collection/locations/200/single_location_with_multiple_parameters.json index ee1da91..e9dc6d8 100644 --- a/integration-test/response/collection/locations/200/single_location_with_multiple_parameters.json +++ b/integration-test/response/collection/locations/200/single_location_with_multiple_parameters.json @@ -16,14 +16,13 @@ }, "t": { "values": [ + "2022-12-31T00:00:00Z", + "2022-12-31T00:10:00Z", + "2022-12-31T00:20:00Z", + "2022-12-31T00:30:00Z", + "2022-12-31T00:40:00Z", "2022-12-31T00:50:00Z", - "2022-12-31T01:00:00Z", - "2022-12-31T01:10:00Z", - "2022-12-31T01:20:00Z", - "2022-12-31T01:30:00Z", - "2022-12-31T01:40:00Z", - "2022-12-31T01:50:00Z", - "2022-12-31T02:00:00Z" + "2022-12-31T01:00:00Z" ] } }, @@ -100,19 +99,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ + 224.3, + 226, + 228.3, + 230.3, + 234.9, 237.9, - 235.4, - 240, - 243.2, - 243.2, - 240, - 239.9, - 229.5 + 235.4 ] }, "ff": { @@ -124,19 +122,18 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ - 4.26, - 4.72, - 4.1, - 3.79, + 4.95, + 4.43, + 4.35, + 3.77, 4.2, - 3.83, - 3.69, - 3.3 + 4.26, + 4.72 ] }, "rh": { @@ -148,18 +145,17 @@ "x" ], "shape": [ - 8, + 7, 1, 1 ], "values": [ 95, 94, - 94, - 94, - 94, - 93, - 93, + 95, + 95, + 95, + 95, 94 ] } diff --git a/integration-test/test_api.py b/integration-test/test_api.py index 40ccfae..c3ce080 100644 --- a/integration-test/test_api.py +++ b/integration-test/test_api.py @@ -69,7 +69,7 @@ def test_from_a_single_collection_get_a_single_location(): collection_id = "observations" location_id = "06260" parameters = "dd,ff,rh" - datetime = "2022-12-31T00:50:00Z/2022-12-31T02:10:00Z" + datetime = "../2022-12-31T01:10:00Z" actual_response = requests.get( url=BASE_URL + f"/collections/{collection_id}/locations/{location_id}" f"?parameter-name={parameters}&datetime={datetime}" @@ -113,7 +113,7 @@ def test_from_a_single_collection_get_an_area_with_multiple_parameters(): collection_id = "observations" coords = "POLYGON((5.0 52.0, 6.0 52.0,6.0 52.1,5.0 52.1, 5.0 52.0))" parameters = "dd,ff,rh" - datetime = "2022-12-31T00:50:00Z/2022-12-31T02:10:00Z" + datetime = "2022-12-31T22:50:00Z/.." actual_response = requests.get( url=BASE_URL + f"/collections/{collection_id}/area" f"?coords={coords}¶meter-name={parameters}&datetime={datetime}"