Skip to content

Commit 2c9c8ed

Browse files
Micah CochranMicah Cochran
authored andcommitted
Reformat PROJ.4 version number into string
Reformats PROJ.4 version from the pyproj provided floating point number into a string. So, the code converts 4.90 into '4.9.0'.
1 parent 82194a7 commit 2c9c8ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/mpl_toolkits/basemap/diagnostic.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def package_versions():
3434
except ImportError:
3535
pil_version = 'not installed'
3636
pillow_version = 'not installed'
37-
37+
38+
# Get PROJ.4 version info in a floating point number
39+
proj_ver_num = pyproj.Proj(init='epsg:4326').proj_version
40+
# reformats floating point number into string (4.90 becomes '4.9.0')
41+
proj4_version = '.'.join(list(str(int(proj_ver_num*100))))
42+
3843
BasemapPackageVersions = namedtuple(
3944
'BasemapPackageVersions',
4045
"""Python, basemap, matplotlib,
@@ -48,7 +53,7 @@ def package_versions():
4853
numpy = numpy_version,
4954
pyproj = pyproj.__version__,
5055
pyshp = pyshp_version,
51-
PROJ4 = round(pyproj.Proj(init='epsg:4326').proj_version, 2),
56+
PROJ4 = proj4_version,
5257
GEOS = _geoslib.__geos_version__,
5358
# optional dependencies below
5459
OWSLib = OWSLib_version,

0 commit comments

Comments
 (0)