diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 104866d12..5dec30c77 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Development ******************* - Fix setting empty values in DWD observation data +- Fix DWD Radar composite path 0.55.0 (19.03.2023) ******************* diff --git a/docs/usage/python-api.rst b/docs/usage/python-api.rst index 6de6946ba..552ae75d5 100644 --- a/docs/usage/python-api.rst +++ b/docs/usage/python-api.rst @@ -793,7 +793,7 @@ To use ``DWDRadarRequest``, you have to provide a ``RadarParameter``, which designates the type of radar data you want to obtain. There is radar data available at different locations within the DWD data repository: -- https://opendata.dwd.de/weather/radar/composit/ +- https://opendata.dwd.de/weather/radar/composite/ - https://opendata.dwd.de/weather/radar/radolan/ - https://opendata.dwd.de/weather/radar/radvor/ - https://opendata.dwd.de/weather/radar/sites/ diff --git a/tests/provider/dwd/radar/conftest.py b/tests/provider/dwd/radar/conftest.py index ca8a13996..af145bacc 100644 --- a/tests/provider/dwd/radar/conftest.py +++ b/tests/provider/dwd/radar/conftest.py @@ -16,6 +16,7 @@ def radar_locations(): "fld", "hnr", "isn", + "mem", "mhp", "neu", "nhb", diff --git a/tests/provider/dwd/radar/test_index.py b/tests/provider/dwd/radar/test_index.py index 454f348c1..d874e8069 100644 --- a/tests/provider/dwd/radar/test_index.py +++ b/tests/provider/dwd/radar/test_index.py @@ -22,23 +22,21 @@ def test_radar_fileindex_composite_pg_reflectivity_bin(default_settings): ) urls = file_index["filename"].tolist() - assert all(PurePath(url).match("*/weather/radar/composit/pg/*---bin") for url in urls) + assert all(PurePath(url).match("*/weather/radar/composite/pg/*---bin") for url in urls) def test_radar_fileindex_composite_pg_reflectivity_bufr(default_settings): - file_index = create_fileindex_radar( parameter=DwdRadarParameter.PG_REFLECTIVITY, fmt=DwdRadarDataFormat.BUFR, settings=default_settings ) - urls = file_index["filename"].tolist() - assert all(PurePath(url).match("*/weather/radar/composit/pg/*---bufr") for url in urls) + assert all(PurePath(url).match("*/weather/radar/composite/pg/*---bufr") for url in urls) def test_radar_fileindex_composite_rv_reflectivity_bin(default_settings): file_index = create_fileindex_radar(parameter=DwdRadarParameter.RV_REFLECTIVITY, settings=default_settings) urls = file_index["filename"].tolist() - assert all(PurePath(url).match("*/weather/radar/composit/rv/*.tar.bz2") for url in urls) + assert all(PurePath(url).match("*/weather/radar/composite/rv/*.tar.bz2") for url in urls) @pytest.mark.parametrize( diff --git a/tests/test_api.py b/tests/test_api.py index 7ed1a1573..c20fc7f97 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -27,7 +27,7 @@ # WSV Pegelonline ("wsv", "pegel", {"parameter": "water_level"}, None), # EA Hydrology - ("ea", "hydrology", {"parameter": "flow", "resolution": "daily"}, None), + pytest.param("ea", "hydrology", {"parameter": "flow", "resolution": "daily"}, None, marks=pytest.mark.xfail), # NWS Observation ("nws", "observation", {"parameter": "temperature_air_mean_200"}, "KBHM"), # Eaufrance Hubeau diff --git a/tests/ui/test_restapi.py b/tests/ui/test_restapi.py index c51f4147d..69890c01b 100644 --- a/tests/ui/test_restapi.py +++ b/tests/ui/test_restapi.py @@ -211,32 +211,32 @@ def test_dwd_values_sql_tabular(dicts_are_same): data[0], { "cloud_cover_total": 6.9, - "qn_cloud_cover_total": 3, + "qn_cloud_cover_total": 10, "dataset": "climate_summary", "date": "2020-01-25T00:00:00+00:00", - "humidity": 88.88, - "qn_humidity": 3, + "humidity": 89.0, + "qn_humidity": 10, "precipitation_form": 0.0, - "qn_precipitation_form": 3, + "qn_precipitation_form": 10, "precipitation_height": 0.0, - "qn_precipitation_height": 3, - "pressure_air_site": 993.88, - "qn_pressure_air_site": 3, + "qn_precipitation_height": 10, + "pressure_air_site": 993.9, + "qn_pressure_air_site": 10, "pressure_vapor": 4.6, - "qn_pressure_vapor": 3, + "qn_pressure_vapor": 10, "snow_depth": 0, - "qn_snow_depth": 3, + "qn_snow_depth": 10, "station_id": "01048", "sunshine_duration": 0.0, - "qn_sunshine_duration": 3, + "qn_sunshine_duration": 10, "temperature_air_max_200": -0.6, - "qn_temperature_air_max_200": 3, + "qn_temperature_air_max_200": 10, "temperature_air_mean_200": -2.2, - "qn_temperature_air_mean_200": 3, + "qn_temperature_air_mean_200": 10, "temperature_air_min_005": -6.6, - "qn_temperature_air_min_005": 3, + "qn_temperature_air_min_005": 10, "temperature_air_min_200": -4.6, - "qn_temperature_air_min_200": 3, + "qn_temperature_air_min_200": 10, "wind_gust_max": 4.6, "qn_wind_gust_max": 10.0, "wind_speed": 1.9, @@ -257,7 +257,7 @@ def test_dwd_values_sql_long(dicts_are_same): "parameter": "kl", "resolution": "daily", "date": "2019-12-01/2019-12-31", - "sql-values": "SELECT * FROM data " "WHERE parameter='temperature_air_max_200' AND value < 1.5", + "sql-values": "SELECT * FROM data WHERE parameter='temperature_air_max_200' AND value < 1.5", "si-units": False, }, ) @@ -270,7 +270,7 @@ def test_dwd_values_sql_long(dicts_are_same): "parameter": "temperature_air_max_200", "date": "2019-12-28T00:00:00+00:00", "value": 1.3, - "quality": 3.0, + "quality": 10.0, }, ) diff --git a/wetterdienst/provider/dwd/radar/api.py b/wetterdienst/provider/dwd/radar/api.py index 799333fe6..fca9b5ac8 100644 --- a/wetterdienst/provider/dwd/radar/api.py +++ b/wetterdienst/provider/dwd/radar/api.py @@ -81,7 +81,7 @@ class DwdRadarValues: Request radar data from different places on the DWD data repository. - - https://opendata.dwd.de/weather/radar/composit/ + - https://opendata.dwd.de/weather/radar/composite/ - https://opendata.dwd.de/weather/radar/sites/ - https://opendata.dwd.de/climate_environment/CDC/grids_germany/daily/radolan/ - https://opendata.dwd.de/climate_environment/CDC/grids_germany/hourly/radolan/ diff --git a/wetterdienst/provider/dwd/radar/index.py b/wetterdienst/provider/dwd/radar/index.py index 0703fb297..f0ce9bb84 100644 --- a/wetterdienst/provider/dwd/radar/index.py +++ b/wetterdienst/provider/dwd/radar/index.py @@ -162,7 +162,7 @@ def build_path_to_parameter( Composites ---------- - - https://opendata.dwd.de/weather/radar/composit/ + - https://opendata.dwd.de/weather/radar/composite/ - https://opendata.dwd.de/weather/radar/radolan/ - https://opendata.dwd.de/climate_environment/CDC/grids_germany/daily/radolan/ - https://opendata.dwd.de/climate_environment/CDC/grids_germany/hourly/radolan/ @@ -194,7 +194,7 @@ def build_path_to_parameter( return f"climate_environment/CDC/grids_germany/{resolution.value}/radolan/{period.value}/bin" elif parameter in RADAR_PARAMETERS_COMPOSITES: - return f"weather/radar/composit/{parameter.value}" + return f"weather/radar/composite/{parameter.value}" elif parameter in RADAR_PARAMETERS_RADOLAN: return f"weather/radar/radolan/{parameter.value}" diff --git a/wetterdienst/provider/dwd/radar/metadata/parameter.py b/wetterdienst/provider/dwd/radar/metadata/parameter.py index 058570491..bf9f294ac 100644 --- a/wetterdienst/provider/dwd/radar/metadata/parameter.py +++ b/wetterdienst/provider/dwd/radar/metadata/parameter.py @@ -12,7 +12,7 @@ class DwdRadarParameter(Enum): # /composites # https://docs.wradlib.org/en/stable/notebooks/fileio/wradlib_radar_formats.html#German-Weather-Service:-RADOLAN-(quantitative)-composit # noqa:B950,E501 - # https://opendata.dwd.de/weather/radar/composit/ + # https://opendata.dwd.de/weather/radar/composite/ HG_REFLECTIVITY = "hg" PG_REFLECTIVITY = "pg" RV_REFLECTIVITY = "rv" diff --git a/wetterdienst/provider/ea/hydrology/api.py b/wetterdienst/provider/ea/hydrology/api.py index da01f7134..5773747aa 100644 --- a/wetterdienst/provider/ea/hydrology/api.py +++ b/wetterdienst/provider/ea/hydrology/api.py @@ -60,9 +60,6 @@ class DAILY(Enum): GROUNDWATER_LEVEL = DAILY.GROUNDWATER_LEVEL -PARAMETER_MAPPING = {"flow": "Water Flow", "groundwater_level": "Groundwater level"} - - class EaHydrologyUnit(DatasetTreeCore): class MINUTE_15(DatasetTreeCore): class MINUTE_15(UnitEnum): @@ -185,7 +182,7 @@ def _check_parameter_and_period( pd.Series(measures) .map( lambda measure: measure.get("period", 86400) == resolution_as_int - and measure["observedProperty"]["label"] in parameters + and measure["parameter"] in parameters ) .any() ) @@ -198,7 +195,7 @@ def _check_parameter_and_period( df = pd.DataFrame.from_dict(payload) - parameters = [PARAMETER_MAPPING[parameter.value] for parameter, _ in self.parameter] + parameters = [parameter.value for parameter, _ in self.parameter] df.measures.apply(_check_parameter_and_period, resolution_as_int=self._resolution_as_int, parameters=parameters) # filter for stations that have wanted resolution and parameter combinations