[Git][debian-gis-team/pyresample][upstream] New upstream version 1.30.0
Antonio Valentino (@antonio.valentino)
gitlab at salsa.debian.org
Sun Sep 1 08:31:17 BST 2024
Antonio Valentino pushed to branch upstream at Debian GIS Project / pyresample
Commits:
de04f0d4 by Antonio Valentino at 2024-09-01T06:36:09+00:00
New upstream version 1.30.0
- - - - -
29 changed files:
- .github/PULL_REQUEST_TEMPLATE.md
- .github/workflows/deploy.yaml
- .pre-commit-config.yaml
- CHANGELOG.md
- continuous_integration/environment.yaml
- pyproject.toml
- pyresample/_formatting_html.py
- pyresample/bilinear/__init__.py
- pyresample/boundary/__init__.py
- pyresample/ewa/dask_ewa.py
- pyresample/future/__init__.py
- pyresample/future/resamplers/__init__.py
- pyresample/geometry.py
- pyresample/gradient/__init__.py
- pyresample/resampler.py
- pyresample/slicer.py
- pyresample/test/conftest.py
- pyresample/test/test_bilinear.py
- pyresample/test/test_formatting.py
- pyresample/test/test_geometry/test_area.py
- pyresample/test/test_geometry_legacy.py
- pyresample/test/test_plot.py
- pyresample/test/test_resample_blocks.py
- pyresample/test/test_resamplers/test_nearest.py
- pyresample/test/test_resamplers/test_resampler.py
- pyresample/test/test_resamplers/test_resampler_registry.py
- pyresample/test/test_utils.py
- pyresample/version.py
- − setup.cfg
Changes:
=====================================
.github/PULL_REQUEST_TEMPLATE.md
=====================================
@@ -3,5 +3,4 @@
- [ ] Closes #xxxx <!-- remove if there is no corresponding issue, which should only be the case for minor changes -->
- [ ] Tests added <!-- for all bug fixes or enhancements -->
- [ ] Tests passed <!-- for all non-documentation changes -->
- - [ ] Passes ``git diff origin/main **/*py | flake8 --diff`` <!-- remove if you did not edit any Python files -->
- [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later -->
=====================================
.github/workflows/deploy.yaml
=====================================
@@ -66,9 +66,9 @@ jobs:
platforms: all
- name: Build wheels
- uses: pypa/cibuildwheel at v2.19.2
+ uses: pypa/cibuildwheel at v2.20.0
env:
- CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *i686 *-musllinux*"
+ CIBW_SKIP: "cp36-* cp37-* cp38-* cp313-* pp* *i686 *-musllinux*"
CIBW_ARCHS: "${{ matrix.cibw_archs }}"
CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\""
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"
=====================================
.pre-commit-config.yaml
=====================================
@@ -2,14 +2,9 @@ exclude: '^$'
fail_fast: false
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: 'v0.5.0'
+ rev: 'v0.6.2'
hooks:
- id: ruff
-# once https://github.com/astral-sh/ruff/issues/2402 is fully resolved then we can get rid of flake8:
-- repo: https://github.com/pycqa/flake8
- rev: 7.1.0
- hooks:
- - id: flake8
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
@@ -23,12 +18,11 @@ repos:
- id: bandit
args: [--ini, .bandit]
- repo: https://github.com/pre-commit/mirrors-mypy
- rev: 'v1.10.1' # Use the sha / tag you want to point at
+ rev: 'v1.11.1' # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies:
- types-docutils
- - types-pkg-resources
- types-PyYAML
- types-requests
- type_extensions
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,21 @@
+## Version 1.30.0 (2024/08/28)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 616](https://github.com/pytroll/pyresample/pull/616) - Update cibuildwheel to fix setuptools 74.0.0 compatibility
+* [PR 614](https://github.com/pytroll/pyresample/pull/614) - Fix geocentric_resolution compatibility with numpy 2.1.0
+* [PR 613](https://github.com/pytroll/pyresample/pull/613) - Switch on pytest-lazy-fixtures
+
+#### Features added
+
+* [PR 616](https://github.com/pytroll/pyresample/pull/616) - Update cibuildwheel to fix setuptools 74.0.0 compatibility
+* [PR 615](https://github.com/pytroll/pyresample/pull/615) - Allow overriding area repr map section HTML
+
+In this release 5 pull requests were closed.
+
+
## Version 1.29.0 (2024/07/31)
### Issues Closed
=====================================
continuous_integration/environment.yaml
=====================================
@@ -22,9 +22,9 @@ dependencies:
- xarray
- zarr
- coverage
- - pytest <8.0.0
+ - pytest
- pytest-cov
- - pytest-lazy-fixture
+ - pytest-lazy-fixtures
- importlib-metadata
- sphinx-reredirects
- odc-geo
=====================================
pyproject.toml
=====================================
@@ -1,5 +1,5 @@
[build-system]
-requires = ["setuptools", "wheel", "numpy>=2.0.0rc1,<2.3", "Cython>=3", "versioneer"]
+requires = ["setuptools", "wheel", "numpy>=2.0.0rc1,<2.3", "Cython>=3", "versioneer[toml]"]
build-backend = "setuptools.build_meta"
[tool.ruff]
@@ -36,3 +36,22 @@ warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
warn_unused_configs = true
+
+[tool.versioneer]
+VCS = "git"
+style = "pep440"
+versionfile_source = "pyresample/version.py"
+versionfile_build = "pyresample/version.py"
+tag_prefix = "v"
+
+[tool.isort]
+sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
+profile = "black"
+skip_gitignore = true
+default_section = "THIRDPARTY"
+known_first_party = "pyresample"
+line_length = 120
+
+[tool.coverage.run]
+relative_files = true
+omit = ["pyresample/version.py", "versioneer.py"]
=====================================
pyresample/_formatting_html.py
=====================================
@@ -17,6 +17,7 @@
from __future__ import annotations
import uuid
+from collections.abc import Iterable
from functools import lru_cache
from html import escape
from importlib.resources import read_binary
@@ -66,7 +67,9 @@ def _icon(icon_name):
def plot_area_def(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'], # noqa F821
- fmt: Optional[Literal["svg", "png", None]] = None) -> Union[str, None]:
+ fmt: Optional[Literal["svg", "png", None]] = None,
+ features: Optional[Iterable[str]] = None,
+ ) -> Union[str, None]:
"""Plot area.
Args:
@@ -74,9 +77,16 @@ def plot_area_def(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'], #
fmt : Output format of the plot. The output is the string representation of
the respective format xml for svg and base64 for png. Either svg or png.
If None (default) plot is just shown.
+ features: Series of string names of cartopy features to add to the plot.
+ Can be lowercase or uppercase names of the features, for example,
+ "land", "coastline", "borders", "ocean", or any other feature
+ available from ``cartopy.feature``. If None (default), then land,
+ coastline, and borders are used.
Returns:
- svg or png image as string.
+ svg or png image as string or ``None`` when no format is provided
+ in which case the plot is shown interactively.
+
"""
import base64
from io import BytesIO, StringIO
@@ -98,11 +108,15 @@ def plot_area_def(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'], #
ax.add_geometries([poly], crs=cartopy.crs.CRS(area.crs), facecolor="none", edgecolor="red")
bounds = poly.buffer(5).bounds
ax.set_extent([bounds[0], bounds[2], bounds[1], bounds[3]], crs=cartopy.crs.CRS(area.crs))
+ else:
+ raise NotImplementedError("Only AreaDefinition and SwathDefinition objects can be plotted")
+
+ if features is None:
+ features = ("land", "coastline", "borders")
- ax.add_feature(cartopy.feature.OCEAN)
- ax.add_feature(cartopy.feature.LAND)
- ax.add_feature(cartopy.feature.COASTLINE)
- ax.add_feature(cartopy.feature.BORDERS)
+ for feat_name in features:
+ feat_obj = getattr(cartopy.feature, feat_name.upper())
+ ax.add_feature(feat_obj)
plt.tight_layout(pad=0)
@@ -111,14 +125,12 @@ def plot_area_def(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'], #
plt.savefig(svg_str, format="svg", bbox_inches="tight")
plt.close()
return svg_str.getvalue()
-
elif fmt == "png":
png_str = BytesIO()
plt.savefig(png_str, format="png", bbox_inches="tight")
img_str = f"<img src='data:image/png;base64, {base64.encodebytes(png_str.getvalue()).decode('utf-8')}'/>"
plt.close()
return img_str
-
else:
plt.show()
return None
@@ -161,28 +173,6 @@ def collapsible_section(name: str, inline_details: Optional[str] = "", details:
)
-def map_section(area: Union['geom.AreaDefinition', 'geom.SwathDefinition']) -> str: # noqa F821
- """Create html for map section.
-
- Args:
- area : AreaDefinition or SwathDefinition.
-
- Returns:
- Html with collapsible section with a cartopy plot.
-
- """
- map_icon = _icon("icon-globe")
-
- if cartopy:
- coll = collapsible_section("Map", details=plot_area_def(area, fmt="svg"), collapsed=True, icon=map_icon)
- else:
- coll = collapsible_section("Map",
- details="Note: If cartopy is installed a display of the area can be seen here",
- collapsed=True, icon=map_icon)
-
- return f"{coll}"
-
-
def proj_area_attrs_section(area: 'geom.AreaDefinition') -> str: # noqa F821
"""Create html for attribute section based on an area Area.
@@ -308,7 +298,9 @@ def swath_area_attrs_section(area: 'geom.SwathDefinition') -> str: # noqa F821
def area_repr(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'],
include_header: bool = True,
- include_static_files: bool = True):
+ include_static_files: bool = True,
+ map_content: str | None = None,
+ ):
"""Return html repr of an AreaDefinition.
Args:
@@ -318,6 +310,8 @@ def area_repr(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'],
display in the overview of area definitions for the Satpy documentation this
should be set to false.
include_static_files : Load and include css and html needed for representation.
+ map_content : Optionally override the map section contents. Can be any string
+ that is valid HTML between a "<div></div>" tag.
Returns:
Html.
@@ -347,7 +341,18 @@ def area_repr(area: Union['geom.AreaDefinition', 'geom.SwathDefinition'],
html += "<div class='pyresample-area-sections'>"
if isinstance(area, geom.AreaDefinition):
html += proj_area_attrs_section(area)
- html += map_section(area)
+ map_icon = _icon("icon-globe")
+ if map_content is None:
+ if cartopy:
+ map_content = plot_area_def(area, fmt="svg")
+ else:
+ map_content = "Note: If cartopy is installed a display of the area can be seen here"
+ coll = collapsible_section("Map",
+ details=map_content,
+ collapsed=True,
+ icon=map_icon)
+
+ html += str(coll)
elif isinstance(area, geom.SwathDefinition):
html += swath_area_attrs_section(area)
=====================================
pyresample/bilinear/__init__.py
=====================================
@@ -41,11 +41,7 @@ from ._numpy_resampler import ( # noqa: F401
)
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
=====================================
pyresample/boundary/__init__.py
=====================================
@@ -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
=====================================
pyresample/ewa/dask_ewa.py
=====================================
@@ -39,10 +39,7 @@ from dask.array.core import normalize_chunks
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
=====================================
pyresample/future/__init__.py
=====================================
@@ -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
=====================================
pyresample/future/resamplers/__init__.py
=====================================
@@ -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
=====================================
pyresample/geometry.py
=====================================
@@ -2121,8 +2121,8 @@ class AreaDefinition(_ProjectionDefinition):
if existing_hash is None:
existing_hash = hashlib.sha1() # nosec: B324
existing_hash.update(self.crs_wkt.encode('utf-8'))
- existing_hash.update(np.array(self.shape)) # type: ignore[arg-type]
- existing_hash.update(np.array(self.area_extent)) # type: ignore[arg-type]
+ existing_hash.update(np.array(self.shape))
+ existing_hash.update(np.array(self.area_extent))
return existing_hash
@daskify_2in_2out
@@ -2696,6 +2696,15 @@ class AreaDefinition(_ProjectionDefinition):
edge averages.
"""
+ def _safe_bin_edges(arr):
+ try:
+ return np.histogram_bin_edges(arr, bins=10)[:2]
+ except ValueError:
+ # numpy 2.1.0+ produces a ValueError if it can't fill
+ # all bins due to a small data range
+ # we just arbitrarily use the first 2 elements as all elements
+ # should be within floating point precision for our use case
+ return arr[:2]
from pyproj.transformer import Transformer
rows, cols = self.shape
mid_row = rows // 2
@@ -2726,9 +2735,9 @@ class AreaDefinition(_ProjectionDefinition):
# Very useful near edge of disk geostationary areas.
hor_res = vert_res = 0
if hor_dist.size:
- hor_res = np.mean(np.histogram_bin_edges(hor_dist)[:2])
+ hor_res = np.mean(_safe_bin_edges(hor_dist))
if vert_dist.size:
- vert_res = np.mean(np.histogram_bin_edges(vert_dist)[:2])
+ vert_res = np.mean(_safe_bin_edges(vert_dist))
# Use the maximum distance between the two midlines instead of
# binning both of them together. If we binned them together then
# we are highly dependent on the shape of the area (more rows in
=====================================
pyresample/gradient/__init__.py
=====================================
@@ -36,15 +36,8 @@ import xarray as xr
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__)
=====================================
pyresample/resampler.py
=====================================
@@ -40,12 +40,7 @@ try:
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
=====================================
pyresample/slicer.py
=====================================
@@ -27,11 +27,7 @@ from pyproj import Transformer
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
=====================================
pyresample/test/conftest.py
=====================================
@@ -25,11 +25,7 @@ from pyproj import CRS
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)
=====================================
pyresample/test/test_bilinear.py
=====================================
@@ -156,9 +156,7 @@ class TestNumpyBilinear(unittest.TestCase):
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)
@@ -237,11 +235,7 @@ class TestNumpyBilinear(unittest.TestCase):
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)
@@ -1040,9 +1034,7 @@ class TestXarrayBilinear(unittest.TestCase):
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)
=====================================
pyresample/test/test_formatting.py
=====================================
@@ -19,35 +19,29 @@
import unittest.mock as mock
from unittest.mock import ANY
+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
-def test_plot_area_def_w_area_def(area_def_stere_source): # noqa F811
- """Test AreaDefinition plotting as svg/png."""
- area = area_def_stere_source
-
- with mock.patch('matplotlib.pyplot.savefig') as mock_savefig:
- plot_area_def(area, fmt="svg")
- mock_savefig.asser_called_with(ANY, format="svg", bbox_inches="tight")
- mock_savefig.reset_mock()
- plot_area_def(area, fmt="png")
- mock_savefig.assert_called_with(ANY, format="png", bbox_inches="tight")
-
-
-def test_plot_area_def_w_area_def_show(area_def_stere_source): # noqa F811
+ at pytest.mark.parametrize("format", ["svg", "png", None])
+ at pytest.mark.parametrize("features", [None, ("coastline",)])
+def test_plot_area_def_w_area_def(area_def_stere_source, format, features): # noqa F811
"""Test AreaDefinition plotting as svg/png."""
area = area_def_stere_source
- with mock.patch('matplotlib.pyplot.show') as mock_show_plot:
- plot_area_def(area)
- mock_show_plot.assert_called_once()
+ with mock.patch('matplotlib.pyplot.savefig') as mock_savefig, \
+ mock.patch('matplotlib.pyplot.show') as mock_show_plot:
+ plot_area_def(area, fmt=format)
+ if format is None:
+ mock_show_plot.assert_called_once()
+ mock_savefig.assert_not_called()
+ else:
+ mock_show_plot.assert_not_called()
+ mock_savefig.asser_called_with(ANY, format=format, bbox_inches="tight")
def test_plot_area_def_w_swath_def(create_test_swath):
@@ -74,6 +68,14 @@ def test_area_def_cartopy_installed(area_def_stere_source): # noqa F811
assert "Note: If cartopy is installed a display of the area can be seen here" not in area._repr_html_()
+def test_area_repr_custom_map(area_def_stere_source): # noqa F811
+ """Test custom map section of area repr."""
+ area = area_def_stere_source
+ res = area_repr(area, include_header=False, include_static_files=False,
+ map_content="TEST")
+ assert "TEST" in res
+
+
def test_area_repr_w_static_files(area_def_stere_source): # noqa F811
"""Test area representation with static files (css/icons) included."""
area_def = area_def_stere_source
=====================================
pyresample/test/test_geometry/test_area.py
=====================================
@@ -1062,6 +1062,21 @@ class TestAreaDefinition:
geo_res = area_def.geocentric_resolution()
np.testing.assert_allclose(298.647232, geo_res, atol=1e-1)
+ def test_area_def_geocentric_resolution_close_dist(self, create_test_area):
+ """Test geocentric resolution when distance range isn't big enough for histogram bins.
+
+ The method currently uses `np.histogram_bin_edges`. Starting in numpy
+ 2.1.0, if the number of bins requested (10 in this default case) can't
+ be created because the range of the data is too small, it will raise an
+ exception. This test makes sure that geocentric_resolution doesn't
+ error out when this case is encountered.
+
+ """
+ # this area is known to produce horizontal distances of ~999.9999989758
+ # and trigger the error in numpy 2.1.0
+ ar = create_test_area(4087, 5, 5, (-2500.0, -2500.0, 2500.0, 2500.0))
+ np.testing.assert_allclose(ar.geocentric_resolution(), 999.999999, atol=1e-2)
+
def test_area_def_geocentric_resolution_latlong(self, create_test_area):
"""Test the AreaDefinition.geocentric_resolution method on a latlong projection."""
area_extent = (-110.0, 45.0, -95.0, 55.0)
=====================================
pyresample/test/test_geometry_legacy.py
=====================================
@@ -31,11 +31,7 @@ import pytest
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
=====================================
pyresample/test/test_plot.py
=====================================
@@ -120,10 +120,7 @@ class Test(unittest.TestCase):
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,):
=====================================
pyresample/test/test_resample_blocks.py
=====================================
@@ -211,10 +211,7 @@ class TestResampleBlocksArea2Area:
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
=====================================
pyresample/test/test_resamplers/test_nearest.py
=====================================
@@ -24,15 +24,11 @@ import dask.array as da
import numpy as np
import pytest
import xarray as xr
-from pytest_lazyfixture import lazy_fixture
+from pytest_lazy_fixtures import lf
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
@@ -183,9 +179,9 @@ class TestNearestNeighborResampler:
assert res.shape == resampler.target_geo_def.shape
@pytest.mark.parametrize("input_data", [
- lazy_fixture("data_2d_float32_numpy"),
- lazy_fixture("data_2d_float32_dask"),
- lazy_fixture("data_2d_float32_xarray_numpy"),
+ lf("data_2d_float32_numpy"),
+ lf("data_2d_float32_dask"),
+ lf("data_2d_float32_xarray_numpy"),
])
def test_object_type_with_warnings(
self,
@@ -240,8 +236,8 @@ class TestInvalidUsageNearestNeighborResampler:
@pytest.mark.parametrize(
"input_data",
[
- lazy_fixture("data_2d_float32_xarray_dask"),
- lazy_fixture("data_3d_float32_xarray_dask"),
+ lf("data_2d_float32_xarray_dask"),
+ lf("data_3d_float32_xarray_dask"),
]
)
def test_mismatch_geo_data_dims(
@@ -271,8 +267,8 @@ class TestInvalidUsageNearestNeighborResampler:
@pytest.mark.parametrize(
"src_geom",
[
- lazy_fixture("area_def_stere_source"),
- lazy_fixture("swath_def_2d_xarray_dask")
+ lf("area_def_stere_source"),
+ lf("swath_def_2d_xarray_dask")
]
)
@pytest.mark.parametrize(
=====================================
pyresample/test/test_resamplers/test_resampler.py
=====================================
@@ -24,7 +24,7 @@ import dask.array as da
import numpy as np
import pytest
import xarray as xr
-from pytest_lazyfixture import lazy_fixture
+from pytest_lazy_fixtures import lf
from pyresample.future.resamplers.resampler import Resampler
from pyresample.geometry import AreaDefinition, SwathDefinition
@@ -57,16 +57,16 @@ class FakeResampler(Resampler):
@pytest.mark.parametrize(
"src",
[
- lazy_fixture("swath_def_2d_numpy"),
- lazy_fixture("swath_def_2d_dask"),
- lazy_fixture("swath_def_2d_xarray_numpy"),
- lazy_fixture("swath_def_2d_xarray_dask"),
+ lf("swath_def_2d_numpy"),
+ lf("swath_def_2d_dask"),
+ lf("swath_def_2d_xarray_numpy"),
+ lf("swath_def_2d_xarray_dask"),
]
)
@pytest.mark.parametrize(
"dst",
[
- lazy_fixture("area_def_lcc_conus_1km"),
+ lf("area_def_lcc_conus_1km"),
]
)
def test_resampler(src, dst):
=====================================
pyresample/test/test_resamplers/test_resampler_registry.py
=====================================
@@ -25,12 +25,7 @@ from unittest import mock
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
=====================================
pyresample/test/test_utils.py
=====================================
@@ -29,12 +29,7 @@ import pytest
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
@@ -620,10 +615,7 @@ class TestLoadCFArea_Private(unittest.TestCase):
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:
=====================================
pyresample/version.py
=====================================
@@ -26,9 +26,9 @@ def get_keywords() -> Dict[str, str]:
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (HEAD -> main, tag: v1.29.0)"
- git_full = "63b90b7964ab28001a370463de4f11c80e93a63e"
- git_date = "2024-07-31 21:14:48 -0500"
+ git_refnames = " (HEAD -> main, tag: v1.30.0)"
+ git_full = "71e72bd86d2a30bd445da4b23fab0a297ea0549d"
+ git_date = "2024-08-28 13:27:29 -0500"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
setup.cfg deleted
=====================================
@@ -1,32 +0,0 @@
-[bdist_rpm]
-requires=python3-numpy pykdtree python3-numexpr python3-pyproj python3-configobj python3-shapely
-release=1
-doc_files = docs/Makefile docs/source/*.rst
-
-[flake8]
-max-line-length = 120
-exclude = versioneer.py,version.py
-ignore = D107,W504
-per-file-ignores =
- pyresample/test/*.py:D102
-
-[versioneer]
-VCS = git
-style = pep440
-versionfile_source = pyresample/version.py
-versionfile_build = pyresample/version.py
-tag_prefix = v
-
-[coverage:run]
-relative_files = True
-omit =
- pyresample/version.py
- versioneer.py
-
-[isort]
-sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
-profile = black
-skip_gitignore = true
-force_to_top = true
-default_section = THIRDPARTY
-known_first_party = pyresample
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/-/commit/de04f0d43099cee7216b753a6c2aff7126fa6b83
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/-/commit/de04f0d43099cee7216b753a6c2aff7126fa6b83
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240901/8bef512a/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list