Skip to content

Commit

Permalink
Release 2.48 (#121)
Browse files Browse the repository at this point in the history
This update fixes an issue where AROME updates would improperly be cut off due to issues with indexation, resulting in only one prediction moment per daily file to prevail over all others.

This update also includes the following:
A small update to the Sigrid file and a small patch to utils, where in one file we still used logger.exception, rather than logger.error as we'd want to.
  • Loading branch information
rflinnenbank authored Dec 18, 2023
1 parent e4e584f commit f2c28a1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "weather_provider_api"
version = "2.47.0"
version = "2.48.0"
description = "Weather Provider Libraries and API"
authors = ["Verbindingsteam", "Raoul Linnenbank <[email protected]>"]
license = "MPL-2.0"
Expand Down
2 changes: 1 addition & 1 deletion sigrid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude:
- "/doc/.*"
- "/LICENSES/.*"
- "/img/.*"
- "/scripts/.*"
- "weather_provider_api/scripts/.*"
- ".*/__init__.py"
languages:
- name: python
Expand Down
10 changes: 5 additions & 5 deletions weather_provider_api/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description = """
styles.
"""
expiration_checking = true
expiration_date = "2024-04-01"
expiration_date = "2024-08-01"

[maintainer]
show_info = true
Expand All @@ -31,9 +31,9 @@ cors_allowed_origins = ['*']
cors_allowed_origins_regex = []

[api_v1]
implementation = "2.1.0"
expiration_date = "2024-04-01"
implementation = "2.2.0"
expiration_date = "2024-08-01"

[api_v2]
implementation = "2.1.0"
expiration_date = "2024-04-01"
implementation = "2.2.0"
expiration_date = "2024-08-01"
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ def _process_grib_message_to_message_dataset(
field_values = np.reshape(grib_message["values"], len(lats) * len(lons))

data_dict = {field_name: (["time", "coord"], [field_values])}
predicted_moment = prediction_moment + relativedelta(hours=predicted_hour)
predicted_moment = np.datetime64((prediction_moment + relativedelta(hours=predicted_hour))).astype(
"datetime64[ns]"
)

dataset_coords = {
"time_of_prediction": [prediction_moment],
Expand Down Expand Up @@ -359,7 +361,7 @@ def _fuse_hourly_netcdf4_files(self, download_folder: Path, prediction_moment: d
if not fused_dataset:
fused_dataset = prediction_file_dataset
else:
fused_dataset = xr.merge([fused_dataset, prediction_file_dataset], compat="override")
fused_dataset = xr.merge([fused_dataset, prediction_file_dataset], compat="no_conflicts")

filename_to_save_to = self.repository_folder.joinpath(
f"{self.file_prefix}_{prediction_moment.year}{str(prediction_moment.month).zfill(2)}"
Expand Down
2 changes: 1 addition & 1 deletion weather_provider_api/routers/weather/sources/knmi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _retrieve_observation_moment(html_body: str) -> datetime:
)
return datetime.now()
except Exception as e:
logger.exception(
logger.error(
"An unknown exception occurred while retrieving the KNMI Waarnemingen datetime for use in the response."
f" Using local datetime instead. Error: {e}"
)
Expand Down

0 comments on commit f2c28a1

Please sign in to comment.