[Git][debian-gis-team/python-cartopy][master] 7 commits: New upstream version 0.20.3+dfsg

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Wed Jun 29 04:54:38 BST 2022



Bas Couwenberg pushed to branch master at Debian GIS Project / python-cartopy


Commits:
ab593ef1 by Bas Couwenberg at 2022-06-29T05:22:05+02:00
New upstream version 0.20.3+dfsg
- - - - -
9b7e7467 by Bas Couwenberg at 2022-06-29T05:22:16+02:00
Update upstream source from tag 'upstream/0.20.3+dfsg'

Update to upstream version '0.20.3+dfsg'
with Debian dir d3a21df58b0f014cfa43b9d3d70e504da669c0b5
- - - - -
1857cb16 by Bas Couwenberg at 2022-06-29T05:24:20+02:00
New upstream release.

- - - - -
6ccb4992 by Bas Couwenberg at 2022-06-29T05:26:32+02:00
Drop proj-9.0.1.patch, fixed upstream.

- - - - -
c842d2c1 by Bas Couwenberg at 2022-06-29T05:44:49+02:00
Update lintian overrides.

- - - - -
1b1e125a by Bas Couwenberg at 2022-06-29T05:45:43+02:00
Use supported python3 versions in autopkgtest.

- - - - -
888f65c7 by Bas Couwenberg at 2022-06-29T05:45:43+02:00
Set distribution to unstable.

- - - - -


19 changed files:

- .appveyor.yml
- .circleci/config.yml
- − .git_archival.txt
- .github/workflows/ci-testing.yml
- .github/workflows/release.yml
- debian/changelog
- − debian/patches/proj-9.0.1.patch
- debian/patches/series
- debian/python3-cartopy.lintian-overrides
- + debian/source/lintian-overrides
- debian/tests/python3
- lib/cartopy/feature/nightshade.py
- lib/cartopy/tests/crs/test_interrupted_goode_homolosine.py
- lib/cartopy/tests/crs/test_mollweide.py
- lib/cartopy/tests/feature/test_nightshade.py
- lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_land.png
- lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_ocean.png
- lib/cartopy/tests/mpl/test_crs.py
- pyproject.toml


Changes:

=====================================
.appveyor.yml
=====================================
@@ -16,8 +16,7 @@ install:
   - conda config --add channels conda-forge/label/testing
   - set ENV_NAME=test-environment
   - set PACKAGES=%PACKAGES% flufl.lock owslib pep8 pillow pyshp pytest
-  - set PACKAGES=%PACKAGES% requests setuptools_scm setuptools_scm_git_archive
-  - set PACKAGES=%PACKAGES% shapely
+  - set PACKAGES=%PACKAGES% requests setuptools_scm shapely
   - conda create -n %ENV_NAME% python=%PYTHON_VERSION% %PACKAGES%
   - activate %ENV_NAME%
   - set INCLUDE=%CONDA_PREFIX%\Library\include;%INCLUDE%


=====================================
.circleci/config.yml
=====================================
@@ -46,7 +46,6 @@ deps-run: &deps-install
         requests \
         scipy \
         setuptools_scm \
-        setuptools_scm_git_archive \
         shapely \
         $EXTRA_PACKAGES \
         --file docs/doc-requirements.txt


=====================================
.git_archival.txt deleted
=====================================
@@ -1 +0,0 @@
-ref-names: tag: v0.20.2, v0.20.x


=====================================
.github/workflows/ci-testing.yml
=====================================
@@ -48,8 +48,7 @@ jobs:
       - name: Install dependencies
         run: |
           PACKAGES="$PACKAGES flufl.lock owslib pep8 pillow pyshp pytest"
-          PACKAGES="$PACKAGES pytest-xdist requests setuptools_scm"
-          PACKAGES="$PACKAGES setuptools_scm_git_archive shapely"
+          PACKAGES="$PACKAGES pytest-xdist requests setuptools_scm shapely"
           # openssl 3.0 updated the legacy renegotiation default, which causes
           # failures in NASA's WMTS server. They will need to update their
           # server before we can use a newer openssl.


=====================================
.github/workflows/release.yml
=====================================
@@ -26,8 +26,7 @@ jobs:
         run: |
           PACKAGES="cython fiona matplotlib-base numpy pyproj pykdtree scipy"
           PACKAGES="$PACKAGES flufl.lock owslib pep8 pillow pyshp pytest"
