From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 07ADA15800A for ; Fri, 21 Jul 2023 05:42:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F4147E0784; Fri, 21 Jul 2023 05:42:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9780AE0784 for ; Fri, 21 Jul 2023 05:42:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5E68834017A for ; Fri, 21 Jul 2023 05:42:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BD358B5C for ; Fri, 21 Jul 2023 05:42:06 +0000 (UTC) From: "Thomas Beierlein" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Beierlein" Message-ID: <1689918081.f13ca1e55681ae792c7b6a63f57e4eb6bdb2722a.tomjbe@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/cartopy/files/, sci-libs/cartopy/ X-VCS-Repository: repo/gentoo X-VCS-Files: sci-libs/cartopy/cartopy-0.21.1-r1.ebuild sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92.patch sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92_1.patch X-VCS-Directories: sci-libs/cartopy/ sci-libs/cartopy/files/ X-VCS-Committer: tomjbe X-VCS-Committer-Name: Thomas Beierlein X-VCS-Revision: f13ca1e55681ae792c7b6a63f57e4eb6bdb2722a X-VCS-Branch: master Date: Fri, 21 Jul 2023 05:42:06 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 53280861-4f7d-47a4-85f6-03c0b7176383 X-Archives-Hash: a7f80283f35c2a629a0d62cd65cd1a10 commit: f13ca1e55681ae792c7b6a63f57e4eb6bdb2722a Author: Thomas Beierlein gentoo org> AuthorDate: Fri Jul 21 05:37:41 2023 +0000 Commit: Thomas Beierlein gentoo org> CommitDate: Fri Jul 21 05:41:21 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f13ca1e5 sci-libs/cartopy: Fix failing tests with >=sci-libs/proj-9.2 See https://github.com/SciTools/cartopy/issues/2145 Signed-off-by: Thomas Beierlein gentoo.org> sci-libs/cartopy/cartopy-0.21.1-r1.ebuild | 5 +- .../files/cartopy-0.21.1-fix-test_proj92.patch | 126 +++++++++++++++++++++ .../files/cartopy-0.21.1-fix-test_proj92_1.patch | 46 ++++++++ 3 files changed, 176 insertions(+), 1 deletion(-) diff --git a/sci-libs/cartopy/cartopy-0.21.1-r1.ebuild b/sci-libs/cartopy/cartopy-0.21.1-r1.ebuild index 80e71d718b8f..e7186c4571c4 100644 --- a/sci-libs/cartopy/cartopy-0.21.1-r1.ebuild +++ b/sci-libs/cartopy/cartopy-0.21.1-r1.ebuild @@ -57,7 +57,10 @@ BDEPEND=" ) " -PATCHES=( "${FILESDIR}"/${P}-fix-test.patch ) +PATCHES=( "${FILESDIR}"/${P}-fix-test.patch + # backports to fix tests with >=PROJ9.2 + "${FILESDIR}"/${PN}-0.21.1-fix-test_proj92.patch + "${FILESDIR}"/${PN}-0.21.1-fix-test_proj92_1.patch ) EPYTEST_IGNORE=( # Require network access, not covered by markers diff --git a/sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92.patch b/sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92.patch new file mode 100644 index 000000000000..e9f1d03eeeb2 --- /dev/null +++ b/sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92.patch @@ -0,0 +1,126 @@ +diff --git a/lib/cartopy/tests/crs/test_equidistant_conic.py b/lib/cartopy/tests/crs/test_equidistant_conic.py +index 045c87e5d..9f50b4f04 100644 +--- a/lib/cartopy/tests/crs/test_equidistant_conic.py ++++ b/lib/cartopy/tests/crs/test_equidistant_conic.py +@@ -10,6 +10,7 @@ + + import numpy as np + from numpy.testing import assert_almost_equal, assert_array_almost_equal ++import pyproj + import pytest + + import cartopy.crs as ccrs +@@ -23,11 +24,16 @@ def test_default(self): + 'y_0=0.0', 'lat_1=20.0', 'lat_2=50.0'} + check_proj_params('eqdc', eqdc, other_args) + ++ expected_x = (-22784919.35600352, 22784919.35600352) ++ expected_y = (-10001965.729313632, 17558791.85156368) ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = (-22784919.3559981, 22784919.3559981) ++ expected_y = (-10001965.72931272, 17558791.85157471) + assert_almost_equal(np.array(eqdc.x_limits), +- (-22784919.35600352, 22784919.35600352), ++ expected_x, + decimal=7) + assert_almost_equal(np.array(eqdc.y_limits), +- (-10001965.729313632, 17558791.85156368), ++ expected_y, + decimal=7) + + def test_eccentric_globe(self): +@@ -37,12 +43,16 @@ def test_eccentric_globe(self): + other_args = {'a=1000', 'b=500', 'lon_0=0.0', 'lat_0=0.0', 'x_0=0.0', + 'y_0=0.0', 'lat_1=20.0', 'lat_2=50.0'} + check_proj_params('eqdc', eqdc, other_args) +- ++ expected_x = (-3016.869847713461, 3016.869847713461) ++ expected_y = (-1216.6029342241113, 2511.0574375797723) ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = (-2960.1009481, 2960.1009481) ++ expected_y = (-1211.05573766, 2606.04249537) + assert_almost_equal(np.array(eqdc.x_limits), +- (-3016.869847713461, 3016.869847713461), ++ expected_x, + decimal=7) + assert_almost_equal(np.array(eqdc.y_limits), +- (-1216.6029342241113, 2511.0574375797723), ++ expected_y, + decimal=7) + + def test_eastings(self): +@@ -127,12 +137,16 @@ def test_ellipsoid_transform(self): + 'lat_0=23.0', 'x_0=0.0', 'y_0=0.0', 'lat_1=29.5', + 'lat_2=45.5'} + check_proj_params('eqdc', eqdc, other_args) +- ++ expected_x = (-22421870.719894886, 22421870.719894886) ++ expected_y = (-12546277.778958388, 17260638.403203618) ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = (-22421870.71988974, 22421870.71988976) ++ expected_y = (-12546277.77895742, 17260638.403216) + assert_almost_equal(np.array(eqdc.x_limits), +- (-22421870.719894886, 22421870.719894886), ++ expected_x, + decimal=7) + assert_almost_equal(np.array(eqdc.y_limits), +- (-12546277.778958388, 17260638.403203618), ++ expected_y, + decimal=7) + + result = eqdc.transform_point(-75.0, 35.0, geodetic) +diff --git a/lib/cartopy/tests/crs/test_sinusoidal.py b/lib/cartopy/tests/crs/test_sinusoidal.py +index 2f2a1821a..9347260a1 100644 +--- a/lib/cartopy/tests/crs/test_sinusoidal.py ++++ b/lib/cartopy/tests/crs/test_sinusoidal.py +@@ -6,6 +6,7 @@ + + import numpy as np + from numpy.testing import assert_almost_equal ++import pyproj + import pytest + + import cartopy.crs as ccrs +@@ -32,10 +33,15 @@ def test_eccentric_globe(self): + other_args = {'a=1000', 'b=500', 'lon_0=0.0', 'x_0=0.0', 'y_0=0.0'} + check_proj_params('sinu', crs, other_args) + ++ expected_x = [-3141.59, 3141.59] ++ expected_y = [-1216.60, 1216.60] ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = [-3141.60, 3141.60] ++ expected_y = [-1211.05, 1211.05] + assert_almost_equal(np.array(crs.x_limits), +- [-3141.59, 3141.59], decimal=2) ++ expected_x, decimal=2) + assert_almost_equal(np.array(crs.y_limits), +- [-1216.60, 1216.60], decimal=2) ++ expected_y, decimal=2) + + def test_offset(self): + crs = ccrs.Sinusoidal() +diff --git a/lib/cartopy/tests/test_crs.py b/lib/cartopy/tests/test_crs.py +index c1a5d11da..b6c38ced3 100644 +--- a/lib/cartopy/tests/test_crs.py ++++ b/lib/cartopy/tests/test_crs.py +@@ -90,9 +90,17 @@ def test_osgb(self, approx): + def test_epsg(self): + uk = ccrs.epsg(27700) + assert uk.epsg_code == 27700 +- assert_almost_equal(uk.x_limits, (-104009.357, 688806.007), decimal=3) +- assert_almost_equal(uk.y_limits, (-8908.37, 1256558.45), decimal=2) +- assert_almost_equal(uk.threshold, 7928.15, decimal=2) ++ expected_x = (-104009.357, 688806.007) ++ expected_y = (-8908.37, 1256558.45) ++ expected_threshold = 7928.15 ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = (-104728.764, 688806.007) ++ expected_y = (-8908.36, 1256616.32) ++ expected_threshold = 7935.34 ++ assert_almost_equal(uk.x_limits, ++ expected_x, decimal=3) ++ assert_almost_equal(uk.y_limits, expected_y, decimal=2) ++ assert_almost_equal(uk.threshold, expected_threshold, decimal=2) + self._check_osgb(uk) + + def test_epsg_compound_crs(self): diff --git a/sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92_1.patch b/sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92_1.patch new file mode 100644 index 000000000000..7ce52bb23364 --- /dev/null +++ b/sci-libs/cartopy/files/cartopy-0.21.1-fix-test_proj92_1.patch @@ -0,0 +1,46 @@ +diff --git a/lib/cartopy/tests/crs/test_lambert_conformal.py b/lib/cartopy/tests/crs/test_lambert_conformal.py +index 6032d2e5c..c64022ff9 100644 +--- a/lib/cartopy/tests/crs/test_lambert_conformal.py ++++ b/lib/cartopy/tests/crs/test_lambert_conformal.py +@@ -5,6 +5,7 @@ + # licensing details. + + from numpy.testing import assert_array_almost_equal ++import pyproj + import pytest + + import cartopy.crs as ccrs +@@ -68,18 +69,29 @@ def test_too_many_parallel(self): + + def test_single_spole(self): + s_pole_crs = ccrs.LambertConformal(standard_parallels=[-1.]) ++ expected_x = (-19939660, 19939660) ++ expected_y = (-735590302, -8183795) ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = (-19840440, 19840440) ++ expected_y = (-370239953, -8191953) ++ print(s_pole_crs.x_limits) + assert_array_almost_equal(s_pole_crs.x_limits, +- (-19939660, 19939660), ++ expected_x, + decimal=0) + assert_array_almost_equal(s_pole_crs.y_limits, +- (-735590302, -8183795), ++ expected_y, + decimal=0) + + def test_single_npole(self): + n_pole_crs = ccrs.LambertConformal(standard_parallels=[1.]) ++ expected_x = (-20130569, 20130569) ++ expected_y = (-8170229, 726200683) ++ if pyproj.__proj_version__ >= '9.2.0': ++ expected_x = (-20222156, 20222156) ++ expected_y = (-8164817, 360848719) + assert_array_almost_equal(n_pole_crs.x_limits, +- (-20130569, 20130569), ++ expected_x, + decimal=0) + assert_array_almost_equal(n_pole_crs.y_limits, +- (-8170229, 726200683), ++ expected_y, + decimal=0)