[Git][debian-gis-team/python-pyproj][upstream] New upstream version 2.6.0+ds

Bas Couwenberg gitlab at salsa.debian.org
Wed Mar 18 05:02:22 GMT 2020



Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-pyproj


Commits:
f17a1c36 by Bas Couwenberg at 2020-03-18T05:41:59+01:00
New upstream version 2.6.0+ds
- - - - -


27 changed files:

- .pre-commit-config.yaml
- LICENSE
- Makefile
- + flake8/cython.cfg
- pyproj/__init__.py
- pyproj/_crs.pyx
- pyproj/_datadir.pxd
- pyproj/_datadir.pyx
- pyproj/_geod.pxd
- pyproj/_geod.pyx
- pyproj/_list.pyx
- pyproj/_proj.pyx
- pyproj/_transformer.pyx
- pyproj/compat.py
- pyproj/crs/__init__.py
- pyproj/crs/coordinate_operation.py
- pyproj/crs/coordinate_system.py
- pyproj/crs/crs.py
- pyproj/crs/datum.py
- pyproj/datadir.py
- pyproj/exceptions.py
- pyproj/geod.py
- pyproj/proj.py
- pyproj/transformer.py
- pyproj/utils.py
- setup.py
- test/test_proj.py


Changes:

=====================================
.pre-commit-config.yaml
=====================================
@@ -19,3 +19,15 @@ repos:
         hooks:
         -   id: blacken-docs
             args: [--skip-errors]
+    -   repo: https://gitlab.com/pycqa/flake8
+        rev: 3.7.7
+        hooks:
+        -   id: flake8
+            additional_dependencies: [flake8-comprehensions>=3.1.0]
+            args: [--max-line-length, '88', --ignore, "E225,W503,C408"]
+        -   id: flake8
+            name: flake8-pyx
+            files: \.(pyx|pxd)$
+            types:
+            - file
+            args: [--append-config=flake8/cython.cfg]


=====================================
LICENSE
=====================================
@@ -1,16 +1,19 @@
-Contact:  Jeffrey Whitaker <jeffrey.s.whitaker at noaa.gov
+Copyright (c) 2006-2018, Jeffrey Whitaker.
+Copyright (c) 2019-2020, Open source contributors.
 
-copyright (c) 2013 by Jeffrey Whitaker.
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
 
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both the copyright notice and this permission
-notice appear in supporting documentation. THE AUTHOR DISCLAIMS
-ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
-SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


=====================================
Makefile
=====================================
@@ -62,6 +62,7 @@ clean-cython: ## clean the cython files
 
 lint: ## check style with flake8
 	flake8 --max-line-length 88 setup.py pyproj/ test/ docs/
+	flake8 --append-config=flake8/cython.cfg pyproj/
 
 check-type:
 	mypy pyproj


=====================================
flake8/cython.cfg
=====================================
@@ -0,0 +1,4 @@
+[flake8]
+filename = *.pyx,*.pxd
+max-line-length=88
+select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403,C400,C401,C402,C403,C404,C405,C406,C407,C408,C409,C410,C411


=====================================
pyproj/__init__.py
=====================================
@@ -1,53 +1,34 @@
-# -*- coding: utf-8 -*-
 """
-Cython wrapper to provide python interfaces to
-PROJ (https://proj.org) functions.
-
-Performs cartographic transformations and geodetic computations.
-
-The Proj class can convert from geographic (longitude,latitude)
-to native map projection (x,y) coordinates and vice versa, or
-from one map projection coordinate system directly to another.
-The module variable pj_list is a dictionary containing all the
-available projections and their descriptions.
-
-The Geod class can perform forward and inverse geodetic, or
-Great Circle, computations.  The forward computation involves
-determining latitude, longitude and back azimuth of a terminus
-point given the latitude and longitude of an initial point, plus
-azimuth and distance. The inverse computation involves
-determining the forward and back azimuths and distance given the
-latitudes and longitudes of an initial and terminus point.
-
-Input coordinates can be given as python arrays, lists/tuples,
-scalars or numpy/Numeric/numarray arrays. Optimized for objects
-that support the Python buffer protocol (regular python and
-numpy array objects).
+Python interface to PROJ (https://proj.org),
+cartographic projections and coordinate transformations library.
 
 Download: http://python.org/pypi/pyproj
 
 Requirements: Python 3.5+.
 
-Example scripts are in 'test' subdirectory of source distribution.
-The 'test()' function will run the examples in the docstrings.
+Contact:  Jeffrey Whitaker <jeffrey.s.whitaker at noaa.gov>
+
+Copyright (c) 2006-2018, Jeffrey Whitaker.
+Copyright (c) 2019-2020, Open source contributors.
 
-Contact:  Jeffrey Whitaker <jeffrey.s.whitaker at noaa.gov
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
+Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
 
-copyright (c) 2006 by Jeffrey Whitaker.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both the copyright notice and this permission
-notice appear in supporting documentation. THE AUTHOR DISCLAIMS
-ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
-SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """
-__version__ = "2.6.0rc0"
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"""
+__version__ = "2.6.0"
 __all__ = [
     "Proj",
     "Geod",


=====================================
pyproj/_crs.pyx
=====================================
@@ -530,7 +530,6 @@ cdef class Base:
         return self._is_exact_same(other)
 
 
-
 cdef class _CRSParts(Base):
     @classmethod
     def from_user_input(cls, user_input):
@@ -718,7 +717,9 @@ cdef class CoordinateSystem(_CRSParts):
         -------
         CoordinateSystem
         """
