[Git][debian-gis-team/pyresample][master] 6 commits: New upstream version 1.28.2

Antonio Valentino (@antonio.valentino) gitlab at salsa.debian.org
Sat Mar 2 19:11:59 GMT 2024



Antonio Valentino pushed to branch master at Debian GIS Project / pyresample


Commits:
0e365730 by Antonio Valentino at 2024-03-02T11:41:55+00:00
New upstream version 1.28.2
- - - - -
8b391355 by Antonio Valentino at 2024-03-02T11:42:06+00:00
Update upstream source from tag 'upstream/1.28.2'

Update to upstream version '1.28.2'
with Debian dir 1ecb1ffc107ab4e8b84d7c7f0f662d66d5f323fd
- - - - -
7c9b5bd4 by Antonio Valentino at 2024-03-02T11:43:07+00:00
New upstream release

- - - - -
60ea161c by Antonio Valentino at 2024-03-02T11:49:31+00:00
Drop 0005-Include-package-data.patch

- - - - -
161d36d9 by Antonio Valentino at 2024-03-02T19:02:36+00:00
Temparary skip tests incompatible with pytest 8

See also https://github.com/TvoroG/pytest-lazy-fixture/issues/65.

- - - - -
6829095d by Antonio Valentino at 2024-03-02T19:02:39+00:00
Set distribution to unstable

- - - - -


10 changed files:

- CHANGELOG.md
- debian/changelog
- − debian/patches/0005-Include-package-data.patch
- debian/patches/series
- debian/rules
- pyresample/future/geometry/swath.py
- pyresample/test/conftest.py
- pyresample/test/test_geometry/test_swath.py
- pyresample/version.py
- setup.py


Changes:

