Skip to content

Commit

Permalink
MNT: Use new Proj name in all non-breaking locations.
Browse files Browse the repository at this point in the history
That is, any comments, documentation, or output, now drops the '4'.
Names in code have not been changed to preserve backwards-compatibility.
  • Loading branch information
QuLogic committed Oct 6, 2018
1 parent d6f1084 commit 39167fb
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -73,7 +73,7 @@ The recipes for these can be found at https://github.com/conda-forge/feedstocks.
**pyshp** 1.1.4 or later (https://pypi.python.org/pypi/pyshp)
Pure Python read/write support for ESRI Shapefile format.

**PROJ.4** 4.9.0 or later (http://proj4.org/)
**PROJ** 4.9.0 or later (https://proj4.org/)
Cartographic Projections library.

**six** 1.3.0 or later (https://pypi.python.org/pypi/six)
Expand Down
2 changes: 1 addition & 1 deletion lib/cartopy/_crs.pxd
Expand Up @@ -22,7 +22,7 @@ cdef extern from "proj_api.h":

cdef class CRS:
"""
Defines a Coordinate Reference System using proj.4.
Defines a Coordinate Reference System using proj.
"""

Expand Down
22 changes: 11 additions & 11 deletions lib/cartopy/_crs.pyx
Expand Up @@ -16,7 +16,7 @@
# along with cartopy. If not, see <https://www.gnu.org/licenses/>.

"""
This module defines the core CRS class which can interface with Proj.4.
This module defines the core CRS class which can interface with Proj.
The CRS class is the base-class for all projections defined in :mod:`cartopy.crs`.
"""
Expand Down Expand Up @@ -70,7 +70,7 @@ class Proj4Error(Exception):
def __init__(self):
cdef int status
status = deref(pj_get_errno_ref())
msg = 'Error from proj.4: {}'.format(pj_strerrno(status))
msg = 'Error from proj: {}'.format(pj_strerrno(status))
self.status = status
Exception.__init__(self, msg)

Expand All @@ -88,9 +88,9 @@ class Globe(object):
Parameters
----------
datum
Proj4 "datum" definition. Defaults to None.
Proj "datum" definition. Defaults to None.
ellipse
Proj4 "ellps" definition. Defaults to 'WGS84'.
Proj "ellps" definition. Defaults to 'WGS84'.
semimajor_axis
Semimajor axis of the spheroid / ellipsoid. Defaults to None.
semiminor_axis
Expand All @@ -100,9 +100,9 @@ class Globe(object):
inverse_flattening
Inverse flattening of the ellipsoid. Defaults to None.
towgs84
Passed through to the Proj4 definition. Defaults to None.
Passed through to the Proj definition. Defaults to None.
nadgrids
Passed through to the Proj4 definition. Defaults to None.
Passed through to the Proj definition. Defaults to None.
"""
self.datum = datum
Expand All @@ -117,7 +117,7 @@ class Globe(object):
def to_proj4_params(self):
"""
Create an OrderedDict of key value pairs which represents this globe
in terms of proj4 params.
in terms of proj params.
"""
proj4_params = (['datum', self.datum], ['ellps', self.ellipse],
Expand All @@ -129,7 +129,7 @@ class Globe(object):

cdef class CRS:
"""
Define a Coordinate Reference System using proj.4.
Define a Coordinate Reference System using proj.
"""
def __cinit__(self):
Expand Down Expand Up @@ -276,8 +276,8 @@ cdef class CRS:
instance of :class:`CRS` that represents the coordinate
system of ``x`` and ``y``.
trap
Whether proj.4 errors for "latitude or longitude exceeded
limits" and "tolerance condition error" should be trapped.
Whether proj errors for "latitude or longitude exceeded limits" and
"tolerance condition error" should be trapped.
Returns
-------
Expand Down Expand Up @@ -376,7 +376,7 @@ cdef class CRS:
else:
result[:, 2] = z

# call proj.4. The result array is modified in place. This is only
# call proj. The result array is modified in place. This is only
# safe if npts is not 0.
if npts:
status = pj_transform(src_crs.proj4, self.proj4, npts, 3,
Expand Down
30 changes: 15 additions & 15 deletions lib/cartopy/crs.py
Expand Up @@ -52,7 +52,7 @@ class RotatedGeodetic(CRS):
Coordinates are measured in degrees.
The class uses proj4 to perform an ob_tran operation, using the
The class uses proj to perform an ob_tran operation, using the
pole_longitude to set a lon_0 then performing two rotations based on
pole_latitude and central_rotated_longitude.
This is equivalent to setting the new pole to a location defined by
Expand Down Expand Up @@ -994,7 +994,7 @@ def __init__(self, central_longitude=0.0,

super(Mercator, self).__init__(proj4_params, globe=globe)

# In new proj.4, using exact limits will wrap-around, so subtract a
# In new proj, using exact limits will wrap-around, so subtract a
# small epsilon:
epsilon = 1e-10
minlon = -180 + central_longitude
Expand Down Expand Up @@ -1276,7 +1276,7 @@ def __init__(self, central_longitude=0.0, globe=None):
b = np.float(globe.semiminor_axis or a)

if b != a or globe.ellipse is not None:
warnings.warn('The proj4 "mill" projection does not handle '
warnings.warn('The proj "mill" projection does not handle '
'elliptical globes.')

proj4_params = [('proj', 'mill'), ('lon_0', central_longitude)]
Expand All @@ -1298,7 +1298,7 @@ class RotatedPole(_CylindricalProjection):
Coordinates are measured in projection metres.
The class uses proj4 to perform an ob_tran operation, using the
The class uses proj to perform an ob_tran operation, using the
pole_longitude to set a lon_0 then performing two rotations based on
pole_latitude and central_rotated_longitude.
This is equivalent to setting the new pole to a location defined by
Expand Down Expand Up @@ -1367,20 +1367,20 @@ def __init__(self, central_latitude=0.0, central_longitude=0.0,
false_easting=0.0, false_northing=0.0,
true_scale_latitude=None,
scale_factor=None, globe=None):
# Warn when using Stereographic with proj4 < 5.0.0 due to
# Warn when using Stereographic with proj < 5.0.0 due to
# incorrect transformation with lon_0=0 (see
# https://github.com/OSGeo/proj.4/issues/194).
if central_latitude == 0:
if PROJ4_VERSION != ():
if PROJ4_VERSION < (5, 0, 0):
warnings.warn(
'The Stereographic projection in Proj.4 older than '
'The Stereographic projection in Proj older than '
'5.0.0 incorrectly transforms points when '
'central_latitude=0. Use this projection with '
'caution.')
else:
warnings.warn(
'Cannot determine Proj.4 version. The Stereographic '
'Cannot determine Proj version. The Stereographic '
'projection may be unreliable and should be used with '
'caution.')

Expand Down Expand Up @@ -1476,7 +1476,7 @@ def __init__(self, central_longitude=0.0, central_latitude=0.0,
b = np.float(self.globe.semiminor_axis or a)

if b != a:
warnings.warn('The proj4 "ortho" projection does not appear to '
warnings.warn('The proj "ortho" projection does not appear to '
'handle elliptical globes.')

# To stabilise the projection of geometries, we reduce the boundary by
Expand Down Expand Up @@ -1509,7 +1509,7 @@ def __init__(self, proj4_params, central_longitude, globe=None):
super(_WarpedRectangularProjection, self).__init__(proj4_params,
globe=globe)

# In new proj.4, using exact limits will wrap-around, so subtract a
# In new proj, using exact limits will wrap-around, so subtract a
# small epsilon:
epsilon = 1.e-10
minlon = -180 + central_longitude
Expand Down Expand Up @@ -1562,17 +1562,17 @@ def threshold(self):

class Robinson(_WarpedRectangularProjection):
def __init__(self, central_longitude=0, globe=None):
# Warn when using Robinson with proj4 4.8 due to discontinuity at
# Warn when using Robinson with proj 4.8 due to discontinuity at
# 40 deg N introduced by incomplete fix to issue #113 (see
# https://github.com/OSGeo/proj.4/issues/113).
if PROJ4_VERSION != ():
if (4, 8) <= PROJ4_VERSION < (4, 9):
warnings.warn('The Robinson projection in the v4.8.x series '
'of Proj.4 contains a discontinuity at '
'of Proj contains a discontinuity at '
'40 deg latitude. Use this projection with '
'caution.')
else:
warnings.warn('Cannot determine Proj.4 version. The Robinson '
warnings.warn('Cannot determine Proj version. The Robinson '
'projection may be unreliable and should be used '
'with caution.')

Expand Down Expand Up @@ -1905,17 +1905,17 @@ def __init__(self, central_longitude=0.0, central_latitude=0.0,
globe is created.
"""
# Warn when using Azimuthal Equidistant with proj4 < 4.9.2 due to
# Warn when using Azimuthal Equidistant with proj < 4.9.2 due to
# incorrect transformation past 90 deg distance (see
# https://github.com/OSGeo/proj.4/issues/246).
if PROJ4_VERSION != ():
if PROJ4_VERSION < (4, 9, 2):
warnings.warn('The Azimuthal Equidistant projection in Proj.4 '
warnings.warn('The Azimuthal Equidistant projection in Proj '
'older than 4.9.2 incorrectly transforms points '
'farther than 90 deg from the origin. Use this '
'projection with caution.')
else:
warnings.warn('Cannot determine Proj.4 version. The Azimuthal '
warnings.warn('Cannot determine Proj version. The Azimuthal '
'Equidistant projection may be unreliable and '
'should be used with caution.')

Expand Down
2 changes: 1 addition & 1 deletion lib/cartopy/geodesic/_geodesic.pyx
Expand Up @@ -16,7 +16,7 @@
# along with cartopy. If not, see <https://www.gnu.org/licenses/>.

"""
This module defines the Geodesic class which can interface with the Proj.4.
This module defines the Geodesic class which can interface with the Proj
geodesic functions.
"""
Expand Down
4 changes: 2 additions & 2 deletions lib/cartopy/tests/crs/test_robinson.py
@@ -1,4 +1,4 @@
# (C) British Crown Copyright 2013 - 2017, Met Office
# (C) British Crown Copyright 2013 - 2018, Met Office
#
# This file is part of cartopy.
#
Expand Down Expand Up @@ -35,7 +35,7 @@
_CRS_PC = ccrs.PlateCarree()
_CRS_ROB = ccrs.Robinson()

# Increase tolerance if using older proj.4 releases
# Increase tolerance if using older proj releases
_TOL = -1 if ccrs.PROJ4_VERSION < (4, 9) else 7


Expand Down
2 changes: 1 addition & 1 deletion lib/cartopy/tests/crs/test_stereographic.py
Expand Up @@ -60,7 +60,7 @@ def test_eccentric_globe(self):
def test_true_scale(self):
# The "true_scale_latitude" parameter only makes sense for
# polar stereographic projections (#339 and #455).
# For now only the proj4 string creation is tested
# For now only the proj string creation is tested
# See test_scale_factor for test on projection.
globe = ccrs.Globe(ellipse='sphere')
stereo = ccrs.NorthPolarStereo(true_scale_latitude=30, globe=globe)
Expand Down
6 changes: 3 additions & 3 deletions lib/cartopy/tests/mpl/test_mpl_integration.py
Expand Up @@ -172,9 +172,9 @@ def test_multiple_projections():
]

if ccrs.PROJ4_VERSION < (5, 0, 0):
# Produce the same sized image for old proj4, to avoid having to
# replace the image. If this figure is regenerated for both old and new
# proj4, then drop this condition.
# Produce the same sized image for old proj, to avoid having to replace
# the image. If this figure is regenerated for both old and new proj,
# then drop this condition.
rows = 5
else:
rows = np.ceil(len(projections) / 5)
Expand Down
4 changes: 2 additions & 2 deletions lib/cartopy/tests/test_crs.py
Expand Up @@ -118,7 +118,7 @@ def test_transform_points_nD(self):
unrotated_lon = res[..., 0]
unrotated_lat = res[..., 1]

# Solutions derived by proj4 direct.
# Solutions derived by proj direct.
solx = np.array([[-16.42176094, -14.85892262, -11.90627520],
[-16.71055023, -14.58434624, -11.68799988]])
soly = np.array([[46.00724251, 51.29188893, 52.59101488],
Expand All @@ -138,7 +138,7 @@ def test_transform_points_1D(self):
unrotated_lon = res[..., 0]
unrotated_lat = res[..., 1]

# Solutions derived by proj4 direct.
# Solutions derived by proj direct.
solx = np.array([-16.42176094, -14.85892262,
-12.88946157, -10.35078336])
soly = np.array([46.00724251, 51.29188893,
Expand Down
8 changes: 4 additions & 4 deletions lib/cartopy/trace.pyx
Expand Up @@ -16,10 +16,10 @@
# along with cartopy. If not, see <https://www.gnu.org/licenses/>.

"""
This module pulls together _trace.cpp, proj.4, GEOS and _crs.pyx to implement a function
to project a LinearRing/LineString. In general, this should never be called manually,
instead leaving the processing to be done by the :class:`cartopy.crs.Projection`
subclasses.
This module pulls together _trace.cpp, proj, GEOS and _crs.pyx to implement a
function to project a LinearRing/LineString. In general, this should never be
called manually, instead leaving the processing to be done by the
:class:`cartopy.crs.Projection` subclasses.
"""

from libc.stdint cimport uintptr_t as ptr
Expand Down
20 changes: 10 additions & 10 deletions setup.py
Expand Up @@ -205,19 +205,19 @@ def _header_bad(self, path):
geos_libraries.append(entry[2:])


# Proj4
# Proj
def find_proj_version_by_program(conda=None):
proj = find_executable('proj')
if proj is None:
print(
'Proj4 %s must be installed.' % (
'Proj %s must be installed.' % (
'.'.join(str(v) for v in PROJ_MIN_VERSION), ),
file=sys.stderr)
exit(1)

if conda is not None and conda not in proj:
print(
'Proj4 %s must be installed in Conda environment "%s".' % (
'Proj %s must be installed in Conda environment "%s".' % (
'.'.join(str(v) for v in PROJ_MIN_VERSION), conda),
file=sys.stderr)
exit(1)
Expand All @@ -229,7 +229,7 @@ def find_proj_version_by_program(conda=None):
proj_version = tuple(int(v.strip(b',')) for v in proj_version)
except (OSError, IndexError, ValueError, subprocess.CalledProcessError):
warnings.warn(
'Unable to determine Proj4 version. Ensure you have %s or later '
'Unable to determine Proj version. Ensure you have %s or later '
'installed, or installation may fail.' % (
'.'.join(str(v) for v in PROJ_MIN_VERSION), ))
proj_version = (0, 0, 0)
Expand All @@ -245,7 +245,7 @@ def find_proj_version_by_program(conda=None):
proj_version = find_proj_version_by_program(conda)
if proj_version < PROJ_MIN_VERSION:
print(
'Proj4 version %s is installed, but cartopy requires at least '
'Proj version %s is installed, but cartopy requires at least '
'version %s.' % ('.'.join(str(v) for v in proj_version),
'.'.join(str(v) for v in PROJ_MIN_VERSION)),
file=sys.stderr)
Expand All @@ -268,7 +268,7 @@ def find_proj_version_by_program(conda=None):
proj_version = find_proj_version_by_program()
if proj_version < PROJ_MIN_VERSION:
print(
'Proj4 version %s is installed, but cartopy requires at least '
'Proj version %s is installed, but cartopy requires at least '
'version %s.' % ('.'.join(str(v) for v in proj_version),
'.'.join(str(v) for v in PROJ_MIN_VERSION)),
file=sys.stderr)
Expand All @@ -280,7 +280,7 @@ def find_proj_version_by_program(conda=None):
else:
if proj_version < PROJ_MIN_VERSION:
print(
'Proj4 version %s is installed, but cartopy requires at least '
'Proj version %s is installed, but cartopy requires at least '
'version %s.' % ('.'.join(str(v) for v in proj_version),
'.'.join(str(v) for v in PROJ_MIN_VERSION)),
file=sys.stderr)
Expand Down Expand Up @@ -353,7 +353,7 @@ def get_config_var(name):
long_description=description,
long_description_content_type='text/markdown',
license="LGPLv3",
keywords="cartography map transform projection proj.4 geos shapely "
keywords="cartography map transform projection proj proj.4 geos shapely "
"shapefile",

install_requires=install_requires,
Expand All @@ -377,7 +377,7 @@ def get_config_var(name):
['io/srtm.npz']},


# requires proj4 headers
# requires proj headers
ext_modules=[
Extension(
'cartopy.trace',
Expand All @@ -397,7 +397,7 @@ def get_config_var(name):
library_dirs=[library_dir] + proj_library_dirs,
**extra_extension_args
),
# Requires proj4 v4.9
# Requires proj v4.9
Extension(
'cartopy.geodesic._geodesic',
['lib/cartopy/geodesic/_geodesic.pyx'],
Expand Down

0 comments on commit 39167fb

Please sign in to comment.