Skip to content

Commit 587d91c

Browse files
Fix issues that cause crop_gribs worker to fail after updating production env to Python 3.13 (#337)
* Pin xarray version to 2024.7.0 in all environments Downgraded xarray dependency across all environment files to version 2024.7.0 to avoid TypeError in `crop_gribs` due to addition of `engine` arg to `xarray.backends.api._validate_attrs()` in 2024.9.0 (see pydata/xarray#9407). That change is incompatible with cfgrib=0.9.11.0 that we have to pin to because later versions result in atmospheric forcing netCDF files in which all the `time_counter` values are the same (see work journal notes from 15-Jun-2024). * Update LHTFL_Sfc variable alias to 'slhtf' Replaced the alias 'lhtfl' with 'slhtf' for the LHTFL_Sfc variable across multiple test files and the configuration file. It appears that 'slhtf' became the only acceptable GRIB2 standard name for the upward surface latent heat flux variable sometime after 15-Jun-2024.
1 parent f29d6d9 commit 587d91c

11 files changed

+73
-12
lines changed

config/nowcast.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ weather:
3737
- [VGRD_AGL-10m, v10, v_wind] # v component of wind velocity at 10m elevation
3838
- [DSWRF_Sfc, ssrd, solar] # accumulated downward shortwave (solar) radiation at ground level
3939
- [DLWRF_Sfc, strd, therm_rad] # accumulated downward longwave (thermal) radiation at ground level
40-
- [LHTFL_Sfc, lhtfl, LHTFL_surface] # upward surface latent heat flux (for VHFR FVCOM)
40+
- [LHTFL_Sfc, slhtf, LHTFL_surface] # upward surface latent heat flux (for VHFR FVCOM)
4141
- [TMP_AGL-2m, t2m, tair] # air temperature at 2m elevation
4242
- [SPFH_AGL-2m, sh2, qair] # specific humidity at 2m elevation
4343
- [RH_AGL-2m, r2, RH_2maboveground] # relative humidity at 2m elevation (for VHFR FVCOM)

envs/environment-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ dependencies:
7676
- utm
7777
- verboselogs
7878
- watchdog
79-
- xarray
79+
- xarray=2024.7.0
8080

8181
# For coding style, repo QA, and pkg management
8282
- black

envs/environment-fig-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies:
6060
- tqdm
6161
- verboselogs
6262
- watchdog
63-
- xarray
63+
- xarray=2024.7.0
6464

6565
# For code style & repo QA
6666
- pre-commit

envs/environment-linkcheck.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ dependencies:
6363
- utm
6464
- verboselogs
6565
- watchdog
66-
- xarray
66+
- xarray=2024.7.0
6767

6868
# For documentation links checking
6969
- sphinx==8.1.3

envs/environment-prod.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ dependencies:
7676
- utm
7777
- verboselogs
7878
- watchdog
79-
- xarray
79+
- xarray=2024.7.0
8080

8181
- pip:
8282
- angles

envs/environment-test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencies:
6262
- utm
6363
- verboselogs
6464
- watchdog
65-
- xarray
65+
- xarray=2024.7.0
6666

6767
# For unit tests and coverage monitoring
6868
- pytest

envs/requirements.txt

+63-2
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,25 @@
1010
alabaster==1.0.0
1111
angles==2.0
1212
anyio==4.8.0
13+
argon2-cffi==23.1.0
14+
argon2-cffi-bindings==21.2.0
1315
arrow==1.3.0
16+
asttokens==3.0.0
17+
async-lru==2.0.4
1418
attrs==24.3.0
1519
autopage==0.5.2
1620
babel==2.16.0
1721
backports.tarfile==1.2.0
1822
bcrypt==4.2.1
1923
beautifulsoup4==4.12.3
2024
black==24.10.0
25+
bleach==6.2.0
2126
bokeh==3.6.2
2227
Bottleneck==1.4.2
2328
Brotli==1.1.0
2429
cached-property==1.5.2
2530
Cartopy==0.24.0
26-
certifi==2024.12.14
31+
certifi==2025.1.31
2732
cffi==1.17.1
2833
cfgrib==0.9.11.0
2934
cfgv==3.3.1
@@ -37,27 +42,35 @@ cmocean==4.0.3
3742
colorama==0.4.6
3843
coloredlogs==15.0.1
3944
colorspacious==1.1.2
45+
comm==0.2.2
4046
contourpy==1.3.1
4147
coverage==7.6.10
4248
cryptography==44.0.1
4349
cycler==0.12.1
4450
cytoolz==1.0.1
4551
dask==2024.12.1
4652
dask-expr==1.1.21
53+
debugpy==1.8.11
54+
decorator==5.1.1
55+
defusedxml==0.7.1
4756
distlib==0.3.9
4857
distributed==2024.12.1
4958
docutils==0.21.2
5059
eccodes==2.37.0
5160
editables==0.5
61+
entrypoints==0.4
5262
et_xmlfile==2.0.0
5363
exceptiongroup==1.2.2
5464
execnet==2.1.1
65+
executing==2.1.0
5566
f90nml==1.4.4
67+
fastjsonschema==2.21.1
5668
feedgen==1.0.0
5769
filelock==3.16.1
5870
findlibs==0.0.5
5971
flox==0.9.15
6072
fonttools==4.55.3
73+
fqdn==1.5.1
6174
fsspec==2024.12.0
6275
future==1.0.0
6376
FVCOM-Cmd==0.1
@@ -82,12 +95,29 @@ imagesize==1.4.1
8295
importlib_metadata==8.5.0
8396
importlib_resources==6.5.2
8497
iniconfig==2.0.0
98+
ipykernel==6.29.5
99+
ipython==8.31.0
85100
isodate==0.7.2
101+
isoduration==20.11.0
86102
jaraco.classes==3.4.0
87103
jaraco.context==6.0.1
88104
jaraco.functools==4.1.0
105+
jedi==0.19.2
89106
jeepney==0.8.0
90107
Jinja2==3.1.5
108+
json5==0.10.0
109+
jsonpointer==3.0.0
110+
jsonschema==4.23.0
111+
jsonschema-specifications==2024.10.1
112+
jupyter_client==8.6.3
113+
jupyter_core==5.7.2
114+
jupyter-events==0.11.0
115+
jupyter-lsp==2.2.5
116+
jupyter_server==2.15.0
117+
jupyter_server_terminals==0.5.3
118+
jupyterlab==4.3.4
119+
jupyterlab_pygments==0.3.0
120+
jupyterlab_server==2.27.3
91121
keyring==25.6.0
92122
kiwisolver==1.4.7
93123
locket==1.0.0
@@ -97,37 +127,53 @@ Mako==1.3.8
97127
markdown-it-py==3.0.0
98128
MarkupSafe==3.0.2
99129
matplotlib==3.10.0
130+
matplotlib-inline==0.1.7
100131
mdurl==0.1.2
132+
mistune==3.1.0
101133
moad_tools==25.2.dev0
102134
more-itertools==10.6.0
103135
msgpack==1.1.0
104136
munkres==1.1.4
105137
mypy_extensions==1.0.0
138+
nbclient==0.10.2
139+
nbconvert==7.16.5
140+
nbformat==5.10.4
106141
nc-time-axis==1.4.1
107142
NEMO-Cmd==25.1.dev0
108143
NEMO_Nowcast==25.1.dev0
144+
nest_asyncio==1.6.0
109145
netCDF4==1.7.2
110146
nodeenv==1.9.1
147+
notebook==7.3.2
148+
notebook_shim==0.2.4
111149
numpy==2.2.1
112150
numpy-groupies==0.11.2
113151
numpy-indexed==0.3.7
114152
openpyxl==3.1.5
115153
OPPTools==0.1.0
154+
overrides==7.7.0
116155
packaging==24.2
117156
pandas==2.2.3
157+
pandocfilters==1.5.0
118158
paramiko==3.5.0
159+
parso==0.8.4
119160
partd==1.4.2
120161
pathspec==0.12.1
121162
pbr==6.1.0
122163
pexpect==4.9.0
164+
pickleshare==0.7.5
123165
pillow==11.1.0
124166
pip==24.3.1
167+
pkgutil_resolve_name==1.3.10
125168
platformdirs==4.3.6
126169
pluggy==1.5.0
127170
pre_commit==4.0.1
128171
prettytable==3.12.0
172+
prometheus_client==0.21.1
173+
prompt_toolkit==3.0.48
129174
psutil==6.1.1
130175
ptyprocess==0.7.0
176+
pure_eval==0.2.3
131177
pyarrow==18.1.0
132178
pycparser==2.22
133179
Pygments==2.19.1
@@ -147,22 +193,28 @@ pytest-randomly==3.15.0
147193
pytest-xdist==3.6.1
148194
python-dateutil==2.9.0.post0
149195
python-hglib==2.6.2
196+
python-json-logger==2.0.7
150197
pytz==2024.1
151198
PyYAML==6.0.2
152199
pyzmq==26.2.0
200+
referencing==0.35.1
153201
requests==2.32.3
154202
requests-file==2.1.0
155203
requests-toolbelt==1.0.0
156204
Reshapr==25.1.dev0
157205
retrying==1.3.3
206+
rfc3339_validator==0.1.4
207+
rfc3986-validator==0.1.1
158208
rich==13.9.4
209+
rpds-py==0.22.3
159210
SalishSeaCmd==25.1.dev0
160211
SalishSeaNowcast==25.1.dev0
161212
SalishSeaTools==25.1.dev0
162213
schedule==1.2.2
163214
scipy==1.15.1
164215
scour==0.38.2
165216
SecretStorage==3.3.3
217+
Send2Trash==1.8.3
166218
sentry-sdk==2.20.0
167219
setuptools==75.8.0
168220
shapely==2.0.6
@@ -184,32 +236,41 @@ sphinxcontrib-jquery==4.1
184236
sphinxcontrib-jsmath==1.0.1
185237
sphinxcontrib-qthelp==2.0.0
186238
sphinxcontrib-serializinghtml==1.1.10
239+
stack_data==0.6.3
187240
stevedore==5.4.0
188241
structlog==24.4.0
189242
supervisor==4.2.5
190243
sysrsync==1.1.1
191244
tblib==3.0.0
192245
tenacity==9.0.0
246+
terminado==0.18.1
247+
tinycss2==1.4.0
193248
toml==0.10.2
194249
tomli==2.2.1
195250
tomli_w==1.2.0
196251
tomlkit==0.13.2
197252
toolz==1.0.0
198253
tornado==6.4.2
199254
tqdm==4.67.1
255+
traitlets==5.14.3
200256
trove-classifiers==2025.1.10.15
201257
types-python-dateutil==2.9.0.20241206
202258
typing_extensions==4.12.2
259+
typing_utils==0.1.0
203260
tzdata==2024.2
204261
ukkonen==1.0.1
262+
uri-template==1.3.0
205263
urllib3==2.3.0
206264
userpath==1.9.2
207265
utm==0.7.0
208266
verboselogs==1.7
209267
virtualenv==20.28.1
210268
watchdog==6.0.0
211269
wcwidth==0.2.13
212-
xarray==2025.1.1
270+
webcolors==24.11.1
271+
webencodings==0.5.1
272+
websocket-client==1.8.0
273+
xarray==2024.7.0
213274
xyzservices==2024.9.0
214275
zeep==4.3.1
215276
zict==3.0.0

tests/workers/test_collect_weather.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def test_weather_download_2_5_km_section(self, prod_config):
182182
["VGRD_AGL-10m", "v10", "v_wind"],
183183
["DSWRF_Sfc", "ssrd", "solar"],
184184
["DLWRF_Sfc", "strd", "therm_rad"],
185-
["LHTFL_Sfc", "lhtfl", "LHTFL_surface"],
185+
["LHTFL_Sfc", "slhtf", "LHTFL_surface"],
186186
["TMP_AGL-2m", "t2m", "tair"],
187187
["SPFH_AGL-2m", "sh2", "qair"],
188188
["RH_AGL-2m", "r2", "RH_2maboveground"],

tests/workers/test_crop_gribs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def test_weather_download_2_5_km_section(self, prod_config):
172172
["VGRD_AGL-10m", "v10", "v_wind"],
173173
["DSWRF_Sfc", "ssrd", "solar"],
174174
["DLWRF_Sfc", "strd", "therm_rad"],
175-
["LHTFL_Sfc", "lhtfl", "LHTFL_surface"],
175+
["LHTFL_Sfc", "slhtf", "LHTFL_surface"],
176176
["TMP_AGL-2m", "t2m", "tair"],
177177
["SPFH_AGL-2m", "sh2", "qair"],
178178
["RH_AGL-2m", "r2", "RH_2maboveground"],

tests/workers/test_download_weather.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_weather_download_2_5_km_section(self, prod_config):
180180
["VGRD_AGL-10m", "v10", "v_wind"],
181181
["DSWRF_Sfc", "ssrd", "solar"],
182182
["DLWRF_Sfc", "strd", "therm_rad"],
183-
["LHTFL_Sfc", "lhtfl", "LHTFL_surface"],
183+
["LHTFL_Sfc", "slhtf", "LHTFL_surface"],
184184
["TMP_AGL-2m", "t2m", "tair"],
185185
["SPFH_AGL-2m", "sh2", "qair"],
186186
["RH_AGL-2m", "r2", "RH_2maboveground"],

tests/workers/test_grib_to_netcdf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_weather_download_2_5_km_section(self, prod_config):
168168
["VGRD_AGL-10m", "v10", "v_wind"],
169169
["DSWRF_Sfc", "ssrd", "solar"],
170170
["DLWRF_Sfc", "strd", "therm_rad"],
171-
["LHTFL_Sfc", "lhtfl", "LHTFL_surface"],
171+
["LHTFL_Sfc", "slhtf", "LHTFL_surface"],
172172
["TMP_AGL-2m", "t2m", "tair"],
173173
["SPFH_AGL-2m", "sh2", "qair"],
174174
["RH_AGL-2m", "r2", "RH_2maboveground"],

0 commit comments

Comments
 (0)