-          PACKAGES="$PACKAGES pytest-xdist requests setuptools_scm"
-          PACKAGES="$PACKAGES setuptools_scm_git_archive shapely"
+          PACKAGES="$PACKAGES pytest-xdist requests setuptools_scm shapely"
           conda install $PACKAGES
 
       - name: Create sdist


=====================================
debian/changelog
=====================================
@@ -1,9 +1,13 @@
-python-cartopy (0.20.2+dfsg-3) UNRELEASED; urgency=medium
+python-cartopy (0.20.3+dfsg-1) unstable; urgency=medium
 
   * Team upload.
+  * New upstream release.
   * Bump Standards-Version to 4.6.1, no changes.
+  * Drop proj-9.0.1.patch, fixed upstream.
+  * Update lintian overrides.
+  * Use supported python3 versions in autopkgtest.
 
- -- Bas Couwenberg <sebastic at debian.org>  Tue, 21 Jun 2022 07:19:35 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 29 Jun 2022 05:27:34 +0200
 
 python-cartopy (0.20.2+dfsg-2) unstable; urgency=medium
 


=====================================
debian/patches/proj-9.0.1.patch deleted
=====================================
@@ -1,49 +0,0 @@
-Description: Use xfail for tests that fail with PROJ 9.0.1.
-Author: Bas Couwenberg <sebastic at debian.org>
-Bug: https://github.com/SciTools/cartopy/issues/2051
-Forwarded: https://github.com/SciTools/cartopy/issues/2051#issue-1265122712
-
---- a/lib/cartopy/tests/crs/test_interrupted_goode_homolosine.py
-+++ b/lib/cartopy/tests/crs/test_interrupted_goode_homolosine.py
-@@ -16,6 +16,7 @@ import cartopy.crs as ccrs
- from .helpers import check_proj_params
- 
- 
-+ at pytest.mark.xfail(reason='Fails with PROJ 9.0.1', strict=False)
- @pytest.mark.parametrize("emphasis", ["land", "ocean"])
- def test_default(emphasis):
-     igh = ccrs.InterruptedGoodeHomolosine(emphasis=emphasis)
-@@ -46,6 +47,7 @@ def test_eccentric_globe(emphasis):
-     assert_almost_equal(np.array(igh.y_limits), [-1361.410035, 1361.410035])
- 
- 
-+ at pytest.mark.xfail(reason='Fails with PROJ 9.0.1', strict=False)
- @pytest.mark.parametrize(
-     ("emphasis", "lon"),
-     [("land", -10.0), ("land", 10.0), ("ocean", -10.0), ("ocean", 10.0)],
---- a/lib/cartopy/tests/crs/test_mollweide.py
-+++ b/lib/cartopy/tests/crs/test_mollweide.py
-@@ -16,6 +16,7 @@ import cartopy.crs as ccrs
- from .helpers import check_proj_params
- 
- 
-+ at pytest.mark.xfail(reason='Fails with PROJ 9.0.1', strict=False)
- def test_default():
-     moll = ccrs.Mollweide()
-     other_args = {'a=6378137.0', 'lon_0=0'}
-@@ -37,6 +38,7 @@ def test_sphere_globe():
-     assert_almost_equal(moll.y_limits, [-1414.2135624, 1414.2135624])
- 
- 
-+ at pytest.mark.xfail(reason='Fails with PROJ 9.0.1', strict=False)
- def test_ellipse_globe():
-     globe = ccrs.Globe(ellipse='WGS84')
-     with pytest.warns(UserWarning,
-@@ -77,6 +79,7 @@ def test_offset():
-     assert tuple(np.array(crs.y_limits) - 4321) == crs_offset.y_limits
- 
- 
-+ at pytest.mark.xfail(reason='Fails with PROJ 9.0.1', strict=False)
- @pytest.mark.parametrize('lon', [-10.0, 10.0])
- def test_central_longitude(lon):
-     moll = ccrs.Mollweide(central_longitude=lon)


=====================================
debian/patches/series
=====================================
@@ -2,4 +2,3 @@
 0002-test_robinson.patch
 0003-test_gridliner.patch
 setup-version.patch
-proj-9.0.1.patch


=====================================
debian/python3-cartopy.lintian-overrides
=====================================
@@ -2,6 +2,7 @@
 python-package-depends-on-package-from-other-python-variant Depends: python-cartopy-data
 
 # The program in $PATH is only a helper tool and the package is primarily a library
-application-in-library-section python usr/bin/cartopy_feature_download
-library-package-name-for-application usr/bin/cartopy_feature_download
-no-manual-page usr/bin/cartopy_feature_download
+application-in-library-section python [usr/bin/cartopy_feature_download]
+library-package-name-for-application [usr/bin/cartopy_feature_download]
+no-manual-page [usr/bin/cartopy_feature_download]
+


=====================================
debian/source/lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# Build uses setuptools.
+missing-prerequisite-for-pyproject-backend setuptools.build_meta *
+


=====================================
debian/tests/python3
=====================================
@@ -1,7 +1,7 @@
 #!/bin/sh
 set -efu
 
-PYS=${PYS:-"$(py3versions -r 2>/dev/null)"}
+PYS=${PYS:-"$(py3versions -s 2>/dev/null)"}
 
 
 for py in $PYS; do


=====================================
lib/cartopy/feature/nightshade.py
=====================================
@@ -77,8 +77,12 @@ class Nightshade(ShapelyFeature):
 
         # Solve the generalized equation for omega0, which is the
         # angle of sunrise/sunset from solar noon
-        omega0 = np.rad2deg(np.arccos(np.sin(np.deg2rad(refraction)) /
-                                      np.cos(np.deg2rad(y))))
+        # We need to clip the input to arccos to [-1, 1] due to floating
+        # point precision and arccos creating nans for values outside
+        # of the domain
+        arccos_tmp = np.clip(np.sin(np.deg2rad(refraction)) /
+                             np.cos(np.deg2rad(y)), -1, 1)
+        omega0 = np.rad2deg(np.arccos(arccos_tmp))
 
         # Fill the longitude values from the offset for midnight.
         # This needs to be a closed loop to fill the polygon.


=====================================
lib/cartopy/tests/crs/test_interrupted_goode_homolosine.py
=====================================
@@ -9,7 +9,7 @@ Tests for the InterruptedGoodeHomolosine coordinate system.
 """
 
 import numpy as np
-from numpy.testing import assert_almost_equal
+from numpy.testing import assert_allclose
 import pytest
 
 import cartopy.crs as ccrs
@@ -24,10 +24,10 @@ def test_default(emphasis):
         check_proj_params("igh", igh, other_args)
     elif emphasis == "ocean":
         check_proj_params("igh_o", igh, other_args)
-    assert_almost_equal(
+    assert_allclose(
         np.array(igh.x_limits), [-20037508.3427892, 20037508.3427892]
     )
-    assert_almost_equal(
+    assert_allclose(
         np.array(igh.y_limits), [-8683259.7164347, 8683259.7164347]
     )
 
@@ -42,8 +42,8 @@ def test_eccentric_globe(emphasis):
     elif emphasis == "ocean":
         check_proj_params("igh_o", igh, other_args)
 
-    assert_almost_equal(np.array(igh.x_limits), [-3141.5926536, 3141.5926536])
-    assert_almost_equal(np.array(igh.y_limits), [-1361.410035, 1361.410035])
+    assert_allclose(np.array(igh.x_limits), [-3141.5926536, 3141.5926536])
+    assert_allclose(np.array(igh.y_limits), [-1361.410035, 1361.410035])
 
 
 @pytest.mark.parametrize(
@@ -60,11 +60,10 @@ def test_central_longitude(emphasis, lon):
     elif emphasis == "ocean":
         check_proj_params("igh_o", igh, other_args)
 
-    assert_almost_equal(
+    assert_allclose(
         np.array(igh.x_limits),
         [-20037508.3427892, 20037508.3427892],
-        decimal=5,
     )
-    assert_almost_equal(
+    assert_allclose(
         np.array(igh.y_limits), [-8683259.7164347, 8683259.7164347]
     )


=====================================
lib/cartopy/tests/crs/test_mollweide.py
=====================================
@@ -9,7 +9,7 @@ Tests for the Mollweide coordinate system.
 """
 
 import numpy as np
-from numpy.testing import assert_almost_equal
+from numpy.testing import assert_allclose
 import pytest
 
 import cartopy.crs as ccrs
@@ -21,10 +21,10 @@ def test_default():
     other_args = {'a=6378137.0', 'lon_0=0'}
     check_proj_params('moll', moll, other_args)
 
-    assert_almost_equal(np.array(moll.x_limits),
-                        [-18040095.6961473, 18040095.6961473])
-    assert_almost_equal(np.array(moll.y_limits),
-                        [-9020047.8480736, 9020047.8480736])
+    assert_allclose(np.array(moll.x_limits),
+                    [-18040095.6961473, 18040095.6961473])
+    assert_allclose(np.array(moll.y_limits),
+                    [-9020047.8480736, 9020047.8480736])
 
 
 def test_sphere_globe():
@@ -33,8 +33,8 @@ def test_sphere_globe():
     other_args = {'a=1000', 'lon_0=0'}
     check_proj_params('moll', moll, other_args)
 
-    assert_almost_equal(moll.x_limits, [-2828.4271247, 2828.4271247])
-    assert_almost_equal(moll.y_limits, [-1414.2135624, 1414.2135624])
+    assert_allclose(moll.x_limits, [-2828.4271247, 2828.4271247])
+    assert_allclose(moll.y_limits, [-1414.2135624, 1414.2135624])
 
 
 def test_ellipse_globe():
@@ -48,8 +48,8 @@ def test_ellipse_globe():
     check_proj_params('moll', moll, other_args)
 
     # Limits are the same as default since ellipses are not supported.
-    assert_almost_equal(moll.x_limits, [-18040095.6961473, 18040095.6961473])
-    assert_almost_equal(moll.y_limits, [-9020047.8480736, 9020047.8480736])
+    assert_allclose(moll.x_limits, [-18040095.6961473, 18040095.6961473])
+    assert_allclose(moll.y_limits, [-9020047.8480736, 9020047.8480736])
 
 
 def test_eccentric_globe():
@@ -64,8 +64,8 @@ def test_eccentric_globe():
     check_proj_params('moll', moll, other_args)
 
     # Limits are the same as spheres since ellipses are not supported.
-    assert_almost_equal(moll.x_limits, [-2828.4271247, 2828.4271247])
-    assert_almost_equal(moll.y_limits, [-1414.2135624, 1414.2135624])
+    assert_allclose(moll.x_limits, [-2828.4271247, 2828.4271247])
+    assert_allclose(moll.y_limits, [-1414.2135624, 1414.2135624])
 
 
 def test_offset():
@@ -83,11 +83,10 @@ def test_central_longitude(lon):
     other_args = {'a=6378137.0', f'lon_0={lon}'}
     check_proj_params('moll', moll, other_args)
 
-    assert_almost_equal(np.array(moll.x_limits),
-                        [-18040095.6961473, 18040095.6961473],
-                        decimal=5)
-    assert_almost_equal(np.array(moll.y_limits),
-                        [-9020047.8480736, 9020047.8480736])
+    assert_allclose(np.array(moll.x_limits),
+                    [-18040095.6961473, 18040095.6961473])
+    assert_allclose(np.array(moll.y_limits),
+                    [-9020047.8480736, 9020047.8480736])
 
 
 def test_grid():
@@ -100,10 +99,8 @@ def test_grid():
     other_args = {'a=0.7071067811865476', 'b=0.7071067811865476', 'lon_0=0'}
     check_proj_params('moll', moll, other_args)
 
-    assert_almost_equal(np.array(moll.x_limits),
-                        [-2, 2])
-    assert_almost_equal(np.array(moll.y_limits),
-                        [-1, 1])
+    assert_allclose(np.array(moll.x_limits), [-2, 2])
+    assert_allclose(np.array(moll.y_limits), [-1, 1])
 
     lats = np.arange(0, 91, 5)[::-1]
     lons = np.full_like(lats, 90)
@@ -114,14 +111,14 @@ def test_grid():
         0.75894, 0.80591, 0.84739, 0.88362, 0.91477, 0.94096, 0.96229, 0.97882,
         0.99060, 0.99765, 1.00000,
     ])
