Skip to content

Commit e28a0a0

Browse files
committed
<<2025-08-11 11:39>> Bugfix: Fixed issue with the endpoints containing the Enum name, rather than the value.
CHANGES: - Aforementioned bugfix - Updated dependencies - Changed the Dockerfile to use Python 3.11 - Dropped Python 3.10
1 parent a3a9ee3 commit e28a0a0

File tree

7 files changed

+587
-674
lines changed

7 files changed

+587
-674
lines changed

.github/workflows/pull-request-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
tests-and-sonarcloud:
1010
strategy:
1111
matrix:
12-
version: ["3.10", "3.11"] # TODO: Get Python versions from the project
12+
version: ["3.11"]
1313
name: Testing and updating SonarCloud
1414
runs-on: ubuntu-latest
1515
steps:
@@ -42,11 +42,11 @@ jobs:
4242
poetry run coverage run -m pytest
4343
poetry run coverage report
4444
# Generate XML Coverage result file
45-
- if: matrix.version == '3.10'
45+
- if: matrix.version == '3.11'
4646
name: Generate Coverage XML file
4747
run: poetry run coverage xml
4848
# Upload coverage data to SonarCloud.io
49-
- if: matrix.version == '3.10'
49+
- if: matrix.version == '3.11'
5050
name: Update SonarCloud.io
5151
uses: SonarSource/sonarcloud-github-action@master
5252
env:

.github/workflows/release-candidate-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tests-and-sonarcloud:
1111
strategy:
1212
matrix:
13-
version: ["3.10", "3.11"] # TODO: Get Python versions from the project
13+
version: ["3.11"] # TODO: Get Python versions from the project
1414
name: Testing and updating SonarCloud
1515
runs-on: ubuntu-latest
1616
steps:
@@ -43,11 +43,11 @@ jobs:
4343
poetry run coverage run -m pytest
4444
poetry run coverage report
4545
# Generate XML Coverage result file
46-
- if: matrix.version == '3.10'
46+
- if: matrix.version == '3.11'
4747
name: Generate Coverage XML file
4848
run: poetry run coverage xml
4949
# Upload coverage data to SonarCloud.io
50-
- if: matrix.version == '3.10'
50+
- if: matrix.version == '3.11'
5151
name: Update SonarCloud.io
5252
uses: SonarSource/sonarcloud-github-action@master
5353
env:

.github/workflows/version-update-workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
tests-and-sonarcloud:
1111
strategy:
1212
matrix:
13-
version: ["3.10", "3.11"] # TODO: Get Python versions from the project
13+
version: ["3.11"] # TODO: Get Python versions from the project
1414
name: Testing and updating SonarCloud
1515
runs-on: ubuntu-latest
1616
steps:
@@ -43,11 +43,11 @@ jobs:
4343
poetry run coverage run -m pytest
4444
poetry run coverage report
4545
# Generate XML Coverage result file
46-
- if: matrix.version == '3.10'
46+
- if: matrix.version == '3.11'
4747
name: Generate Coverage XML file
4848
run: poetry run coverage xml
4949
# Upload coverage data to SonarCloud.io
50-
- if: matrix.version == '3.10'
50+
- if: matrix.version == '3.11'
5151
name: Update SonarCloud.io
5252
uses: SonarSource/sonarcloud-github-action@master
5353
env:
@@ -75,7 +75,7 @@ jobs:
7575
- name: Python setup
7676
uses: actions/setup-python@v4
7777
with:
78-
python-version: '3.10'
78+
python-version: '3.11'
7979
# Install required dependencies
8080
- name: Install dependencies
8181
run: poetry install -vv --no-interaction --without dev

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MPL-2.0
44
#
55

6-
FROM python:3.10.18-bullseye AS base-image
6+
FROM python:3.11.13-bullseye AS base-image
77

88
RUN apt-get update && \
99
apt-get -y install libeccodes-dev && \
@@ -38,7 +38,6 @@ ENV PATH="$APP_HOME/.venv/bin:$PATH"
3838

3939
# --- DEV image --
4040
FROM base-image AS dev-image
41-
# TODO: Hookup SSH interface
4241

4342
USER $APP_USER
4443
CMD ["ls", "-l"]

poetry.lock

Lines changed: 566 additions & 649 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "weather_provider_api"
3-
version = "2.73.0"
3+
version = "2.74.0"
44
description = "Weather Provider Libraries and API"
55
authors = ["Verbindingsteam", "Raoul Linnenbank <[email protected]>"]
66
license = "MPL-2.0"
@@ -11,18 +11,18 @@ include = [
1111
]
1212

1313
[tool.poetry.dependencies]
14-
python = ">=3.10,<3.12"
15-
fastapi = "^0.115.12"
14+
python = ">=3.11,<3.12"
15+
fastapi = "^0.116.1"
1616
requests = "^2.32.3"
1717
geopy = "^2.4.1"
18-
numpy = "^2.2.4"
18+
numpy = "^2.3.2"
1919
gunicorn = "^23.0.0"
20-
lxml = "^5.3.1"
20+
lxml = "^6.0.0"
2121
starlette-prometheus = "^0.10.0"
2222
pandas = "^2.2.3"
2323
xarray = "^2025.3.0"
2424
cfgrib = "^0.9.15.0"
25-
uvicorn = "^0.34.0"
25+
uvicorn = "^0.35.0"
2626
slowapi = "^0.1.9"
2727
loguru = "^0.7.3"
2828
email-validator = "^2.2.0"

weather_provider_api/routers/weather/sources/cds/client/era5_utils.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _era5_update_month(
126126
month_file_name = month_file.with_suffix(Era5FileSuffixes.UNFORMATTED)
127127

128128
# Only the first day of each month in test mode, otherwise all days:
129-
day = [str(i) for i in list(range(1, 32))] if not test_mode else ["1"]
129+
day = [str(i) for i in range(1, 32)] if not test_mode else ["1"]
130130

131131
try:
132132
download_era5_data(
@@ -346,15 +346,13 @@ def _recombine_multiple_files(unformatted_file: Path) -> None:
346346
with zipfile.ZipFile(unformatted_file, "r") as zip_ref:
347347
zip_ref.extractall(temp_dir)
348348

349-
concatenated_dataset = xr.Dataset()
350349
files_to_load_in_order = [
351350
"data_stream-oper_stepType-instant",
352351
"data_stream-oper_stepType-accum",
353352
# TODO: Add the following file back in when we can properly handle it
354353
# "data_stream-wave_stepType-instant", # Something about this data doesn't mesh well anymore with the rest...
355354
]
356355

357-
# TODO: Load, convert to dataframe, merge, convert back to xarray
358356
concatenated_dataset = xr.Dataset()
359357
for filename in files_to_load_in_order:
360358
file_path = Path(temp_dir).joinpath(f"{filename}.nc")
@@ -373,7 +371,6 @@ def _recombine_multiple_files(unformatted_file: Path) -> None:
373371
)
374372

375373
concatenated_dataset.to_netcdf(unformatted_file, format="NETCDF4", engine="netcdf4")
376-
# raise ValueError("This is not working yet")
377374

378375

379376
def download_era5_data(
@@ -384,9 +381,9 @@ def download_era5_data(
384381
"""A function to download ERA5 data."""
385382
try:
386383
CDS_CLIENT.retrieve(
387-
dataset,
388-
cds_request.request_parameters,
389-
target_location,
384+
name=dataset.value,
385+
request=cds_request.request_parameters,
386+
target=target_location,
390387
)
391388

392389
except Exception as e:

0 commit comments

Comments
 (0)