Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley committed Sep 3, 2024
1 parent 4b82a64 commit 6c23d65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 1 addition & 3 deletions esmf_regrid/experimental/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import scipy.sparse

import esmf_regrid
from esmf_regrid import _load_context
from esmf_regrid import check_method, Constants
from esmf_regrid import _load_context, check_method, Constants, esmpy
from esmf_regrid.experimental.unstructured_scheme import (
GridToMeshESMFRegridder,
MeshToGridESMFRegridder,
Expand All @@ -22,7 +21,6 @@
GridRecord,
MeshRecord,
)
from esmf_regrid import esmpy


SUPPORTED_REGRIDDERS = [
Expand Down
14 changes: 7 additions & 7 deletions esmf_regrid/tests/unit/schemes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
from numpy import ma
import pytest

from esmf_regrid import esmpy
from esmf_regrid.schemes import ESMFAreaWeighted, ESMFBilinear, ESMFNearest
from esmf_regrid.tests.unit.schemes.test__cube_to_GridInfo import _grid_cube
from esmf_regrid.tests.unit.schemes.test__mesh_to_MeshInfo import (
_gridlike_mesh,
_gridlike_mesh_cube,
)
from esmf_regrid import esmpy


def _test_cube_regrid(scheme, src_type, tgt_type):
Expand Down Expand Up @@ -286,18 +286,18 @@ def _test_esmf_args(scheme):

match_duplicate = "cannot be controlled by `esmf_args`"
with pytest.raises(ValueError, match=match_duplicate):
rg = scheme(esmf_args=invalid_esmf_args_duplicate)
_ = scheme(esmf_args=invalid_esmf_args_duplicate)
with pytest.raises(ValueError, match=match_duplicate):
rg = scheme().regridder(src, tgt, esmf_args=invalid_esmf_args_duplicate)
_ = scheme().regridder(src, tgt, esmf_args=invalid_esmf_args_duplicate)

match_incorrect = "is not a valid argument for"
with pytest.raises(ValueError, match=match_incorrect):
rg = scheme(esmf_args=invalid_esmf_args_incorrect)
_ = scheme(esmf_args=invalid_esmf_args_incorrect)
with pytest.raises(ValueError, match=match_incorrect):
rg = scheme().regridder(src, tgt, esmf_args=invalid_esmf_args_incorrect)
_ = scheme().regridder(src, tgt, esmf_args=invalid_esmf_args_incorrect)

match_type = "Expected `esmf_args` to be a dict, got a "
with pytest.raises(TypeError, match=match_type):
rg = scheme(esmf_args=invalid_esmf_args_type)
_ = scheme(esmf_args=invalid_esmf_args_type)
with pytest.raises(TypeError, match=match_type):
rg = scheme().regridder(src, tgt, esmf_args=invalid_esmf_args_type)
_ = scheme().regridder(src, tgt, esmf_args=invalid_esmf_args_type)
3 changes: 2 additions & 1 deletion esmf_regrid/tests/unit/schemes/test_ESMFBilinearRegridder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import numpy as np
import pytest

from esmf_regrid import esmpy
from esmf_regrid.schemes import ESMFBilinearRegridder
from esmf_regrid.tests.unit.schemes.test__cube_to_GridInfo import (
_curvilinear_cube,
_grid_cube,
)
from esmf_regrid import esmpy


def test_dim_switching():
Expand Down Expand Up @@ -333,6 +333,7 @@ def test_regrid_data():


def test_extrapolate_gaps():
"""Test that `extrapolate_gaps` argument works as expected."""
n_lons = 6
n_lats = 5
src_lon_bounds = (-140, 180)
Expand Down

0 comments on commit 6c23d65

Please sign in to comment.