Skip to content

Commit

Permalink
removed some lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBarker-NOAA committed Oct 9, 2024
1 parent 4d02b7a commit ca5b65a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/test_grids/test_sgrid.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os

import numpy as np
import xarray as xr
import pytest
import xarray as xr

import xarray_subset_grid.accessor # noqa: F401
from tests.test_utils import get_test_file_dir
Expand Down
6 changes: 4 additions & 2 deletions tests/test_visualization/test_mpl_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
from xarray_subset_grid.grids import ugrid

try:
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt # noqa

from xarray_subset_grid.visualization.mpl_plotting import plot_ugrid, plot_sgrid
from xarray_subset_grid.visualization.mpl_plotting import ( # plot_sgrid,
plot_ugrid,
)
except ImportError:
pytestmark = pytest.mark.skip(reason="matplotlib is not installed")

Expand Down
2 changes: 1 addition & 1 deletion xarray_subset_grid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
from . import accessor # noqa
from .selector import Selector

from._version import __version__
from._version import __version__ # noqa

__all__ = ['Selector']
3 changes: 2 additions & 1 deletion xarray_subset_grid/grids/fvcom_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def subset_vertical_levels(
selections["siglay"] = slice(elevation_indexes[0], elevation_indexes[1])
if "siglev" in ds.dims:
siglev = ds["siglev"].isel(node=0)
elevation_index = [int(np.absolute(siglev - level).argmin(axis=0).values) for level in levels]
elevation_index = [
int(np.absolute(siglev - level).argmin(axis=0).values) for level in levels]
selections["siglev"] = slice(elevation_index[0], elevation_index[1])

return ds.isel(selections)
5 changes: 3 additions & 2 deletions xarray_subset_grid/grids/ugrid.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from types import SimpleNamespace
import warnings
from types import SimpleNamespace

import numpy as np
import xarray as xr
Expand Down Expand Up @@ -417,7 +417,8 @@ def assign_ugrid_topology(
if mesh.face_coordinates is None:
try:
mesh.face_coordinates = ds[mesh.face_node_connectivity].cf.coordinates
mesh.face_coordinates = " ".join(f"{coord[0]}" for coord in mesh.face_coordinates.values())
mesh.face_coordinates = " ".join(f"{coord[0]}"
for coord in mesh.face_coordinates.values())
except AttributeError:
mesh.face_coordinates = None

Expand Down

0 comments on commit ca5b65a

Please sign in to comment.