-    assert_almost_equal(result[:, 0], expected_x, decimal=5)
+    assert_allclose(result[:, 0], expected_x, atol=1e-5)
 
     expected_y = np.array([
         1.00000, 0.97837, 0.94539, 0.90606, 0.86191, 0.81382, 0.76239, 0.70804,
         0.65116, 0.59204, 0.53097, 0.46820, 0.40397, 0.33850, 0.27201, 0.20472,
         0.13681, 0.06851, 0.00000,
     ])
-    assert_almost_equal(result[:, 1], expected_y, decimal=5)
+    assert_allclose(result[:, 1], expected_y, atol=1e-5)
 
 
 def test_sphere_transform():
@@ -135,14 +132,13 @@ def test_sphere_transform():
     other_args = {'a=1.0', 'b=1.0', 'lon_0=-90.0'}
     check_proj_params('moll', moll, other_args)
 
-    assert_almost_equal(np.array(moll.x_limits),
-                        [-2.8284271247461903, 2.8284271247461903],
-                        decimal=2)
-    assert_almost_equal(np.array(moll.y_limits),
-                        [-1.4142135623730951, 1.4142135623730951])
+    assert_allclose(np.array(moll.x_limits),
+                    [-2.8284271247461903, 2.8284271247461903])
+    assert_allclose(np.array(moll.y_limits),
+                    [-1.4142135623730951, 1.4142135623730951])
 
     result = moll.transform_point(-75.0, -50.0, geodetic)
