Antonio Valentino pushed to branch master at Debian GIS Project / pytroll-schedule
Commits: cd3c2a74 by Antonio Valentino at 2022-12-22T11:20:16+00:00 New 0004-Fix-floating-point-comparison.patch - - - - - 4ceb5833 by Antonio Valentino at 2022-12-22T11:20:39+00:00 Set distribution to unstable - - - - - 3 changed files: - debian/changelog - + debian/patches/0004-Fix-floating-point-comparison.patch - debian/patches/series Changes: ===================================== debian/changelog ===================================== @@ -1,3 +1,11 @@ +pytroll-schedule (0.6.0-5) unstable; urgency=medium + + * debian/patches: + - new 0004-Fix-floating-point-comparison.patch + (Closes: #1026733). + + -- Antonio Valentino <[email protected]> Thu, 22 Dec 2022 11:20:31 +0000 + pytroll-schedule (0.6.0-4) unstable; urgency=medium [ Bas Couwenberg ] ===================================== debian/patches/0004-Fix-floating-point-comparison.patch ===================================== @@ -0,0 +1,44 @@ +From: Antonio Valentino <[email protected]> +Date: Thu, 22 Dec 2022 10:26:47 +0000 +Subject: Fix floating point comparison + +Forwarded: https://github.com/pytroll/pytroll-schedule/pull/73 +--- + trollsched/tests/test_spherical.py | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/trollsched/tests/test_spherical.py b/trollsched/tests/test_spherical.py +index 1ed125f..689d275 100644 +--- a/trollsched/tests/test_spherical.py ++++ b/trollsched/tests/test_spherical.py +@@ -37,7 +37,7 @@ class TestSCoordinate(unittest.TestCase): + """Test Vincenty formula + """ + d = SCoordinate(0, 0).distance(SCoordinate(1, 1)) +- self.assertEquals(d, 1.2745557823062943) ++ np.testing.assert_allclose(d, 1.2745557823062943) + + def test_hdistance(self): + """Test Haversine formula +@@ -487,10 +487,17 @@ class TestSphericalPolygon(unittest.TestCase): + + self.assertTrue(poly_inter.area() <= poly_union.area()) + +- self.assertTrue(np.allclose(poly_inter.vertices, +- np.deg2rad(inter))) +- self.assertTrue(np.allclose(poly_union.vertices, +- np.deg2rad(uni))) ++ def normalize(x): ++ return (np.asarray([1,2,3,4]) + np.pi) % (2*np.pi) - np.pi ++ ++ np.testing.assert_allclose( ++ normalize(poly_inter.vertices), ++ normalize(np.deg2rad(inter)), ++ ) ++ np.testing.assert_allclose( ++ normalize(poly_union.vertices), ++ normalize(np.deg2rad(uni)), ++ ) + + # Test 2 polygons sharing 2 contiguous edges. + ===================================== debian/patches/series ===================================== @@ -1,3 +1,4 @@ 0001-Do-not-install-broken-script.patch 0002-Install-tests.patch 0003-Fix-brikent-tests.patch +0004-Fix-floating-point-comparison.patch View it on GitLab: https://salsa.debian.org/debian-gis-team/pytroll-schedule/-/compare/a326ab04b588b5fa22c8eaa1890857f0dd644b30...4ceb5833fc7b642aa49cddb93209db13f53936b3 -- View it on GitLab: https://salsa.debian.org/debian-gis-team/pytroll-schedule/-/compare/a326ab04b588b5fa22c8eaa1890857f0dd644b30...4ceb5833fc7b642aa49cddb93209db13f53936b3 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ Pkg-grass-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel
