Skip to content

Commit

Permalink
Fix geoaxes instantiation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lukelbd committed Jan 22, 2022
1 parent bc610f5 commit a5b5071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions proplot/axes/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
try:
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import cartopy.mpl.ticker as cticker
from cartopy.crs import Projection
from cartopy.mpl.geoaxes import GeoAxes as _GeoAxes
except ModuleNotFoundError:
cfeature = cticker = ccrs = None
ccrs = cfeature = None
_GeoAxes = Projection = object

try:
Expand Down
10 changes: 5 additions & 5 deletions proplot/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
Basemap = object
try:
import cartopy.crs as ccrs
import cartopy.mpl.ticker as cticker
from cartopy.crs import Projection
except ModuleNotFoundError:
Projection = ccrs = cticker = object
ccrs = None
Projection = object

__all__ = [
'Proj',
Expand Down Expand Up @@ -226,7 +226,7 @@
'lon_1': 0, 'lon_2': 0, 'width': 10000e3, 'height': 10000e3
},
}
if ccrs is object:
if ccrs is None:
PROJS = {}
else:
PROJS = {
Expand Down Expand Up @@ -1469,7 +1469,7 @@ def Proj(
# NOTE: Error message matches basemap invalid projection message
elif backend == 'cartopy':
# Parse keywoard arguments
import cartopy.crs as ccrs # noqa: F401
import cartopy # ensure present # noqa: F401
for key in ('round', 'boundinglat'):
value = kwargs.pop(key, None)
if value is not None:
Expand Down Expand Up @@ -1508,7 +1508,7 @@ def Proj(
# on initialization and controls *all* features.
else:
# Parse input arguments
from mpl_toolkits.basemap import Basemap
from mpl_toolkits import basemap # ensure present # noqa: F401
if name in ('eqc', 'pcarree'):
name = 'cyl' # PROJ package aliases
defaults = {'fix_aspect': True, **PROJ_DEFAULTS.get(name, {})}
Expand Down

0 comments on commit a5b5071

Please sign in to comment.