=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,24 @@
+## Version 1.28.2 (2024/02/29)
+
+### Issues Closed
+
+* [Issue 539](https://github.com/pytroll/pyresample/issues/539) - Compatibility with libproj v9.3
+
+In this release 1 issue was closed.
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 586](https://github.com/pytroll/pyresample/pull/586) - Include package data
+
+#### Features added
+
+* [PR 578](https://github.com/pytroll/pyresample/pull/578) - Add attrs to future swath definition
+
+In this release 2 pull requests were closed.
+
+
 ## Version 1.28.1 (2024/02/15)
 
 ### Pull Requests Merged


=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+pyresample (1.28.2-1) unstable; urgency=medium
+
+  * New upstream release.
+  * debian/patches:
+    - Drop 0005-Include-package-data.patch, applied upstream.
+  * debian/rules:
+    - Skip tests that are incompatible with pytest 8 (see also
+      https://github.com/TvoroG/pytest-lazy-fixture/issues/65).
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Sat, 02 Mar 2024 11:49:49 +0000
+
 pyresample (1.28.1-2) unstable; urgency=medium
 
   * debian/rules:


=====================================
debian/patches/0005-Include-package-data.patch deleted
=====================================
@@ -1,21 +0,0 @@
-From: Antonio Valentino <antonio.valentino at tiscali.it>
-Date: Sat, 17 Feb 2024 09:48:44 +0000
-Subject: Include package data
-
-Forwarded: https://github.com/pytroll/pyresample/pull/586
----
- setup.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/setup.py b/setup.py
-index 843ced6..8857778 100644
---- a/setup.py
-+++ b/setup.py
-@@ -101,6 +101,7 @@ if __name__ == "__main__":
-           package_dir={'pyresample': 'pyresample'},
-           packages=find_packages(),
-           package_data={'pyresample.test': ['test_files/*']},
-+          include_package_data=True,
-           python_requires='>=3.9',
-           install_requires=requirements,
-           extras_require=extras_require,


=====================================
debian/patches/series
=====================================
@@ -2,4 +2,3 @@
 0002-Skip-test-on-deprecated-basemap.patch
 0003-Fix-mathjax-path.patch
 0004-Fix-privacy-breachs.patch
-0005-Include-package-data.patch


=====================================
debian/rules
=====================================
@@ -7,6 +7,12 @@
 # Enable hardening build flags
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 
+ifneq (,${PYBUILD_AUTOPKGTEST})
+TESTDIR=/usr/lib/python3/dist-packages/pyresample/test
+else
+TESTDIR=pyresample/test
+endif
+
 export PYBUILD_NAME=pyresample
 export USE_CYTHON=True
 export PYBUILD_TEST_ARGS=\
@@ -16,6 +22,17 @@ and not test_to_odc_geobox \
 and not test_area_def_cartopy_installed \
 and not test_area_repr_w_static_files \
 and not test_area_repr_wo_static_files" \
+--ignore $(TESTDIR)/test_resamplers/test_nearest.py \
+--ignore $(TESTDIR)/test_resamplers/test_resampler.py \
+--ignore $(TESTDIR)/test_dask_ewa.py \
+--ignore $(TESTDIR)/test_formatting.py \
+--ignore $(TESTDIR)/test_geometry/test_area.py \
+--ignore $(TESTDIR)/test_geometry/test_area_boundary.py \
+--ignore $(TESTDIR)/test_geometry/test_swath.py \
+--ignore $(TESTDIR)/test_geometry/test_swath_boundary.py \
+--ignore $(TESTDIR)/test_geometry_legacy.py \
+--ignore $(TESTDIR)/test_resamplers/test_resampler_registry.py \
+--ignore $(TESTDIR)/test_utils.py \
 --pyargs ${PYBUILD_NAME}
 
 %:


=====================================
pyresample/future/geometry/swath.py
=====================================
@@ -19,4 +19,64 @@
 
 from __future__ import annotations
 
-from pyresample.geometry import CoordinateDefinition, SwathDefinition  # noqa
+import numpy as np
+
+from pyresample.geometry import _get_highest_level_class  # noqa
+from pyresample.geometry import CoordinateDefinition, DimensionError  # noqa
+from pyresample.geometry import SwathDefinition as LegacySwathDefinition
+
+
+class SwathDefinition(LegacySwathDefinition):
+    """Swath defined by lons and lats.
+
+    Parameters
+    ----------
+    lons : numpy array
+    lats : numpy array
+    crs: pyproj.CRS,
+       The CRS to use. longlat on WGS84 by default.
+    attrs: dict,
+       A dictionary made to store metadata.
+
+    Attributes
+    ----------
+    shape : tuple
+        Swath shape
+    size : int
+        Number of elements in swath
+    ndims : int
+        Swath dimensions
+    lons : object
+        Swath lons
+    lats : object
+        Swath lats
+    cartesian_coords : object
+        Swath cartesian coordinates
+    """
+
+    def __init__(self, lons, lats, crs=None, attrs=None):
+        super().__init__(lons, lats, crs=crs)
+        self.attrs = attrs or {}
+
+    def __getitem__(self, key):
+        """Slice a 2D geographic definition."""
+        y_slice, x_slice = key
+        return self.__class__(
+            lons=self.lons[y_slice, x_slice],
+            lats=self.lats[y_slice, x_slice],
+            attrs=self.attrs
+        )
+
+    def concatenate(self, other):
+        """Concatenate coordinate definitions."""
+        if self.ndim != other.ndim:
+            raise DimensionError(('Unable to concatenate %sD and %sD '
+                                  'geometries') % (self.ndim, other.ndim))
+        if self.crs != other.crs:
+            raise ValueError("Incompatible CRSs.")
+        klass = _get_highest_level_class(self, other)
+        lons = np.concatenate((self.lons, other.lons))
+        lats = np.concatenate((self.lats, other.lats))
+        attrs = self.attrs.copy()
+        attrs.update(other.attrs)
+        return klass(lons, lats, attrs=attrs)


=====================================
pyresample/test/conftest.py
=====================================
@@ -76,6 +76,8 @@ def create_test_swath(swath_class):
 
     """
     def _create_test_swath(lons, lats, **kwargs):
+        if swath_class is SwathDefinition:
+            kwargs.pop("nproc", None)
         return swath_class(lons, lats, **kwargs)
     return _create_test_swath
 


=====================================
pyresample/test/test_geometry/test_swath.py
=====================================
@@ -462,3 +462,43 @@ def assert_np_dict_allclose(dict1, dict2):
             np.testing.assert_allclose(val, dict2[key])
         except TypeError:
             assert val == dict2[key]
+
+
+def test_future_swath_has_attrs():
+    """Test that future SwathDefinition has attrs."""
+    from pyresample.future.geometry import SwathDefinition
+    lons, lats = _gen_swath_lons_lats()
+    attrs = dict(meta="data")
+    swath = SwathDefinition(lons, lats, attrs=attrs)
+    assert swath.attrs == attrs
+
+
+def test_future_swath_slice_has_attrs():
+    """Test that future sliced SwathDefinition has attrs."""
+    from pyresample.future.geometry import SwathDefinition
+    lons, lats = _gen_swath_lons_lats()
+    attrs = dict(meta="data")
+    swath = SwathDefinition(lons, lats, attrs=attrs)[0:1, 0:1]
+    assert swath.attrs == attrs
+
+
+def test_future_swath_concat_has_attrs():
+    """Test that future concatenated SwathDefinition has attrs."""
+    from pyresample.future.geometry import SwathDefinition
+    lons, lats = _gen_swath_lons_lats()
+    attrs1 = dict(meta1="data")
+    swath1 = SwathDefinition(lons, lats, attrs=attrs1)
+    attrs2 = dict(meta2="data")
+    swath2 = SwathDefinition(lons, lats, attrs=attrs2)
+    swath = swath1.concatenate(swath2)
+    assert swath.attrs == dict(meta1="data", meta2="data")
+
+
+def test_future_swath_concat_fails_on_different_crs():
+    """Test that future concatenated SwathDefinition must have the same crs."""
+    from pyresample.future.geometry import SwathDefinition
+    lons, lats = _gen_swath_lons_lats()
+    swath1 = SwathDefinition(lons, lats, crs="mycrs")
+    swath2 = SwathDefinition(lons, lats, crs="myothercrs")
+    with pytest.raises(ValueError, match="Incompatible CRSs."):
+        _ = swath1.concatenate(swath2)


=====================================
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 = " (tag: v1.28.1)"
-    git_full = "81810234f2e8a64677edc1c15dd85b5d6b795e8f"
-    git_date = "2024-02-15 20:25:09 -0600"
+    git_refnames = " (tag: v1.28.2)"
+    git_full = "a45a4f7a998c621c13284202d0fdd5c3658f78a7"
+    git_date = "2024-02-29 09:22:00 +0100"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 


=====================================
setup.py
=====================================
@@ -101,6 +101,7 @@ if __name__ == "__main__":
           package_dir={'pyresample': 'pyresample'},
           packages=find_packages(),
           package_data={'pyresample.test': ['test_files/*']},
+          include_package_data=True,
           python_requires='>=3.9',
           install_requires=requirements,
           extras_require=extras_require,



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/-/compare/767d55e002d880fd2ffcfb39d6acec886762d305...6829095dad106b3565f57f9e684da0d5a6c2a5c6

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyresample/-/compare/767d55e002d880fd2ffcfb39d6acec886762d305...6829095dad106b3565f57f9e684da0d5a6c2a5c6
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/20240302/0f38511d/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list