-    assert_almost_equal(result, [0.1788845, -0.9208758])
+    assert_allclose(result, [0.1788845, -0.9208758])
 
     inverse_result = geodetic.transform_point(result[0], result[1], moll)
-    assert_almost_equal(inverse_result, [-75.0, -50.0])
+    assert_allclose(inverse_result, [-75.0, -50.0])


=====================================
lib/cartopy/tests/feature/test_nightshade.py
=====================================
@@ -8,7 +8,7 @@ from datetime import datetime
 
 import pytest
 
-from cartopy.feature.nightshade import _julian_day, _solar_position
+from cartopy.feature.nightshade import _julian_day, _solar_position, Nightshade
 
 
 def test_julian_day():
@@ -44,3 +44,12 @@ def test_solar_position(dt, true_lat, true_lon):
     lat, lon = _solar_position(dt)
     assert pytest.approx(true_lat, 0.1) == lat
     assert pytest.approx(true_lon, 0.1) == lon
+
+
+def test_nightshade_floating_point():
+    # Smoke test for clipping nightshade floating point values
+    date = datetime(1999, 12, 31, 12)
+
+    # This can cause an error with floating point precision if it is
+    # set to exactly -6 and arccos input is not clipped to [-1, 1]
+    Nightshade(date, refraction=-6.0, color='none')


