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 11"""
22Accessor for all models
33"""
4+
45import os
56import tempfile
67from pathlib import Path
Original file line number Diff line number Diff line change 22NEMO submodule
33"""
44
5-
65from .accessor import NemoAccessor
76from .standardizers import standardize_domain , standardize_output
87
Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff line change 11"""
22Download datasets for testing
33"""
4+
45# pylint: disable=C0116
56import os
67import subprocess
Original file line number Diff line number Diff line change 11"""
22Tests accessor for all models
33"""
4+
45# pylint: disable=C0116
56
67from cf_xarray .datasets import airds
Original file line number Diff line number Diff line change 11"""
22Tests specific for NEMO
33"""
4+
45# pylint: disable=C0116
56
67import 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
You can’t perform that action at this time.
0 commit comments