[Git][debian-gis-team/python-pyproj][master] 3 commits: Add upstream patches for PROJ 6.3.x support.
Bas Couwenberg
gitlab at salsa.debian.org
Wed Feb 19 19:18:39 GMT 2020
Bas Couwenberg pushed to branch master at Debian GIS Project / python-pyproj
Commits:
49b78b3c by Bas Couwenberg at 2020-02-19T19:19:46+01:00
Add upstream patches for PROJ 6.3.x support.
- - - - -
f1938709 by Bas Couwenberg at 2020-02-19T20:09:52+01:00
Add patch to fix test failure with PROJ 7.0.0.
- - - - -
99ff007c by Bas Couwenberg at 2020-02-19T20:10:07+01:00
Set distribution to unstable.
- - - - -
5 changed files:
- debian/changelog
- debian/patches/proj-6.3.0.patch
- + debian/patches/proj-6.3.1.patch
- + debian/patches/proj-7.0.0.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+python-pyproj (2.4.2+ds-4) unstable; urgency=medium
+
+ * Add upstream patches for PROJ 6.3.x support.
+ * Add patch to fix test failure with PROJ 7.0.0.
+
+ -- Bas Couwenberg <sebastic at debian.org> Wed, 19 Feb 2020 20:09:53 +0100
+
python-pyproj (2.4.2+ds-3) unstable; urgency=medium
* Drop Name field from upstream metadata.
=====================================
debian/patches/proj-6.3.0.patch
=====================================
@@ -1,50 +1,248 @@
-Description: Mark tests that fail with PROJ 6.3.0.
-Author: Bas Couwenberg <sebastic at debian.org>
-Bug-Debian: https://bugs.debian.org/950660
+Description: Add support for PROJ 6.3.0.
+Author: "Alan D. Snow" <alansnow21 at gmail.com>
+Origin: https://github.com/pyproj4/pyproj/commit/82f01bdcd0cabd4a43b956db66c4b50d2c3351fb
+--- a/pyproj/crs.py
++++ b/pyproj/crs.py
+@@ -247,130 +247,6 @@ class CRS(_CRS):
+ LENGTHUNIT["metre",1],
+ ID["EPSG",8807]],
+ ID["EPSG",16015]]
+- >>> print(crs_utm.to_json(pretty=True))
+- {
+- "$schema": "https://proj.org/schemas/v0.1/projjson.schema.json",
+- "type": "ProjectedCRS",
+- "name": "NAD83 / UTM zone 15N",
+- "base_crs": {
+- "name": "NAD83",
+- "datum": {
+- "type": "GeodeticReferenceFrame",
+- "name": "North American Datum 1983",
+- "ellipsoid": {
+- "name": "GRS 1980",
+- "semi_major_axis": 6378137,
+- "inverse_flattening": 298.257222101
+- }
+- },
+- "coordinate_system": {
+- "subtype": "ellipsoidal",
+- "axis": [
+- {
+- "name": "Geodetic latitude",
+- "abbreviation": "Lat",
+- "direction": "north",
+- "unit": "degree"
+- },
+- {
+- "name": "Geodetic longitude",
+- "abbreviation": "Lon",
+- "direction": "east",
+- "unit": "degree"
+- }
+- ]
+- },
+- "id": {
+- "authority": "EPSG",
+- "code": 4269
+- }
+- },
+- "conversion": {
+- "name": "UTM zone 15N",
+- "method": {
+- "name": "Transverse Mercator",
+- "id": {
+- "authority": "EPSG",
+- "code": 9807
+- }
+- },
+- "parameters": [
+- {
+- "name": "Latitude of natural origin",
+- "value": 0,
+- "unit": "degree",
+- "id": {
+- "authority": "EPSG",
+- "code": 8801
+- }
+- },
+- {
+- "name": "Longitude of natural origin",
+- "value": -93,
+- "unit": "degree",
+- "id": {
+- "authority": "EPSG",
+- "code": 8802
+- }
+- },
+- {
+- "name": "Scale factor at natural origin",
+- "value": 0.9996,
+- "unit": "unity",
+- "id": {
+- "authority": "EPSG",
+- "code": 8805
+- }
+- },
+- {
+- "name": "False easting",
+- "value": 500000,
+- "unit": "metre",
+- "id": {
+- "authority": "EPSG",
+- "code": 8806
+- }
+- },
+- {
+- "name": "False northing",
+- "value": 0,
+- "unit": "metre",
+- "id": {
+- "authority": "EPSG",
+- "code": 8807
+- }
+- }
+- ]
+- },
+- "coordinate_system": {
+- "subtype": "Cartesian",
+- "axis": [
+- {
+- "name": "Easting",
+- "abbreviation": "E",
+- "direction": "east",
+- "unit": "metre"
+- },
+- {
+- "name": "Northing",
+- "abbreviation": "N",
+- "direction": "north",
+- "unit": "metre"
+- }
+- ]
+- },
+- "area": "North America - 96°W to 90°W and NAD83 by country",
+- "bbox": {
+- "south_latitude": 25.61,
+- "west_longitude": -96,
+- "north_latitude": 84,
+- "east_longitude": -90
+- },
+- "id": {
+- "authority": "EPSG",
+- "code": 26915
+- }
+- }
+ >>> crs = CRS(proj='utm', zone=10, ellps='WGS84')
+ >>> print(crs.to_wkt(pretty=True))
+ PROJCRS["unknown",
+--- a/pyproj/transformer.py
++++ b/pyproj/transformer.py
+@@ -736,23 +736,6 @@ def transform(
+ >>> xy = lons+lats
+ >>> '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy
+ ' -92.220 -94.720 -90.370 38.830 39.320 38.750'
+- >>> # test datum shifting, installation of extra datum grid files.
+- >>> p1 = Proj(proj='latlong',datum='WGS84')
+- >>> x1 = -111.5; y1 = 45.25919444444
+- >>> p2 = Proj(proj="utm",zone=10,datum='NAD27', preserve_units=False)
+- >>> x2, y2 = transform(p1, p2, x1, y1)
+- >>> "%s %s" % (str(x2)[:9],str(y2)[:9])
+- '1402291.0 5076289.5'
+- >>> from pyproj import CRS
+- >>> c1 = CRS(proj='latlong',datum='WGS84')
+- >>> x1 = -111.5; y1 = 45.25919444444
+- >>> c2 = CRS(proj="utm",zone=10,datum='NAD27')
+- >>> x2, y2 = transform(c1, c2, x1, y1)
+- >>> "%s %s" % (str(x2)[:9],str(y2)[:9])
+- '1402291.0 5076289.5'
+- >>> xeq, yeq = transform(4326, 4326, 30, 60, skip_equivalent=True)
+- >>> "%.0f %.0f" % (xeq, yeq)
+- '30 60'
+ """
+ return Transformer.from_proj(
+ p1, p2, skip_equivalent=skip_equivalent, always_xy=always_xy
+--- a/test/test_crs.py
++++ b/test/test_crs.py
+@@ -895,10 +895,6 @@ def test_to_dict_no_proj4():
+ )
+ if LooseVersion(proj_version_str) >= LooseVersion("6.3.0"):
+ with pytest.warns(UserWarning):
+- assert crs.to_proj4() == (
+- "+proj=ob_tran +o_proj=longlat +lon_0=-10 +o_lat_p=30 "
+- "+o_lon_p=0 +R=6371229 +no_defs +type=crs"
+- )
+ assert crs.to_dict() == {
+ "R": 6371229,
+ "lon_0": -10,
--- a/test/test_datum.py
+++ b/test/test_datum.py
-@@ -1,8 +1,10 @@
- from numpy.testing import assert_almost_equal
+@@ -1,12 +1,20 @@
++from distutils.version import LooseVersion
++
+import pytest
+ from numpy.testing import assert_almost_equal
- from pyproj import Proj, transform
+-from pyproj import Proj, transform
++from pyproj import CRS, Proj, proj_version_str, transform
-+ at pytest.mark.xfail(reason='Fails with PROJ 6.3.0')
- def test_datum(aoi_data_directory):
- p1 = Proj(proj="latlong", datum="WGS84")
+-def test_datum(aoi_data_directory):
+- p1 = Proj(proj="latlong", datum="WGS84")
++ at pytest.mark.parametrize("proj_class", [Proj, CRS])
++def test_datum(proj_class, aoi_data_directory):
++ p1 = proj_class(proj="latlong", datum="WGS84")
s_1 = -111.5
---- a/test/test_doctest_wrapper.py
-+++ b/test/test_doctest_wrapper.py
-@@ -8,9 +8,12 @@ import platform
- import sys
- import warnings
-
-+import pytest
+ s_2 = 45.25919444444
+- p2 = Proj(proj="utm", zone=10, datum="NAD27")
++ p2 = proj_class(proj="utm", zone=10, datum="NAD27")
+ x2, y2 = transform(p1, p2, s_1, s_2)
+- assert_almost_equal((x2, y2), (1402291.0833290431, 5076289.591846835))
++ if LooseVersion(proj_version_str) < LooseVersion("6.3.0"):
++ assert_almost_equal((x2, y2), (1402291.0833290431, 5076289.591846835))
++ else:
++ # https://github.com/OSGeo/PROJ/issues/1808
++ assert_almost_equal((x2, y2), (1402285.9829252, 5076292.4212746))
+--- a/test/test_transform.py
++++ b/test/test_transform.py
+@@ -46,3 +46,8 @@ def test_transform():
+ assert_allclose(numpy.maximum.reduce(numpy.ravel(x3 - x1)), 0, atol=1e-4)
+ assert_allclose(numpy.minimum.reduce(numpy.ravel(y3 - y1)), 0, atol=1e-4)
+ assert_allclose(numpy.maximum.reduce(numpy.ravel(y3 - y1)), 0, atol=1e-4)
+
- import pyproj
-
-
-+ at pytest.mark.xfail(reason='Fails with PROJ 6.3.0')
- def test_doctests(aoi_data_directory):
- """run the examples in the docstrings using the doctest module"""
-
++
++def test_skip_equivalent():
++ xeq, yeq = transform(4326, 4326, 30, 60, skip_equivalent=True)
++ assert (xeq, yeq) == (30, 60)
--- a/test/test_transformer.py
+++ b/test/test_transformer.py
-@@ -258,6 +258,7 @@ def test_transform_no_exception():
- transformer.itransform([(1.716073972, 52.658007833)], errcheck=True)
-
-
-+ at pytest.mark.xfail(reason='Fails with PROJ 6.3.0')
+@@ -261,11 +261,7 @@ def test_transform_no_exception():
def test_transform__out_of_bounds():
with pytest.warns(FutureWarning):
transformer = Transformer.from_proj("+init=epsg:4326", "+init=epsg:27700")
-@@ -487,6 +488,7 @@ def test_transformer__operations_missing
- assert Transformer.from_crs(7789, 8401).operations == ()
+- if LooseVersion(proj_version_str) >= LooseVersion("6.3.0"):
+- with pytest.raises(ProjError):
+- transformer.transform(100000, 100000, errcheck=True)
+- else:
+- assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))
++ assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))
+
+
+ def test_transform_radians():
+@@ -496,13 +492,10 @@ def test_transformer__operations__scope_
+ "GNSS CORS.",
+ None,
+ ]
+- assert [op.remarks for op in transformer.operations] == [
+- None,
+- "Scale difference in ppb where 1/billion = 1E-9. Derivation excluded Cocos, "
+- "Christmas and Macquarie Islands but is applied there. See codes 8444-46 for "
+- "equivalents using NTv2 method. See code 8447 for alternative including "
+- "distortion model for Aus only.",
+- None,
++ assert [str(op.remarks)[:5] for op in transformer.operations] == [
++ "None",
++ "Scale",
++ "None",
+ ]
-+ at pytest.mark.xfail(reason='Fails with PROJ 6.3.0')
- def test_transformer__operations__scope_remarks():
- transformer = Transformer.from_crs(28356, 7856)
- assert transformer.scope is None
=====================================
debian/patches/proj-6.3.1.patch
=====================================
@@ -0,0 +1,18 @@
+Description: Add support for PROJ 6.3.1.
+Author: "Alan D. Snow" <alansnow21 at gmail.com>
+Origin: https://github.com/pyproj4/pyproj/commit/5bd38314c58dd414da034fbe21b290cffa32e4a9
+
+--- a/test/test_transformer.py
++++ b/test/test_transformer.py
+@@ -551,7 +551,10 @@ def test_transform_group__area_of_intere
+
+ def test_transformer_group__get_transform_crs():
+ tg = TransformerGroup("epsg:4258", "epsg:7415")
+- assert len(tg.transformers) == 4
++ if LooseVersion(pyproj.proj_version_str) >= LooseVersion("6.3.1"):
++ assert len(tg.transformers) == 1
++ else:
++ assert len(tg.transformers) == 4
+
+
+ def test_transformer__area_of_interest(aoi_data_directory):
=====================================
debian/patches/proj-7.0.0.patch
=====================================
@@ -0,0 +1,52 @@
+Description: Fix test failure with PROJ 7.0.0.
+Author: Bas Couwenberg <sebastic at debian.org>
+Bug: https://github.com/pyproj4/pyproj/issues/531
+Forwarded: https://github.com/pyproj4/pyproj/issues/531#issuecomment-588394294
+
+--- a/test/test_crs.py
++++ b/test/test_crs.py
+@@ -519,13 +519,22 @@ def test_coordinate_operation_grids__alt
+ cc = CoordinateOperation.from_epsg(1312, True)
+ assert len(cc.grids) == 1
+ grid = cc.grids[0]
+- assert grid.short_name == "ntv1_can.dat"
+- assert grid.full_name.endswith(grid.short_name)
+- assert grid.package_name == "proj-datumgrid"
+- assert grid.url.startswith("https://download.osgeo.org/proj/proj-datumgrid")
+- assert grid.direct_download is True
+- assert grid.open_license is True
+- assert grid.available is True
++ if LooseVersion(proj_version_str) >= LooseVersion("7.0.0"):
++ assert grid.short_name == "ca_nrc_ntv1_can.tif"
++ assert grid.full_name.endswith("ntv1_can.dat")
++ assert grid.package_name == ""
++ assert grid.url == "https://cdn.proj.org/ca_nrc_ntv1_can.tif"
++ assert grid.direct_download is True
++ assert grid.open_license is True
++ assert grid.available is True
++ else:
++ assert grid.short_name == "ntv1_can.dat"
++ assert grid.full_name.endswith(grid.short_name)
++ assert grid.package_name == "proj-datumgrid"
++ assert grid.url.startswith("https://download.osgeo.org/proj/proj-datumgrid")
++ assert grid.direct_download is True
++ assert grid.open_license is True
++ assert grid.available is True
+
+
+ def test_coordinate_operation__missing():
+--- a/test/test_transformer.py
++++ b/test/test_transformer.py
+@@ -261,7 +261,11 @@ def test_transform_no_exception():
+ def test_transform__out_of_bounds():
+ with pytest.warns(FutureWarning):
+ transformer = Transformer.from_proj("+init=epsg:4326", "+init=epsg:27700")
+- assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))
++ if LooseVersion(pyproj.proj_version_str) >= LooseVersion("7.0.0"):
++ with pytest.raises(pyproj.exceptions.ProjError):
++ assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))
++ else:
++ assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))
+
+
+ def test_transform_radians():
=====================================
debian/patches/series
=====================================
@@ -1 +1,3 @@
proj-6.3.0.patch
+proj-6.3.1.patch
+proj-7.0.0.patch
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-pyproj/compare/63ad59b134fca84a23bd0afd858a13e1c18ae604...99ff007c49bdcb86ccdebe17701024c2d096cd58
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-pyproj/compare/63ad59b134fca84a23bd0afd858a13e1c18ae604...99ff007c49bdcb86ccdebe17701024c2d096cd58
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/20200219/523cd4cc/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list