Skip to content

Commit a5b5071

Browse files
committed
Fix geoaxes instantiation issue
1 parent bc610f5 commit a5b5071

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

proplot/axes/geo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
try:
2222
import cartopy.crs as ccrs
2323
import cartopy.feature as cfeature
24-
import cartopy.mpl.ticker as cticker
2524
from cartopy.crs import Projection
2625
from cartopy.mpl.geoaxes import GeoAxes as _GeoAxes
2726
except ModuleNotFoundError:
28-
cfeature = cticker = ccrs = None
27+
ccrs = cfeature = None
2928
_GeoAxes = Projection = object
3029

3130
try:

proplot/constructor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
Basemap = object
3939
try:
4040
import cartopy.crs as ccrs
41-
import cartopy.mpl.ticker as cticker
4241
from cartopy.crs import Projection
4342
except ModuleNotFoundError:
44-
Projection = ccrs = cticker = object
43+
ccrs = None
44+
Projection = object
4545

4646
__all__ = [
4747
'Proj',
@@ -226,7 +226,7 @@
226226
'lon_1': 0, 'lon_2': 0, 'width': 10000e3, 'height': 10000e3
227227
},
228228
}
229-
if ccrs is object:
229+
if ccrs is None:
230230
PROJS = {}
231231
else:
232232
PROJS = {
@@ -1469,7 +1469,7 @@ def Proj(
14691469
# NOTE: Error message matches basemap invalid projection message
14701470
elif backend == 'cartopy':
14711471
# Parse keywoard arguments
1472-
import cartopy.crs as ccrs # noqa: F401
1472+
import cartopy # ensure present # noqa: F401
14731473
for key in ('round', 'boundinglat'):
14741474
value = kwargs.pop(key, None)
14751475
if value is not None:
@@ -1508,7 +1508,7 @@ def Proj(
15081508
# on initialization and controls *all* features.
15091509
else:
15101510
# Parse input arguments
1511-
from mpl_toolkits.basemap import Basemap
1511+
from mpl_toolkits import basemap # ensure present # noqa: F401
15121512
if name in ('eqc', 'pcarree'):
15131513
name = 'cyl' # PROJ package aliases
15141514
defaults = {'fix_aspect': True, **PROJ_DEFAULTS.get(name, {})}

0 commit comments

Comments
 (0)