From ca5b65ae8f24abb9c14f123a5802868fadc3ab11 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Tue, 8 Oct 2024 22:47:41 -0700 Subject: [PATCH] removed some lint --- tests/test_grids/test_sgrid.py | 2 +- tests/test_visualization/test_mpl_plotting.py | 6 ++++-- xarray_subset_grid/__init__.py | 2 +- xarray_subset_grid/grids/fvcom_grid.py | 3 ++- xarray_subset_grid/grids/ugrid.py | 5 +++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/test_grids/test_sgrid.py b/tests/test_grids/test_sgrid.py index 824fb52..5fb32ea 100644 --- a/tests/test_grids/test_sgrid.py +++ b/tests/test_grids/test_sgrid.py @@ -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 diff --git a/tests/test_visualization/test_mpl_plotting.py b/tests/test_visualization/test_mpl_plotting.py index 1d41a85..e766164 100644 --- a/tests/test_visualization/test_mpl_plotting.py +++ b/tests/test_visualization/test_mpl_plotting.py @@ -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") diff --git a/xarray_subset_grid/__init__.py b/xarray_subset_grid/__init__.py index d210b49..cb7e413 100644 --- a/xarray_subset_grid/__init__.py +++ b/xarray_subset_grid/__init__.py @@ -5,6 +5,6 @@ from . import accessor # noqa from .selector import Selector -from._version import __version__ +from._version import __version__ # noqa __all__ = ['Selector'] diff --git a/xarray_subset_grid/grids/fvcom_grid.py b/xarray_subset_grid/grids/fvcom_grid.py index 80428fe..9ee5683 100644 --- a/xarray_subset_grid/grids/fvcom_grid.py +++ b/xarray_subset_grid/grids/fvcom_grid.py @@ -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) diff --git a/xarray_subset_grid/grids/ugrid.py b/xarray_subset_grid/grids/ugrid.py index 8bdf365..81ca36e 100644 --- a/xarray_subset_grid/grids/ugrid.py +++ b/xarray_subset_grid/grids/ugrid.py @@ -1,5 +1,5 @@ -from types import SimpleNamespace import warnings +from types import SimpleNamespace import numpy as np import xarray as xr @@ -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