Skip to content

Commit e1855d1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 754c0ee commit e1855d1

File tree

6 files changed

+27
-18
lines changed

6 files changed

+27
-18
lines changed

cf_tools/accessor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Accessor for all models
33
"""
4+
45
import os
56
import tempfile
67
from pathlib import Path

cf_tools/nemo/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
NEMO submodule
33
"""
44

5-
65
from .accessor import NemoAccessor
76
from .standardizers import standardize_domain, standardize_output
87

cf_tools/nemo/standardizers.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -370,20 +370,24 @@ def _place_on_grid(ds: Dataset) -> Dataset:
370370
if var.endswith(suffix):
371371
var_nosuffix = var.replace(suffix, "")
372372
rename_dict = dict(
373-
X="x_right"
374-
if any(
375-
var_nosuffix.endswith(hgrid + vgrid)
376-
for hgrid in ("u", "f")
377-
for vgrid in vgrids
378-
)
379-
else "x",
380-
Y="y_right"
381-
if any(
382-
var_nosuffix.endswith(hgrid + vgrid)
383-
for hgrid in ("v", "f")
384-
for vgrid in vgrids
385-
)
386-
else "y",
373+
X=(
374+
"x_right"
375+
if any(
376+
var_nosuffix.endswith(hgrid + vgrid)
377+
for hgrid in ("u", "f")
378+
for vgrid in vgrids
379+
)
380+
else "x"
381+
),
382+
Y=(
383+
"y_right"
384+
if any(
385+
var_nosuffix.endswith(hgrid + vgrid)
386+
for hgrid in ("v", "f")
387+
for vgrid in vgrids
388+
)
389+
else "y"
390+
),
387391
Z="z_left" if var_nosuffix.endswith("w") else "z",
388392
)
389393
else:

cf_tools/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Download datasets for testing
33
"""
4+
45
# pylint: disable=C0116
56
import os
67
import subprocess

cf_tools/tests/test_accessor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests accessor for all models
33
"""
4+
45
# pylint: disable=C0116
56

67
from cf_xarray.datasets import airds

cf_tools/tests/test_nemo.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Tests specific for NEMO
33
"""
4+
45
# pylint: disable=C0116
56

67
import os
@@ -122,9 +123,11 @@ def test_domain_standard_names(ds):
122123

123124
actual = set(ds.cf.standard_names["model_level_number_at_sea_floor"])
124125
expected = {
125-
"mbathy"
126-
if os.path.basename(ds.encoding["source"]) == "mesh_mask.nc"
127-
else "bottom_level"
126+
(
127+
"mbathy"
128+
if os.path.basename(ds.encoding["source"]) == "mesh_mask.nc"
129+
else "bottom_level"
130+
)
128131
}
129132
assert actual == expected
130133

0 commit comments

Comments
 (0)