Skip to content

Commit

Permalink
Run pre-commit on all files so isort runs
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Aug 28, 2024
1 parent aad9594 commit a6eb529
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 102 deletions.
6 changes: 1 addition & 5 deletions pyresample/bilinear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@
)

try:
from .xarr import ( # noqa: F401
CACHE_INDICES,
XArrayBilinearResampler,
XArrayResamplerBilinear,
)
from .xarr import CACHE_INDICES, XArrayBilinearResampler, XArrayResamplerBilinear # noqa: F401
except ImportError:
warnings.warn("XArray, dask, and/or zarr not found, XArrayBilinearResampler won't be available.", stacklevel=2)
XArrayBilinearResampler = None # type: ignore
Expand Down
7 changes: 1 addition & 6 deletions pyresample/boundary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""The Boundary classes."""

from pyresample.boundary.legacy_boundary import ( # noqa
AreaBoundary,
AreaDefBoundary,
Boundary,
SimpleBoundary,
)
from pyresample.boundary.legacy_boundary import AreaBoundary, AreaDefBoundary, Boundary, SimpleBoundary # noqa
5 changes: 1 addition & 4 deletions pyresample/ewa/dask_ewa.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
from dask.highlevelgraph import HighLevelGraph

from pyresample.ewa import ll2cr
from pyresample.ewa._fornav import (
fornav_weights_and_sums_wrapper,
write_grid_image_single,
)
from pyresample.ewa._fornav import fornav_weights_and_sums_wrapper, write_grid_image_single
from pyresample.geometry import SwathDefinition
from pyresample.resampler import BaseResampler

Expand Down
7 changes: 1 addition & 6 deletions pyresample/future/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@
"""Future features that are backwards incompatible with current functionality."""

from .resamplers import Resampler # noqa
from .resamplers import ( # noqa
create_resampler,
list_resamplers,
register_resampler,
unregister_resampler,
)
from .resamplers import create_resampler, list_resamplers, register_resampler, unregister_resampler # noqa
7 changes: 1 addition & 6 deletions pyresample/future/resamplers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@
from __future__ import annotations

from .nearest import KDTreeNearestXarrayResampler # noqa
from .registry import ( # noqa
create_resampler,
list_resamplers,
register_resampler,
unregister_resampler,
)
from .registry import create_resampler, list_resamplers, register_resampler, unregister_resampler # noqa
from .resampler import Resampler # noqa
11 changes: 2 additions & 9 deletions pyresample/gradient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,8 @@
from shapely.geometry import Polygon

from pyresample import CHUNK_SIZE
from pyresample.geometry import (
AreaDefinition,
SwathDefinition,
get_geostationary_bounding_box_in_lonlats,
)
from pyresample.gradient._gradient_search import (
one_step_gradient_indices,
one_step_gradient_search,
)
from pyresample.geometry import AreaDefinition, SwathDefinition, get_geostationary_bounding_box_in_lonlats
from pyresample.gradient._gradient_search import one_step_gradient_indices, one_step_gradient_search
from pyresample.resampler import BaseResampler, resample_blocks

logger = logging.getLogger(__name__)
Expand Down
7 changes: 1 addition & 6 deletions pyresample/resampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@
except ImportError:
xr = None

from pyresample.geometry import (
AreaDefinition,
CoordinateDefinition,
IncompatibleAreas,
SwathDefinition,
)
from pyresample.geometry import AreaDefinition, CoordinateDefinition, IncompatibleAreas, SwathDefinition

from .future.resamplers.resampler import hash_dict

Expand Down
6 changes: 1 addition & 5 deletions pyresample/slicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
from pyproj.enums import TransformDirection

from pyresample import AreaDefinition, SwathDefinition
from pyresample.geometry import (
IncompatibleAreas,
InvalidArea,
get_geostationary_bounding_box_in_proj_coords,
)
from pyresample.geometry import IncompatibleAreas, InvalidArea, get_geostationary_bounding_box_in_proj_coords

try:
import dask.array as da
Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@

import pyresample
from pyresample import LegacyAreaDefinition, LegacySwathDefinition
from pyresample.future.geometry import (
AreaDefinition,
CoordinateDefinition,
SwathDefinition,
)
from pyresample.future.geometry import AreaDefinition, CoordinateDefinition, SwathDefinition
from pyresample.test.utils import create_test_latitude, create_test_longitude

SRC_SWATH_2D_SHAPE = (50, 10)
Expand Down
14 changes: 3 additions & 11 deletions pyresample/test/test_bilinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@ def test_get_fractional_distances_irregular(self):

def test_get_fractional_distances_uprights_parallel(self):
"""Test calculation when uprights are parallel."""
from pyresample.bilinear._base import (
_get_fractional_distances_uprights_parallel,
)
from pyresample.bilinear._base import _get_fractional_distances_uprights_parallel

res = _get_fractional_distances_uprights_parallel(self.pts_vert_parallel, 0., 0.)
self.assertEqual(res[0], 0.5)
Expand Down Expand Up @@ -237,11 +235,7 @@ def test_get_input_xy(self):

def test_get_four_closest_corners(self):
"""Test calculation of bounding corners."""
from pyresample.bilinear._base import (
_get_four_closest_corners,
_get_input_xy,
_get_output_xy,
)
from pyresample.bilinear._base import _get_four_closest_corners, _get_input_xy, _get_output_xy

proj = Proj(self.target_def.proj_str)
out_x, out_y = _get_output_xy(self.target_def)
Expand Down Expand Up @@ -1040,9 +1034,7 @@ def test_get_fractional_distances_irregular(self):

def test_get_fractional_distances_uprights_parallel(self):
"""Test calculation when uprights are parallel."""
from pyresample.bilinear._base import (
_get_fractional_distances_uprights_parallel,
)
from pyresample.bilinear._base import _get_fractional_distances_uprights_parallel

res = _get_fractional_distances_uprights_parallel(self.pts_vert_parallel, 0., 0.)
self.assertEqual(res[0], 0.5)
Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/test_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
import pytest

import pyresample
from pyresample._formatting_html import (
area_repr,
plot_area_def,
swath_area_attrs_section,
)
from pyresample._formatting_html import area_repr, plot_area_def, swath_area_attrs_section

from .test_geometry.test_swath import _gen_swath_def_numpy, _gen_swath_def_xarray_dask

Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/test_geometry_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@
import xarray as xr

from pyresample import geometry
from pyresample.geometry import (
IncompatibleAreas,
combine_area_extents_vertical,
concatenate_area_defs,
)
from pyresample.geometry import IncompatibleAreas, combine_area_extents_vertical, concatenate_area_defs
from pyresample.test.utils import catch_warnings


Expand Down
5 changes: 1 addition & 4 deletions pyresample/test/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ def test_add_gridlines(self, axes, fx_locator):

def test_translate_coast_res(self):
"""Test the translation of coast resolution arguments from old basemap notation to cartopy."""
from pyresample.plot import (
BASEMAP_NOT_CARTOPY,
_translate_coast_resolution_to_cartopy,
)
from pyresample.plot import BASEMAP_NOT_CARTOPY, _translate_coast_resolution_to_cartopy

with self.assertRaises(KeyError) as raises:
if sys.version_info > (3,):
Expand Down
5 changes: 1 addition & 4 deletions pyresample/test/test_resample_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ def fun(data, block_info=None, **kwargs):

def test_resample_blocks_can_generate_gradient_indices(self):
"""Test resample blocks can generate gradient indices."""
from pyresample.gradient import (
gradient_resampler_indices,
gradient_resampler_indices_block,
)
from pyresample.gradient import gradient_resampler_indices, gradient_resampler_indices_block
from pyresample.resampler import resample_blocks

chunks = 40
Expand Down
6 changes: 1 addition & 5 deletions pyresample/test/test_resamplers/test_nearest.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@

from pyresample.future.geometry import AreaDefinition, SwathDefinition
from pyresample.future.resamplers import KDTreeNearestXarrayResampler
from pyresample.test.utils import (
assert_maximum_dask_computes,
assert_warnings_contain,
catch_warnings,
)
from pyresample.test.utils import assert_maximum_dask_computes, assert_warnings_contain, catch_warnings
from pyresample.utils.errors import PerformanceWarning


Expand Down
7 changes: 1 addition & 6 deletions pyresample/test/test_resamplers/test_resampler_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@

import pytest

from pyresample.future import (
Resampler,
list_resamplers,
register_resampler,
unregister_resampler,
)
from pyresample.future import Resampler, list_resamplers, register_resampler, unregister_resampler
from pyresample.test.utils import assert_warnings_contain


Expand Down
12 changes: 2 additions & 10 deletions pyresample/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@
from pyproj import CRS

import pyresample
from pyresample.test.utils import (
TEST_FILES_PATH,
assert_future_geometry,
create_test_latitude,
create_test_longitude,
)
from pyresample.test.utils import TEST_FILES_PATH, assert_future_geometry, create_test_latitude, create_test_longitude
from pyresample.utils import load_cf_area
from pyresample.utils.row_appendable_array import RowAppendableArray

Expand Down Expand Up @@ -620,10 +615,7 @@ def test_cf_guess_axis_varname(self):
self.nc_handles['nh10km'], 'doesNotExist', 'x', 'polar_stereographic')

def test_cf_is_valid_coordinate_standardname(self):
from pyresample.utils.cf import (
_is_valid_coordinate_standardname,
_valid_cf_type_of_grid_mapping,
)
from pyresample.utils.cf import _is_valid_coordinate_standardname, _valid_cf_type_of_grid_mapping

# nominal
for proj_type in _valid_cf_type_of_grid_mapping:
Expand Down

0 comments on commit a6eb529

Please sign in to comment.