File tree 5 files changed +11
-7
lines changed
5 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
3
3
import numpy as np
4
- import xarray as xr
5
4
import pytest
5
+ import xarray as xr
6
6
7
7
import xarray_subset_grid .accessor # noqa: F401
8
8
from tests .test_utils import get_test_file_dir
Original file line number Diff line number Diff line change 12
12
from xarray_subset_grid .grids import ugrid
13
13
14
14
try :
15
- import matplotlib .pyplot as plt
15
+ import matplotlib .pyplot as plt # noqa
16
16
17
- from xarray_subset_grid .visualization .mpl_plotting import plot_ugrid , plot_sgrid
17
+ from xarray_subset_grid .visualization .mpl_plotting import ( # plot_sgrid,
18
+ plot_ugrid ,
19
+ )
18
20
except ImportError :
19
21
pytestmark = pytest .mark .skip (reason = "matplotlib is not installed" )
20
22
Original file line number Diff line number Diff line change 5
5
from . import accessor # noqa
6
6
from .selector import Selector
7
7
8
- from ._version import __version__
8
+ from ._version import __version__ # noqa
9
9
10
10
__all__ = ['Selector' ]
Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ def subset_vertical_levels(
132
132
selections ["siglay" ] = slice (elevation_indexes [0 ], elevation_indexes [1 ])
133
133
if "siglev" in ds .dims :
134
134
siglev = ds ["siglev" ].isel (node = 0 )
135
- elevation_index = [int (np .absolute (siglev - level ).argmin (axis = 0 ).values ) for level in levels ]
135
+ elevation_index = [
136
+ int (np .absolute (siglev - level ).argmin (axis = 0 ).values ) for level in levels ]
136
137
selections ["siglev" ] = slice (elevation_index [0 ], elevation_index [1 ])
137
138
138
139
return ds .isel (selections )
Original file line number Diff line number Diff line change 1
- from types import SimpleNamespace
2
1
import warnings
2
+ from types import SimpleNamespace
3
3
4
4
import numpy as np
5
5
import xarray as xr
@@ -417,7 +417,8 @@ def assign_ugrid_topology(
417
417
if mesh .face_coordinates is None :
418
418
try :
419
419
mesh .face_coordinates = ds [mesh .face_node_connectivity ].cf .coordinates
420
- mesh .face_coordinates = " " .join (f"{ coord [0 ]} " for coord in mesh .face_coordinates .values ())
420
+ mesh .face_coordinates = " " .join (f"{ coord [0 ]} "
421
+ for coord in mesh .face_coordinates .values ())
421
422
except AttributeError :
422
423
mesh .face_coordinates = None
423
424
You can’t perform that action at this time.
0 commit comments