Skip to content

Commit 6079339

Browse files
Change naming from cf -> ux
This is to not mislead that the uxarray metadata is "CF" compliant
1 parent 1261d23 commit 6079339

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/parcels/_core/fieldset.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ def _discover_copernicusmarine_U_and_V(ds: xr.Dataset) -> xr.Dataset:
410410
def _discover_fesom2_U_and_V(ds: ux.UxDataset) -> ux.UxDataset:
411411
# Assumes that the dataset has U and V data
412412

413-
cf_UV_standard_name_fallbacks = [("unod", "vnod"), ("u", "v")]
414-
cf_W_standard_name_fallbacks = ["w"]
413+
ux_UV_standard_name_fallbacks = [("unod", "vnod"), ("u", "v")]
414+
ux_W_standard_name_fallbacks = ["w"]
415415

416416
if "W" not in ds:
417-
for cf_standard_name_W in cf_W_standard_name_fallbacks:
418-
if cf_standard_name_W in ds.cf.standard_names:
419-
ds = _ds_rename_using_standard_names(ds, {cf_standard_name_W: "W"})
417+
for ux_standard_name_W in ux_W_standard_name_fallbacks:
418+
if ux_standard_name_W in ds.ux.standard_names:
419+
ds = _ds_rename_using_standard_names(ds, {ux_standard_name_W: "W"})
420420
break
421421

422422
if "U" in ds and "V" in ds:
@@ -426,18 +426,18 @@ def _discover_fesom2_U_and_V(ds: ux.UxDataset) -> ux.UxDataset:
426426
"Dataset has only one of the two variables 'U' and 'V'. Please rename the appropriate variable in your dataset to have both 'U' and 'V' for Parcels simulation."
427427
)
428428

429-
for cf_standard_name_U, cf_standard_name_V in cf_UV_standard_name_fallbacks:
430-
if cf_standard_name_U in ds.cf.standard_names:
431-
if cf_standard_name_V not in ds.cf.standard_names:
429+
for ux_standard_name_U, ux_standard_name_V in ux_UV_standard_name_fallbacks:
430+
if ux_standard_name_U in ds.ux.standard_names:
431+
if ux_standard_name_V not in ds.ux.standard_names:
432432
raise ValueError(
433-
f"Dataset has variable with CF standard name {cf_standard_name_U!r}, "
434-
f"but not the matching variable with CF standard name {cf_standard_name_V!r}. "
433+
f"Dataset has variable with UXArray standard name {ux_standard_name_U!r}, "
434+
f"but not the matching variable with UXArray standard name {ux_standard_name_V!r}. "
435435
"Please rename the appropriate variables in your dataset to have both 'U' and 'V' for Parcels simulation."
436436
)
437437
else:
438438
continue
439439

440-
ds = _ds_rename_using_standard_names(ds, {cf_standard_name_U: "U", cf_standard_name_V: "V"})
440+
ds = _ds_rename_using_standard_names(ds, {ux_standard_name_U: "U", ux_standard_name_V: "V"})
441441
break
442442
return ds
443443

0 commit comments

Comments
 (0)