Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix proj4 version check #2334

Merged
merged 1 commit into from Feb 16, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+17 −8
Diff settings

Always

Just for now

@@ -167,7 +167,8 @@ def test_event_copying_does_not_raise_duplicate_resource_id_warning(self):
@unittest.skipIf(
BASEMAP_VERSION >= [1, 1, 0] and MATPLOTLIB_VERSION == [3, 0, 1],
'matplotlib 3.0.1 is not campatible with basemap')
@unittest.skipIf(PROJ4_VERSION[0] == 5, 'unsupported proj4 library')
@unittest.skipIf(PROJ4_VERSION and PROJ4_VERSION[0] == 5,
'unsupported proj4 library')
def test_plot_farfield_without_quiver_with_maps(self):
"""
Tests to plot P/S wave farfield radiation pattern, also with beachball
@@ -590,7 +591,8 @@ def setUp(self):
# Also clear the tracker.
ResourceIdentifier._ResourceIdentifier__resource_id_tracker.clear()

@unittest.skipIf(PROJ4_VERSION[0] == 5, 'unsupported proj4 library')
@unittest.skipIf(PROJ4_VERSION and PROJ4_VERSION[0] == 5,
'unsupported proj4 library')
def test_catalog_plot_global(self):
"""
Tests the catalog preview plot, default parameters, using Basemap.
@@ -502,7 +502,8 @@ def setUp(self):
def tearDown(self):
np.seterr(**self.nperr)

@unittest.skipIf(PROJ4_VERSION[0] == 5, 'unsupported proj4 library')
@unittest.skipIf(PROJ4_VERSION and PROJ4_VERSION[0] == 5,
'unsupported proj4 library')
def test_location_plot_global(self):
"""
Tests the inventory location preview plot, default parameters, using
@@ -552,7 +553,8 @@ def test_location_plot_local(self):
size=20**2, color_per_network={'GR': 'b', 'BW': 'green'},
outfile=ic.name)

@unittest.skipIf(PROJ4_VERSION[0] == 5, 'unsupported proj4 library')
@unittest.skipIf(PROJ4_VERSION and PROJ4_VERSION[0] == 5,
'unsupported proj4 library')
def test_combined_station_event_plot(self):
"""
Tests the combined plotting of inventory/event data in one plot,
@@ -298,7 +298,8 @@ def setUp(self):
def tearDown(self):
np.seterr(**self.nperr)

@unittest.skipIf(PROJ4_VERSION[0] == 5, 'unsupported proj4 library')
@unittest.skipIf(PROJ4_VERSION and PROJ4_VERSION[0] == 5,
'unsupported proj4 library')
def test_location_plot_global(self):
"""
Tests the network location preview plot, default parameters, using
Copy path View file
@@ -363,15 +363,19 @@ def get_proj_version(raw_string=False):
(see basemap issue 433). Checking this will allow us to raise a warning
when plotting using basemap.
:returns: Package version as a list of three integers.
:returns: Package version as a list of three integers. Empty list if pyproj
not installed.
With option ``raw_string=True`` returns raw version string instead.
The last version number can indicate different things like it being a
version from the old svn trunk, the latest git repo, some release
candidate version, ...
If the last number cannot be converted to an integer it will be set to
0.
"""
from pyproj import Proj
try:
from pyproj import Proj
except ImportError:
return []

# proj4 is a c library, prproj wraps this. proj_version is an attribute
# of the Proj class that is only set when the projection is made. Make
Copy path View file
@@ -37,7 +37,7 @@
"when rendering countries and continents. ObsPy will "
"still work but the maps might be wrong. Please update "
"your basemap installation.")
if PROJ4_VERSION[0] == 5:
if PROJ4_VERSION and PROJ4_VERSION[0] == 5:
msg = (
"basemap/pyproj with proj4 version >= 5 has a bug that results in "
"inverted map axes. Your maps may be wrong. Please use another "
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.