From 1fe5eb27d84bc55db10aaf33feff6f62edfa66d9 Mon Sep 17 00:00:00 2001 From: Luke Carr Date: Mon, 16 Dec 2024 15:50:47 +0000 Subject: [PATCH 1/3] feat!: replace `period` with `duration` in `MeasurementType` model --- src/edr_pydantic/parameter.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/edr_pydantic/parameter.py b/src/edr_pydantic/parameter.py index c2a31f7..8102c59 100644 --- a/src/edr_pydantic/parameter.py +++ b/src/edr_pydantic/parameter.py @@ -15,9 +15,7 @@ class MeasurementType(EdrBaseModel): method: str # TODO: Add validation of ISO 8601 duration (including leading minus sign) - # TODO: Confusion in spec on the field name, duration versus period. - # See https://github.com/opengeospatial/ogcapi-environmental-data-retrieval/issues/560 - period: str + duration: str class Parameter(EdrBaseModel, extra="allow"): From 672da9446c6b72660c95778739abffe95d2dfbed Mon Sep 17 00:00:00 2001 From: Luke Carr Date: Mon, 16 Dec 2024 15:51:30 +0000 Subject: [PATCH 2/3] fix: replaced `period` with `duration` in JSON test data --- tests/test_data/doc-example-collections.json | 40 ++++++++++---------- tests/test_data/parameter-names.json | 6 +-- tests/test_data/parameter-with-extent.json | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/test_data/doc-example-collections.json b/tests/test_data/doc-example-collections.json index 2864abb..e78cb71 100644 --- a/tests/test_data/doc-example-collections.json +++ b/tests/test_data/doc-example-collections.json @@ -198,7 +198,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M/PT0M" } }, "Wind Speed": { @@ -217,7 +217,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M/PT0M" } }, "Wind Gust": { @@ -236,7 +236,7 @@ }, "measurementType": { "method": "maximum", - "period": "-PT10M/PT0M" + "duration": "-PT10M/PT0M" } }, "Air Temperature": { @@ -255,7 +255,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Weather": { @@ -274,7 +274,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Relative Humidity": { @@ -293,7 +293,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Dew point": { @@ -312,7 +312,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Pressure": { @@ -331,7 +331,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Pressure Tendancy": { @@ -350,7 +350,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Visibility": { @@ -369,7 +369,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } } } @@ -539,7 +539,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M/PT0M" } }, "Wind Speed": { @@ -558,7 +558,7 @@ }, "measurementType": { "method": "mean", - "period": "-PT10M/PT0M" + "duration": "-PT10M/PT0M" } }, "Wind Gust": { @@ -577,7 +577,7 @@ }, "measurementType": { "method": "maximum", - "period": "-PT10M/PT0M" + "duration": "-PT10M/PT0M" } }, "Air Temperature": { @@ -596,7 +596,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Weather": { @@ -615,7 +615,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Relative Humidity": { @@ -634,7 +634,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Feels like temperature": { @@ -653,7 +653,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "UV index": { @@ -672,7 +672,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Probability of precipitation": { @@ -691,7 +691,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } }, "Visibility": { @@ -710,7 +710,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0M" + "duration": "PT0M" } } } diff --git a/tests/test_data/parameter-names.json b/tests/test_data/parameter-names.json index 1583484..3ce8b0f 100644 --- a/tests/test_data/parameter-names.json +++ b/tests/test_data/parameter-names.json @@ -15,7 +15,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } }, "u-component_of_wind_altitude_above_msl": { @@ -34,7 +34,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } }, "v-component_of_wind_altitude_above_msl": { @@ -53,7 +53,7 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } } } diff --git a/tests/test_data/parameter-with-extent.json b/tests/test_data/parameter-with-extent.json index ad521ec..e247a9a 100644 --- a/tests/test_data/parameter-with-extent.json +++ b/tests/test_data/parameter-with-extent.json @@ -39,6 +39,6 @@ }, "measurementType": { "method": "instantaneous", - "period": "PT0S" + "duration": "PT0S" } } From 5ecbcb433544b1f355ddf77a87dd56af08506445 Mon Sep 17 00:00:00 2001 From: Luke Carr Date: Wed, 18 Dec 2024 08:40:37 +0000 Subject: [PATCH 3/3] chore: updated durations to remove range of durations --- tests/test_data/doc-example-collections.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_data/doc-example-collections.json b/tests/test_data/doc-example-collections.json index e78cb71..fee708e 100644 --- a/tests/test_data/doc-example-collections.json +++ b/tests/test_data/doc-example-collections.json @@ -198,7 +198,7 @@ }, "measurementType": { "method": "mean", - "duration": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Speed": { @@ -217,7 +217,7 @@ }, "measurementType": { "method": "mean", - "duration": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Gust": { @@ -236,7 +236,7 @@ }, "measurementType": { "method": "maximum", - "duration": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Air Temperature": { @@ -539,7 +539,7 @@ }, "measurementType": { "method": "mean", - "duration": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Speed": { @@ -558,7 +558,7 @@ }, "measurementType": { "method": "mean", - "duration": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Wind Gust": { @@ -577,7 +577,7 @@ }, "measurementType": { "method": "maximum", - "duration": "-PT10M/PT0M" + "duration": "-PT10M" } }, "Air Temperature": {