-        return CoordinateSystem.from_json_dict(_load_proj_json(coordinate_system_json_str))
+        return CoordinateSystem.from_json_dict(
+            _load_proj_json(coordinate_system_json_str)
+        )
 
 
 cdef class Ellipsoid(_CRSParts):
@@ -971,7 +972,6 @@ cdef class Ellipsoid(_CRSParts):
         CRSError.clear()
         return Ellipsoid.create(context, ellipsoid_pj)
 
-
     @staticmethod
     def from_name(
         ellipsoid_name,
@@ -1269,7 +1269,6 @@ cdef class PrimeMeridian(_CRSParts):
         return PrimeMeridian.create(context, prime_meridian_pj)
 
 
-
 _DATUM_TYPE_MAP = {
     PJ_TYPE_GEODETIC_REFERENCE_FRAME: "Geodetic Reference Frame",
     PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME: "Dynamic Geodetic Reference Frame",
@@ -1280,9 +1279,11 @@ _DATUM_TYPE_MAP = {
 
 _PJ_DATUM_TYPE_MAP = {
     DatumType.GEODETIC_REFERENCE_FRAME: PJ_TYPE_GEODETIC_REFERENCE_FRAME,
-    DatumType.DYNAMIC_GEODETIC_REFERENCE_FRAME: PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME,
+    DatumType.DYNAMIC_GEODETIC_REFERENCE_FRAME:
+    PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME,
     DatumType.VERTICAL_REFERENCE_FRAME: PJ_TYPE_VERTICAL_REFERENCE_FRAME,
-    DatumType.DYNAMIC_VERTICAL_REFERENCE_FRAME: PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME,
+    DatumType.DYNAMIC_VERTICAL_REFERENCE_FRAME:
+    PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME,
     DatumType.DATUM_ENSEMBLE: PJ_TYPE_DATUM_ENSEMBLE,
 }
 
@@ -1732,8 +1733,9 @@ cdef class Param:
 
     def __repr__(self):
         return ("Param(name={name}, auth_name={auth_name}, code={code}, "
-                "value={value}, unit_name={unit_name}, unit_auth_name={unit_auth_name}, "
-                "unit_code={unit_code}, unit_category={unit_category})").format(
+                "value={value}, unit_name={unit_name}, "
+                "unit_auth_name={unit_auth_name}, unit_code={unit_code}, "
+                "unit_category={unit_category})").format(
             name=self.name,
             auth_name=self.auth_name,
             code=self.code,
@@ -1745,7 +1747,6 @@ cdef class Param:
         )
 
 
-
 cdef class Grid:
     """
     .. versionadded:: 2.2.0
@@ -1815,8 +1816,9 @@ cdef class Grid:
         return self.full_name
 
     def __repr__(self):
-        return ("Grid(short_name={short_name}, full_name={full_name}, package_name={package_name}, "
-                "url={url}, direct_download={direct_download}, open_license={open_license}, "
+        return ("Grid(short_name={short_name}, full_name={full_name}, "
+                "package_name={package_name}, url={url}, "
+                "direct_download={direct_download}, open_license={open_license}, "
                 "available={available})").format(
             short_name=self.short_name,
             full_name=self.full_name,
@@ -1840,7 +1842,8 @@ _PJ_COORDINATE_OPERATION_TYPE_MAP = {
     CoordinateOperationType.CONVERSION: PJ_TYPE_CONVERSION,
     CoordinateOperationType.TRANSFORMATION: PJ_TYPE_TRANSFORMATION,
     CoordinateOperationType.CONCATENATED_OPERATION: PJ_TYPE_CONCATENATED_OPERATION,
-    CoordinateOperationType.OTHER_COORDINATE_OPERATION: PJ_TYPE_OTHER_COORDINATE_OPERATION,
+    CoordinateOperationType.OTHER_COORDINATE_OPERATION:
+    PJ_TYPE_OTHER_COORDINATE_OPERATION,
 }
 
 cdef class CoordinateOperation(_CRSParts):
@@ -1884,7 +1887,8 @@ cdef class CoordinateOperation(_CRSParts):
 
     def __init__(self):
         raise RuntimeError(
-            "CoordinateOperation can only be initialized like 'CoordinateOperation.from_*()'."
+            "CoordinateOperation can only be initialized like "
+            "CoordinateOperation.from_*()'."
         )
 
     @staticmethod
@@ -2589,7 +2593,7 @@ cdef class _CRS(Base):
             try:
                 self._sub_crs_list.append(_CRS(_to_wkt(self.context, projobj)))
             finally:
-                proj_destroy(projobj) # deallocate temp proj
+                proj_destroy(projobj)  # deallocate temp proj
             iii += 1
             projobj = proj_crs_get_sub_crs(
                 self.context,
@@ -2620,7 +2624,7 @@ cdef class _CRS(Base):
         try:
             self._geodetic_crs = _CRS(_to_wkt(self.context, projobj))
         finally:
-            proj_destroy(projobj) # deallocate temp proj
+            proj_destroy(projobj)  # deallocate temp proj
         return self._geodetic_crs
 
     def to_proj4(self, version=ProjVersion.PROJ_4):
@@ -2629,7 +2633,8 @@ cdef class _CRS(Base):
 
         .. warning:: You will likely lose important projection
           information when converting to a PROJ string from
-          another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
+          another format. See:
+          https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems  # noqa: E501
 
         Parameters
         ----------
@@ -2742,7 +2747,7 @@ cdef class _CRS(Base):
             user_auth_name = b_auth_name
 
         try:
-            proj_list  = proj_identify(
+            proj_list = proj_identify(
                 self.context,
                 self.projobj,
                 user_auth_name,
@@ -2759,7 +2764,11 @@ cdef class _CRS(Base):
             CRSError.clear()
 
         # check to make sure that the projection found is valid
-        if proj_list == NULL or num_proj_objects <= 0 or out_confidence < min_confidence:
+        if (
+            proj_list == NULL
+            or num_proj_objects <= 0
+            or out_confidence < min_confidence
+        ):
             if proj_list != NULL:
                 proj_list_destroy(proj_list)
             return None


=====================================
pyproj/_datadir.pxd
=====================================
@@ -1,6 +1,8 @@
 include "proj.pxi"
 
-cdef void pyproj_context_initialize(PJ_CONTEXT* context, bint free_context_on_error) except *
+cdef void pyproj_context_initialize(
+    PJ_CONTEXT* context,
+    bint free_context_on_error) except *
 
 cdef class ContextManager:
     cdef PJ_CONTEXT *context


=====================================
pyproj/_datadir.pyx
=====================================
@@ -30,7 +30,10 @@ cdef void set_context_data_dir(PJ_CONTEXT* context) except *:
         free(c_data_dir)
 
 
-cdef void pyproj_context_initialize(PJ_CONTEXT* context, bint free_context_on_error) except *:
+cdef void pyproj_context_initialize(
+    PJ_CONTEXT* context,
+    bint free_context_on_error,
+) except *:
     """
     Setup the context for pyproj
     """
@@ -41,7 +44,7 @@ cdef void pyproj_context_initialize(PJ_CONTEXT* context, bint free_context_on_er
         set_context_data_dir(context)
     except DataDirError:
         if free_context_on_error and context != NULL:
-             proj_context_destroy(context)
+            proj_context_destroy(context)
         raise
 
 


=====================================
pyproj/_geod.pxd
=====================================
@@ -1,28 +1,52 @@
 cdef extern from "geodesic.h":
-  struct geod_geodesic:
+    struct geod_geodesic:
         pass
-  struct geod_geodesicline:
+    struct geod_geodesicline:
         pass
-  void geod_init(geod_geodesic* g, double a, double f)
-  void geod_direct(geod_geodesic* g,
-              double lat1, double lon1, double azi1, double s12,
-              double* plat2, double* plon2, double* pazi2) nogil
-  void geod_inverse(geod_geodesic* g,
-               double lat1, double lon1, double lat2, double lon2,
-               double* ps12, double* pazi1, double* pazi2) nogil
-  void geod_lineinit(geod_geodesicline* l,
-               geod_geodesic* g,
-               double lat1, double lon1, double azi1, unsigned caps) nogil
-  void geod_position(geod_geodesicline* l, double s12,
-               double* plat2, double* plon2, double* pazi2) nogil
-  void geod_polygonarea(geod_geodesic* g,
-                        double lats[], double lons[], int n,
-                        double* pA, double* pP) nogil
+    void geod_init(geod_geodesic* g, double a, double f)
+    void geod_direct(
+        geod_geodesic* g,
+        double lat1,
+        double lon1,
+        double azi1,
+        double s12,
+        double* plat2,
+        double* plon2,
+        double* pazi2) nogil
+    void geod_inverse(
+        geod_geodesic* g,
+        double lat1,
+        double lon1,
+        double lat2,
+        double lon2,
+        double* ps12,
+        double* pazi1,
+        double* pazi2) nogil
+    void geod_lineinit(
+        geod_geodesicline* l,
+        geod_geodesic* g,
+        double lat1,
+        double lon1,
+        double azi1,
+        unsigned caps) nogil
+    void geod_position(
+        geod_geodesicline* l,
+        double s12,
+        double* plat2,
+        double* plon2,
+        double* pazi2) nogil
+    void geod_polygonarea(
+        geod_geodesic* g,
+        double lats[],
+        double lons[],
+        int n,
+        double* pA,
+        double* pP) nogil
 
-  cdef enum:
-      GEODESIC_VERSION_MAJOR
-      GEODESIC_VERSION_MINOR
-      GEODESIC_VERSION_PATCH
+    cdef enum:
+        GEODESIC_VERSION_MAJOR
+        GEODESIC_VERSION_MINOR
+        GEODESIC_VERSION_PATCH
 
 
 cdef class Geod:


=====================================
pyproj/_geod.pyx
=====================================
@@ -26,11 +26,18 @@ cdef class Geod:
 
     def __reduce__(self):
         """special method that allows pyproj.Geod instance to be pickled"""
-        return self.__class__,(self.initstring,)
+        return self.__class__, (self.initstring,)
 
     @cython.boundscheck(False)
     @cython.wraparound(False)
-    def _fwd(self, object lons, object lats, object az, object dist, bint radians=False):
+    def _fwd(
+        self,
+        object lons,
+        object lats,
+        object az,
+        object dist,
+        bint radians=False,
+    ):
         """
         forward transformation - determine longitude, latitude and back azimuth
         of a terminus point given an initial point longitude and latitude, plus
@@ -60,8 +67,16 @@ cdef class Geod:
                     lat1 = _RAD2DG * latbuff.data[iii]
                     az1 = _RAD2DG * azbuff.data[iii]
                     s12 = distbuff.data[iii]
-                geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\
-                    &plat2, &plon2, &pazi2)
+                geod_direct(
+                    &self._geod_geodesic,
+                    lat1,
+                    lon1,
+                    az1,
+                    s12,
+                    &plat2,
+                    &plon2,
+                    &pazi2,
+                )
                 # back azimuth needs to be flipped 180 degrees
                 # to match what PROJ geod utility produces.
                 if pazi2 > 0:
@@ -79,7 +94,14 @@ cdef class Geod:
 
     @cython.boundscheck(False)
     @cython.wraparound(False)
-    def _inv(self, object lons1, object lats1, object lons2, object lats2, bint radians=False):
+    def _inv(
+        self,
+        object lons1,
+        object lats1,
+        object lons2,
+        object lats2,
+        bint radians=False,
+    ):
         """
         inverse transformation - return forward and back azimuths, plus distance
         between an initial and terminus lat/lon pair.
@@ -130,13 +152,28 @@ cdef class Geod:
 
     @cython.boundscheck(False)
     @cython.wraparound(False)
-    def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, bint radians=False):
+    def _npts(
+        self,
+        double lon1,
+        double lat1,
+        double lon2,
+        double lat2,
+        int npts,
+        bint radians=False,
+    ):
         """
         given initial and terminus lat/lon, find npts intermediate points.
         """
         cdef Py_ssize_t iii
-        cdef double del_s,ps12,pazi1,pazi2,s12,plon2,plat2
+        cdef double del_s
+        cdef double ps12
+        cdef double pazi1
+        cdef double pazi2
+        cdef double s12
+        cdef double plon2
+        cdef double plat2
         cdef geod_geodesicline line
+
         if radians:
             lon1 = _RAD2DG * lon1
             lat1 = _RAD2DG * lat1
@@ -278,7 +315,6 @@ cdef class Geod:
             )
         return (polygon_area, polygon_perimeter)
 
-
     def __repr__(self):
         return "{classname}({init!r})".format(
             classname=self.__class__.__name__,


=====================================
pyproj/_list.pyx
=====================================
@@ -7,6 +7,7 @@ from pyproj.compat import cstrencode, pystrdecode
 from pyproj.enums import PJType
 from pyproj._datadir cimport pyproj_context_initialize
 
+
 def get_proj_operations_map():
     """
     Returns
@@ -163,6 +164,7 @@ PJ_TYPE_MAP = {
     PJType.OTHER_COORDINATE_OPERATION: PJ_TYPE_OTHER_COORDINATE_OPERATION,
 }
 
+
 def get_codes(auth_name, pj_type, allow_deprecated=False):
     """
     .. versionadded:: 2.4.0


=====================================
pyproj/_proj.pyx
=====================================
@@ -18,7 +18,8 @@ proj_version_str = "{0}.{1}.{2}".format(
 )
 
 
-Factors = namedtuple("Factors",
+Factors = namedtuple(
+    "Factors",
     [
         "meridional_scale",
         "parallel_scale",
@@ -32,14 +33,14 @@ Factors = namedtuple("Factors",
         "dx_dphi",
         "dy_dlam",
         "dy_dphi",
-    ]
+    ],
 )
 Factors.__doc__ = """
 .. versionadded:: 2.6.0
 
 These are the scaling and angular distortion factors.
 
-See `PJ_FACTORS documentation <https://proj.org/development/reference/datatypes.html?highlight=pj_factors#c.PJ_FACTORS>`__
+See `PJ_FACTORS documentation <https://proj.org/development/reference/datatypes.html?highlight=pj_factors#c.PJ_FACTORS>`__  # noqa
 
 Parameters
 ----------
@@ -107,9 +108,9 @@ cdef class _Proj:
     def _fwd(self, object lons, object lats, bint errcheck=False):
         """
         forward transformation - lons,lats to x,y (done in place).
-        if errcheck=True, an exception is raised if the forward transformation is invalid.
-        if errcheck=False and the forward transformation is invalid, no exception is
-        raised and 'inf' is returned.
+        if errcheck=True, an exception is raised if the forward
+        transformation is invalid. if errcheck=False and the forward
+        transformation is invalid, no exception is raised and 'inf' is returned.
         """
         cdef PyBuffWriteManager lonbuff = PyBuffWriteManager(lons)
         cdef PyBuffWriteManager latbuff = PyBuffWriteManager(lats)
@@ -127,7 +128,10 @@ cdef class _Proj:
             proj_errno_reset(self.projobj)
             for iii in range(latbuff.len):
                 # if inputs are nan's, return big number.
-                if lonbuff.data[iii] != lonbuff.data[iii] or latbuff.data[iii] != latbuff.data[iii]:
+                if (
+                    lonbuff.data[iii] != lonbuff.data[iii]
+                    or latbuff.data[iii] != latbuff.data[iii]
+                ):
                     lonbuff.data[iii] = HUGE_VAL
                     latbuff.data[iii] = HUGE_VAL
                     if errcheck:
@@ -169,14 +173,14 @@ cdef class _Proj:
                     latbuff.data[iii] = projxyout.xy.y
         ProjError.clear()
 
-
     @cython.boundscheck(False)
     @cython.wraparound(False)
     def _inv(self, object xx, object yy, bint errcheck=False):
         """
         inverse transformation - x,y to lons,lats (done in place).
-        if errcheck=True, an exception is raised if the inverse transformation is invalid.
-        if errcheck=False and the inverse transformation is invalid, no exception is
+        if errcheck=True, an exception is raised if the inverse
+        transformation is invalid. if errcheck=False and the
+        inverse transformation is invalid, no exception is
         raised and 'inf' is returned.
         """
         if not self.has_inverse:
@@ -199,7 +203,10 @@ cdef class _Proj:
             proj_errno_reset(self.projobj)
             for iii in range(xbuff.len):
                 # if inputs are nan's, return big number.
-                if xbuff.data[iii] != xbuff.data[iii] or ybuff.data[iii] != ybuff.data[iii]:
+                if (
+                    xbuff.data[iii] != xbuff.data[iii]
+                    or ybuff.data[iii] != ybuff.data[iii]
+                ):
                     xbuff.data[iii] = HUGE_VAL
                     ybuff.data[iii] = HUGE_VAL
                     if errcheck:
@@ -269,14 +276,21 @@ cdef class _Proj:
         dx_dphi = copy.copy(longitude)
         dy_dlam = copy.copy(longitude)
         dy_dphi = copy.copy(longitude)
-        cdef PyBuffWriteManager meridional_scale_buff = PyBuffWriteManager(meridional_scale)
-        cdef PyBuffWriteManager parallel_scale_buff = PyBuffWriteManager(parallel_scale)
+        cdef PyBuffWriteManager meridional_scale_buff = PyBuffWriteManager(
+            meridional_scale)
+        cdef PyBuffWriteManager parallel_scale_buff = PyBuffWriteManager(
+            parallel_scale)
         cdef PyBuffWriteManager areal_scale_buff = PyBuffWriteManager(areal_scale)
-        cdef PyBuffWriteManager angular_distortion_buff = PyBuffWriteManager(angular_distortion)
-        cdef PyBuffWriteManager meridian_parallel_angle_buff = PyBuffWriteManager(meridian_parallel_angle)
-        cdef PyBuffWriteManager meridian_convergence_buff = PyBuffWriteManager(meridian_convergence)
-        cdef PyBuffWriteManager tissot_semimajor_buff = PyBuffWriteManager(tissot_semimajor)
-        cdef PyBuffWriteManager tissot_semiminor_buff = PyBuffWriteManager(tissot_semiminor)
+        cdef PyBuffWriteManager angular_distortion_buff = PyBuffWriteManager(
+            angular_distortion)
+        cdef PyBuffWriteManager meridian_parallel_angle_buff = PyBuffWriteManager(
+            meridian_parallel_angle)
+        cdef PyBuffWriteManager meridian_convergence_buff = PyBuffWriteManager(
+            meridian_convergence)
+        cdef PyBuffWriteManager tissot_semimajor_buff = PyBuffWriteManager(
+            tissot_semimajor)
+        cdef PyBuffWriteManager tissot_semiminor_buff = PyBuffWriteManager(
+            tissot_semiminor)
         cdef PyBuffWriteManager dx_dlam_buff = PyBuffWriteManager(dx_dlam)
         cdef PyBuffWriteManager dx_dphi_buff = PyBuffWriteManager(dx_dphi)
         cdef PyBuffWriteManager dy_dlam_buff = PyBuffWriteManager(dy_dlam)
@@ -330,9 +344,15 @@ cdef class _Proj:
                     meridional_scale_buff.data[iii] = pj_factors.meridional_scale
                     parallel_scale_buff.data[iii] = pj_factors.parallel_scale
                     areal_scale_buff.data[iii] = pj_factors.areal_scale
-                    angular_distortion_buff.data[iii] = pj_factors.angular_distortion * _RAD2DG
-                    meridian_parallel_angle_buff.data[iii] = pj_factors.meridian_parallel_angle * _RAD2DG
-                    meridian_convergence_buff.data[iii] = pj_factors.meridian_convergence * _RAD2DG
+                    angular_distortion_buff.data[iii] = (
+                        pj_factors.angular_distortion * _RAD2DG
+                    )
+                    meridian_parallel_angle_buff.data[iii] = (
+                        pj_factors.meridian_parallel_angle * _RAD2DG
+                    )
+                    meridian_convergence_buff.data[iii] = (
+                        pj_factors.meridian_convergence * _RAD2DG
+                    )
                     tissot_semimajor_buff.data[iii] = pj_factors.tissot_semimajor
                     tissot_semiminor_buff.data[iii] = pj_factors.tissot_semiminor
                     dx_dlam_buff.data[iii] = pj_factors.dx_dlam


=====================================
pyproj/_transformer.pyx
=====================================
@@ -33,7 +33,8 @@ _TRANSFORMER_TYPE_MAP = {
 }
 
 
-AreaOfInterest = namedtuple("AreaOfInterest",
+AreaOfInterest = namedtuple(
+    "AreaOfInterest",
     ["west_lon_degree", "south_lat_degree", "east_lon_degree", "north_lat_degree"]
 )
 AreaOfInterest.__doc__ = """
@@ -99,7 +100,8 @@ cdef class _TransformerGroup:
             if area_of_interest is not None:
                 if not isinstance(area_of_interest, AreaOfInterest):
                     raise ProjError(
-                        "Area of interest must be of the type pyproj.transformer.AreaOfInterest."
+                        "Area of interest must be of the type "
+                        "pyproj.transformer.AreaOfInterest."
                     )
                 west_lon_degree = area_of_interest.west_lon_degree
                 south_lat_degree = area_of_interest.south_lat_degree
@@ -213,7 +215,7 @@ cdef class _Transformer(Base):
     def _initialize_from_projobj(self):
         self.proj_info = proj_pj_info(self.projobj)
         if self.proj_info.id == NULL:
-             raise ProjError("Input is not a transformation.")
+            raise ProjError("Input is not a transformation.")
         cdef PJ_TYPE transformer_type = proj_get_type(self.projobj)
         self.type_name = _TRANSFORMER_TYPE_MAP[transformer_type]
         self._set_base_info()
@@ -277,13 +279,17 @@ cdef class _Transformer(Base):
         Create a transformer from CRS objects
         """
         cdef PJ_AREA *pj_area_of_interest = NULL
-        cdef double west_lon_degree, south_lat_degree, east_lon_degree, north_lat_degree
+        cdef double west_lon_degree
+        cdef double south_lat_degree
+        cdef double east_lon_degree
+        cdef double north_lat_degree
         cdef _Transformer transformer = _Transformer()
         try:
             if area_of_interest is not None:
                 if not isinstance(area_of_interest, AreaOfInterest):
                     raise ProjError(
-                        "Area of interest must be of the type pyproj.transformer.AreaOfInterest."
+                        "Area of interest must be of the type "
+                        "pyproj.transformer.AreaOfInterest."
                     )
                 pj_area_of_interest = proj_area_create()
                 west_lon_degree = area_of_interest.west_lon_degree
@@ -411,7 +417,10 @@ cdef class _Transformer(Base):
         bint radians,
         bint errcheck,
     ):
-        if self.projections_exact_same or (self.projections_equivalent and self.skip_equivalent):
+        if (
+            self.projections_exact_same
+            or (self.projections_equivalent and self.skip_equivalent)
+        ):
             return
         if radians and self.is_pipeline:
             warnings.warn(
@@ -507,7 +516,10 @@ cdef class _Transformer(Base):
         bint radians,
         bint errcheck,
     ):
-        if self.projections_exact_same or (self.projections_equivalent and self.skip_equivalent):
+        if (
+            self.projections_exact_same
+            or (self.projections_equivalent and self.skip_equivalent)
+        ):
             return
         tmp_pj_direction = _PJ_DIRECTION_MAP[TransformDirection.create(direction)]
         cdef PJ_DIRECTION pj_direction = <PJ_DIRECTION>tmp_pj_direction
@@ -576,7 +588,6 @@ cdef class _Transformer(Base):
         elif errcheck and ProjError.internal_proj_error is not None:
             raise ProjError("itransform error")
 
-
         # radians to degrees
         if not radians and self._output_radians[pj_direction]:
             with nogil:


=====================================
pyproj/compat.py
=====================================
@@ -1,4 +1,6 @@
-# -*- coding: utf-8 -*-
+"""
+This module is for compatibility between string types
+"""
 
 
 def cstrencode(pystr):


=====================================
pyproj/crs/__init__.py
=====================================
@@ -1,10 +1,7 @@
-# -*- coding: utf-8 -*-
 """
 This module interfaces with PROJ to produce a pythonic interface
 to the coordinate reference system (CRS) information through the CRS
 class.
-
-Original Author: Alan D. Snow [github.com/snowman2] (2019)
 """
 
 from pyproj._crs import (  # noqa: F401


=====================================
pyproj/crs/coordinate_operation.py
=====================================
@@ -1,3 +1,9 @@
+"""
+This module is for building operations to be used when
+building a CRS.
+
+https://proj.org/operations/
+"""
 import warnings
 from distutils.version import LooseVersion
 from typing import Any


=====================================
pyproj/crs/coordinate_system.py
=====================================
@@ -1,3 +1,7 @@
+"""
+This module is for building coordinate systems to be used when
+building a CRS.
+"""
 from typing import Union
 
 from pyproj._crs import CoordinateSystem


=====================================
pyproj/crs/crs.py
=====================================
@@ -1,10 +1,6 @@
-# -*- coding: utf-8 -*-
 """
 This module interfaces with PROJ to produce a pythonic interface
 to the coordinate reference system (CRS) information.
-
-Original Author: Alan D. Snow [github.com/snowman2] (2019)
-
 """
 import json
 import re


=====================================
pyproj/crs/datum.py
=====================================
@@ -1,3 +1,7 @@
+"""
+This module is for building datums to be used when
+building a CRS.
+"""
 from typing import Any, Dict, Optional, Union
 
 from pyproj._crs import Datum, Ellipsoid, PrimeMeridian


=====================================
pyproj/datadir.py
=====================================
@@ -1,5 +1,5 @@
 """
-Set the datadir path to the local data directory
+Module for managing the PROJ data directory.
 """
 import os
 import sys


=====================================
pyproj/exceptions.py
=====================================
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
 """
 Exceptions for pyproj
 """


=====================================
pyproj/geod.py
=====================================
@@ -1,9 +1,4 @@
 """
-Cython wrapper to provide python interfaces to
-PROJ (https://proj.org) functions.
-
-Performs geodetic computations.
-
 The Geod class can perform forward and inverse geodetic, or
 Great Circle, computations.  The forward computation involves
 determining latitude, longitude and back azimuth of a terminus
@@ -11,23 +6,7 @@ point given the latitude and longitude of an initial point, plus
 azimuth and distance. The inverse computation involves
 determining the forward and back azimuths and distance given the
 latitudes and longitudes of an initial and terminus point.
-
-Contact:  Jeffrey Whitaker <jeffrey.s.whitaker at noaa.gov
-
-copyright (c) 2006 by Jeffrey Whitaker.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both the copyright notice and this permission
-notice appear in supporting documentation. THE AUTHOR DISCLAIMS
-ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
-SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """
+"""
 
 __all__ = ["Geod", "pj_ellps", "geodesic_version_str"]
 


=====================================
pyproj/proj.py
=====================================
@@ -1,39 +1,19 @@
-# -*- coding: utf-8 -*-
 """
-Cython wrapper to provide python interfaces to
-PROJ (https://proj.org) functions.
-
-Performs cartographic transformations and geodetic computations.
-
-The Proj class can convert from geographic (longitude,latitude)
-to native map projection (x,y) coordinates and vice versa, or
-from one map projection coordinate system directly to another.
-The module variable pj_list is a dictionary containing all the
-available projections and their descriptions.
-
-Input coordinates can be given as python arrays, lists/tuples,
-scalars or numpy/Numeric/numarray arrays. Optimized for objects
-that support the Python buffer protocol (regular python and
-numpy array objects).
-
-Download: http://python.org/pypi/pyproj
-
-Contact:  Jeffrey Whitaker <jeffrey.s.whitaker at noaa.gov
-
-copyright (c) 2006 by Jeffrey Whitaker.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both the copyright notice and this permission
-notice appear in supporting documentation. THE AUTHOR DISCLAIMS
-ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
-SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """
+Performs cartographic transformations (converts from
+longitude,latitude to native map projection x,y coordinates and
+vice versa) using PROJ (https://proj.org).
+
+A Proj class instance is initialized with proj map projection
+control parameter key/value pairs. The key/value pairs can
+either be passed in a dictionary, or as keyword arguments,
+or as a PROJ string (compatible with the proj command). See
+https://proj.org/operations/projections/index.html for examples of
+key/value pairs defining different map projections.
+
+Calling a Proj class instance with the arguments lon, lat will
+convert lon/lat (in degrees) to x/y native map projection
+coordinates (in meters).
+"""
 import re
 import warnings
 from typing import Any, Optional, Tuple, Type
@@ -51,7 +31,7 @@ class Proj(_Proj):
     """
     Performs cartographic transformations (converts from
     longitude,latitude to native map projection x,y coordinates and
-    vice versa) using proj (https://proj.org).
+    vice versa) using PROJ (https://proj.org).
 
     A Proj class instance is initialized with proj map projection
     control parameter key/value pairs. The key/value pairs can


=====================================
pyproj/transformer.py
=====================================
@@ -1,21 +1,6 @@
-# -*- coding: utf-8 -*-
 """
 The transformer module is for performing cartographic transformations.
-
-Copyright (c) 2019 pyproj Contributors.
-
-Permission to use, copy, modify, and distribute this software
-and its documentation for any purpose and without fee is hereby
-granted, provided that the above copyright notice appear in all
-copies and that both the copyright notice and this permission
-notice appear in supporting documentation. THE AUTHOR DISCLAIMS
-ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
-SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."""
+"""
 
 __all__ = [
     "transform",


=====================================
pyproj/utils.py
=====================================
@@ -1,3 +1,6 @@
+"""
+Utility functions used within pyproj
+"""
 from array import array
 from typing import Any, Tuple
 


=====================================
setup.py
=====================================
@@ -149,12 +149,12 @@ def get_extension_modules():
     include_dirs = get_proj_incdirs(proj_dir)
 
     # setup extension options
-    ext_options = dict(
-        include_dirs=include_dirs,
-        library_dirs=library_dirs,
-        runtime_library_dirs=library_dirs if os.name != "nt" else None,
-        libraries=get_libraries(library_dirs),
-    )
+    ext_options = {
+        "include_dirs": include_dirs,
+        "library_dirs": library_dirs,
+        "runtime_library_dirs": library_dirs if os.name != "nt" else None,
+        "libraries": get_libraries(library_dirs),
+    }
     # setup cythonized modules
     return cythonize(
         [
@@ -223,12 +223,11 @@ setup(
     author="Jeff Whitaker",
     author_email="jeffrey.s.whitaker at noaa.gov",
     platforms=["any"],
-    license="OSI Approved",
+    license="MIT",
     keywords=["python", "map projections", "GIS", "mapping", "maps"],
     classifiers=[
         "Development Status :: 4 - Beta",
         "Intended Audience :: Science/Research",
-        "License :: OSI Approved",
         "Programming Language :: Python :: 3",
         "Programming Language :: Python :: 3.5",
         "Programming Language :: Python :: 3.6",


=====================================
test/test_proj.py
=====================================
@@ -33,8 +33,8 @@ class BasicTest(unittest.TestCase):
         )
         awips221_from_dict = Proj(params, preserve_units=False)
 
-        items = sorted([val for val in awips221.crs.srs.split() if val])
-        items_dict = sorted([val for val in awips221_from_dict.crs.srs.split() if val])
+        items = sorted(val for val in awips221.crs.srs.split() if val)
+        items_dict = sorted(val for val in awips221_from_dict.crs.srs.split() if val)
         self.assertEqual(items, items_dict)
 
         expected = sorted(



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-pyproj/-/commit/f17a1c3647a363656dc4ace7a0118fbb8e510b2c

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-pyproj/-/commit/f17a1c3647a363656dc4ace7a0118fbb8e510b2c
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/20200318/792f91f4/attachment-0001.html>


More information about the Pkg-grass-devel mailing list