=====================================
lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_land.png
=====================================
Binary files a/lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_land.png and b/lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_land.png differ


=====================================
lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_ocean.png
=====================================
Binary files a/lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_ocean.png and b/lib/cartopy/tests/mpl/baseline_images/mpl/test_crs/igh_ocean.png differ


=====================================
lib/cartopy/tests/mpl/test_crs.py
=====================================
@@ -9,11 +9,13 @@ from matplotlib.testing.decorators import cleanup
 import pytest
 
 import cartopy.crs as ccrs
-from cartopy.tests.mpl import ImageTesting
+from cartopy.tests.mpl import ImageTesting, MPL_VERSION
 
 
 @pytest.mark.natural_earth
- at ImageTesting(["igh_land"])
+ at ImageTesting(["igh_land"],
+              tolerance=(3.6 if MPL_VERSION.release[:2] < (3, 5)
+                         or ccrs.PROJ_VERSION < (9, 0, 1) else 0.5))
 def test_igh_land():
     crs = ccrs.InterruptedGoodeHomolosine(emphasis="land")
     ax = plt.axes(projection=crs)
@@ -22,7 +24,9 @@ def test_igh_land():
 
 
 @pytest.mark.natural_earth
- at ImageTesting(["igh_ocean"])
+ at ImageTesting(["igh_ocean"],
+              tolerance=(4.5 if MPL_VERSION.release[:2] < (3, 5)
+                         or ccrs.PROJ_VERSION < (9, 0, 1) else 0.5))
 def test_igh_ocean():
     crs = ccrs.InterruptedGoodeHomolosine(
         central_longitude=-160, emphasis="ocean"


=====================================
pyproject.toml
=====================================
@@ -4,7 +4,6 @@ requires = [
     "setuptools >= 40.6.0",
     "Cython >= 0.29.13",
     "oldest-supported-numpy",
-    "setuptools_scm",
-    "setuptools_scm_git_archive",
+    "setuptools_scm >= 7.0.0",
 ]
 build-backend = "setuptools.build_meta"



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-cartopy/-/compare/df9021e425f292655c05312240e19467edc5f99c...888f65c76f23451e8d98c5c7192d07a2174f4c6e

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-cartopy/-/compare/df9021e425f292655c05312240e19467edc5f99c...888f65c76f23451e8d98c5c7192d07a2174f4c6e
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/20220629/94da1f73/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list