[python-shapely] 75/148: Imported upstream patch to floats in test
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Thu Aug 20 17:42:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository python-shapely.
commit 4e3c4124a08582e71262ee11e4ec364bc23ae1db
Author: Pietro Battiston <me at pietrobattiston.it>
Date: Wed Dec 21 16:46:25 2011 +0100
Imported upstream patch to floats in test
---
debian/patches/0003-Fix-test-for-Python-2.7.patch | 128 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 129 insertions(+)
diff --git a/debian/patches/0003-Fix-test-for-Python-2.7.patch b/debian/patches/0003-Fix-test-for-Python-2.7.patch
new file mode 100644
index 0000000..373bd0d
--- /dev/null
+++ b/debian/patches/0003-Fix-test-for-Python-2.7.patch
@@ -0,0 +1,128 @@
+From: Pietro Battiston <me at pietrobattiston.it>
+Date: Wed, 21 Dec 2011 16:24:15 +0100
+Subject: Fix test for Python 2.7
+
+Imported 07f651929f025a0cab7020038e2ff235c85804c7 from upstream, to cope with
+new floats representation.
+
+Forwarded: not-needed
+Author: Sean Gillies <sean.gillies at gmail.com>
+
+---
+ shapely/tests/MultiPolygon.txt | 16 ++++++++--------
+ shapely/tests/Point.txt | 4 ++--
+ shapely/tests/Polygon.txt | 6 +++---
+ 3 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/shapely/tests/MultiPolygon.txt b/shapely/tests/MultiPolygon.txt
+index 8b8723a..376ddb6 100644
+--- a/shapely/tests/MultiPolygon.txt
++++ b/shapely/tests/MultiPolygon.txt
+@@ -9,23 +9,23 @@ Initialization
+ From coordinate tuples
+
+ >>> geom = MultiPolygon( [
+- ... (((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0)), [((0.1,0.1), (0.1,0.2), (0.2,0.2), (0.2,0.1))])
++ ... (((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0)), [((0.25,0.25), (0.25,0.5), (0.5,0.5), (0.5,0.25))])
+ ... ] )
+ >>> geom # doctest: +ELLIPSIS
+ <shapely.geometry.multipolygon.MultiPolygon object at ...>
+ >>> len(geom.geoms)
+ 1
+ >>> geom.wkt
+- 'MULTIPOLYGON (((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.1000000000000000 0.1000000000000000, 0.1000000000000000 0.2000000000000000, 0.2000000000000000 0.2000000000000000, 0.2000000000000000 0.1000000000000000, 0.1000000000000000 0.1000000000000000)))'
++ 'MULTIPOLYGON (((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.2500000000000000 0.2500000000000000, 0.2500000000000000 0.5000000000000000, 0.5000000000000000 0.5000000000000000, 0.5000000000000000 0.2500000000000000, 0.2500000000000000 0.2500000000000000)))'
+
+ Or from polygons
+
+- >>> p = Polygon(((0, 0), (0, 1), (1, 1), (1, 0)), [((0.1,0.1), (0.1,0.2), (0.2,0.2), (0.2,0.1))])
++ >>> p = Polygon(((0, 0), (0, 1), (1, 1), (1, 0)), [((0.25,0.25), (0.25,0.5), (0.5,0.5), (0.5,0.25))])
+ >>> geom = MultiPolygon([p])
+ >>> len(geom.geoms)
+ 1
+ >>> print geom.wkt
+- MULTIPOLYGON (((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.1000000000000000 0.1000000000000000, 0.1000000000000000 0.2000000000000000, 0.2000000000000000 0.2000000000000000, 0.2000000000000000 0.1000000000000000, 0.1000000000000000 0.1000000000000000)))
++ MULTIPOLYGON (((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.2500000000000000 0.2500000000000000, 0.2500000000000000 0.5000000000000000, 0.5000000000000000 0.5000000000000000, 0.5000000000000000 0.2500000000000000, 0.2500000000000000 0.2500000000000000)))
+
+ Or from another multi-polygon
+
+@@ -33,7 +33,7 @@ Or from another multi-polygon
+ >>> len(geom2.geoms)
+ 1
+ >>> print geom2.wkt
+- MULTIPOLYGON (((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.1000000000000000 0.1000000000000000, 0.1000000000000000 0.2000000000000000, 0.2000000000000000 0.2000000000000000, 0.2000000000000000 0.1000000000000000, 0.1000000000000000 0.1000000000000000)))
++ MULTIPOLYGON (((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.2500000000000000 0.2500000000000000, 0.2500000000000000 0.5000000000000000, 0.5000000000000000 0.5000000000000000, 0.5000000000000000 0.2500000000000000, 0.2500000000000000 0.2500000000000000)))
+
+ Sub-geometry Access
+ -------------------
+@@ -41,7 +41,7 @@ Sub-geometry Access
+ >>> geom.geoms[0] # doctest: +ELLIPSIS
+ <shapely.geometry.polygon.Polygon object at ...>
+ >>> geom.geoms[0].wkt
+- 'POLYGON ((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.1000000000000000 0.1000000000000000, 0.1000000000000000 0.2000000000000000, 0.2000000000000000 0.2000000000000000, 0.2000000000000000 0.1000000000000000, 0.1000000000000000 0.1000000000000000))'
++ 'POLYGON ((0.0000000000000000 0.0000000000000000, 0.0000000000000000 1.0000000000000000, 1.0000000000000000 1.0000000000000000, 1.0000000000000000 0.0000000000000000, 0.0000000000000000 0.0000000000000000), (0.2500000000000000 0.2500000000000000, 0.2500000000000000 0.5000000000000000, 0.5000000000000000 0.5000000000000000, 0.5000000000000000 0.2500000000000000, 0.2500000000000000 0.2500000000000000))'
+ >>> geom.geoms[1]
+ Traceback (most recent call last):
+ ...
+@@ -51,14 +51,14 @@ Geo interface
+ -------------
+
+ >>> geom.__geo_interface__
+- {'type': 'MultiPolygon', 'coordinates': [[((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)), ((0.10000000000000001, 0.10000000000000001), (0.10000000000000001, 0.20000000000000001), (0.20000000000000001, 0.20000000000000001), (0.20000000000000001, 0.10000000000000001), (0.10000000000000001, 0.10000000000000001))]]}
++ {'type': 'MultiPolygon', 'coordinates': [[((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)), ((0.25, 0.25), (0.25, 0.5), (0.5, 0.5), (0.5, 0.25), (0.25, 0.25))]]}
+
+ Adapter
+ -------
+
+ >>> from shapely.geometry import asMultiPolygon
+ >>> coords = ((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0))
+- >>> holes_coords = [((0.1,0.1), (0.1,0.2), (0.2,0.2), (0.2,0.1))]
++ >>> holes_coords = [((0.25,0.25), (0.25,0.5), (0.5,0.5), (0.5,0.25))]
+ >>> mpa = asMultiPolygon([(coords, holes_coords)])
+ >>> len(mpa.geoms)
+ 1
+diff --git a/shapely/tests/Point.txt b/shapely/tests/Point.txt
+index 2325afe..7ef16cb 100644
+--- a/shapely/tests/Point.txt
++++ b/shapely/tests/Point.txt
+@@ -121,8 +121,8 @@ Adapter
+ >>> coords[0] = 1.0
+ >>> pa.wkt
+ 'POINT (1.0000000000000000 4.0000000000000000)'
+- >>> pa.distance(p)
+- 4.1231056256176606
++ >>> '%.10f' % pa.distance(p)
++ '4.1231056256'
+
+ Now, the inverse
+
+diff --git a/shapely/tests/Polygon.txt b/shapely/tests/Polygon.txt
+index 4a9e5dd..93721b5 100644
+--- a/shapely/tests/Polygon.txt
++++ b/shapely/tests/Polygon.txt
+@@ -77,7 +77,7 @@ Ring Access
+ Interior rings (holes)
+ ----------------------
+
+- >>> polygon = Polygon(coords, [((0.1,0.1), (0.1,0.2), (0.2,0.2), (0.2,0.1))])
++ >>> polygon = Polygon(coords, [((0.25,0.25), (0.25,0.5), (0.5,0.5), (0.5,0.25))])
+ >>> len(polygon.exterior.coords)
+ 5
+ >>> len(polygon.interiors[0].coords)
+@@ -103,13 +103,13 @@ Geo interface
+ -------------
+
+ >>> polygon.__geo_interface__
+- {'type': 'Polygon', 'coordinates': (((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (2.0, -1.0), (0.0, 0.0)), ((0.10000000000000001, 0.10000000000000001), (0.10000000000000001, 0.20000000000000001), (0.20000000000000001, 0.20000000000000001), (0.20000000000000001, 0.10000000000000001), (0.10000000000000001, 0.10000000000000001)))}
++ {'type': 'Polygon', 'coordinates': (((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (2.0, -1.0), (0.0, 0.0)), ((0.25, 0.25), (0.25, 0.5), (0.5, 0.5), (0.5, 0.25), (0.25, 0.25)))}
+
+
+ Adapter
+ -------
+
+- >>> hole_coords = [((0.1,0.1), (0.1,0.2), (0.2,0.2), (0.2,0.1))]
++ >>> hole_coords = [((0.25,0.25), (0.25,0.5), (0.5,0.5), (0.5,0.25))]
+ >>> from shapely.geometry import asPolygon
+ >>> pa = asPolygon(coords, hole_coords)
+ >>> len(pa.exterior.coords)
+--
diff --git a/debian/patches/series b/debian/patches/series
index 061fed7..ba0b5f5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-disable-broken-locale-test.patch
0002-rerun-cython.patch
+0003-Fix-test-for-Python-2.7.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/python-shapely.git
More information about the Pkg-grass-devel
mailing list