Add diagnostics functions: proj4 ver. & Inv. Hammer #281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a refactor of the package_version function to move getting the proj4 version number into a new function, proj4_version. check_proj_inv_hammer function is added for checking if the inverse of the hammer projection is available (which should be in the yet to be released proj.4 version 4.9.3).
check_proj_inv_hammer() and proj4_version() are intended to end up in setup.py, but may provide some use in the main basemap library. Due to that reason, the imports are mostly self-contained for the function.
So, Proj.4 verion 4.9.3 has not been released, nor has the current development version of pyproj which has code that raises a RuntimeError when a projection's inverse function isn't available (pyproj 1.9.5.1 and before will segfault). At the moment, I'm a little uncertain about putting these the check_proj_inv_hammer() into setup.py without one of the two libraries being released. This effectively requires installation one of the development versions for the check_proj_inv_hammer function to pass the test, otherwise they risk a segfault. This originates from discussion in PR #240.
Editing setup.py seems a little daunting because I'm a bit overwhelmed by what all setup.py can do/should do. setup.py seems to work like a swiss army knife by doing a couple tasks well and other tasks not so well.
Here are my local test results of the functions, which where copied an pasted into ipython: