File tree Expand file tree Collapse file tree 6 files changed +27
-18
lines changed Expand file tree Collapse file tree 6 files changed +27
-18
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
Accessor for all models
3
3
"""
4
+
4
5
import os
5
6
import tempfile
6
7
from pathlib import Path
Original file line number Diff line number Diff line change 2
2
NEMO submodule
3
3
"""
4
4
5
-
6
5
from .accessor import NemoAccessor
7
6
from .standardizers import standardize_domain , standardize_output
8
7
Original file line number Diff line number Diff line change @@ -370,20 +370,24 @@ def _place_on_grid(ds: Dataset) -> Dataset:
370
370
if var .endswith (suffix ):
371
371
var_nosuffix = var .replace (suffix , "" )
372
372
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
+ ),
387
391
Z = "z_left" if var_nosuffix .endswith ("w" ) else "z" ,
388
392
)
389
393
else :
Original file line number Diff line number Diff line change 1
1
"""
2
2
Download datasets for testing
3
3
"""
4
+
4
5
# pylint: disable=C0116
5
6
import os
6
7
import subprocess
Original file line number Diff line number Diff line change 1
1
"""
2
2
Tests accessor for all models
3
3
"""
4
+
4
5
# pylint: disable=C0116
5
6
6
7
from cf_xarray .datasets import airds
Original file line number Diff line number Diff line change 1
1
"""
2
2
Tests specific for NEMO
3
3
"""
4
+
4
5
# pylint: disable=C0116
5
6
6
7
import os
@@ -122,9 +123,11 @@ def test_domain_standard_names(ds):
122
123
123
124
actual = set (ds .cf .standard_names ["model_level_number_at_sea_floor" ])
124
125
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
+ )
128
131
}
129
132
assert actual == expected
130
133
You can’t perform that action at this time.
0 commit comments