|
38 | 38 | Basemap = object |
39 | 39 | try: |
40 | 40 | import cartopy.crs as ccrs |
41 | | - import cartopy.mpl.ticker as cticker |
42 | 41 | from cartopy.crs import Projection |
43 | 42 | except ModuleNotFoundError: |
44 | | - Projection = ccrs = cticker = object |
| 43 | + ccrs = None |
| 44 | + Projection = object |
45 | 45 |
|
46 | 46 | __all__ = [ |
47 | 47 | 'Proj', |
|
226 | 226 | 'lon_1': 0, 'lon_2': 0, 'width': 10000e3, 'height': 10000e3 |
227 | 227 | }, |
228 | 228 | } |
229 | | -if ccrs is object: |
| 229 | +if ccrs is None: |
230 | 230 | PROJS = {} |
231 | 231 | else: |
232 | 232 | PROJS = { |
@@ -1469,7 +1469,7 @@ def Proj( |
1469 | 1469 | # NOTE: Error message matches basemap invalid projection message |
1470 | 1470 | elif backend == 'cartopy': |
1471 | 1471 | # Parse keywoard arguments |
1472 | | - import cartopy.crs as ccrs # noqa: F401 |
| 1472 | + import cartopy # ensure present # noqa: F401 |
1473 | 1473 | for key in ('round', 'boundinglat'): |
1474 | 1474 | value = kwargs.pop(key, None) |
1475 | 1475 | if value is not None: |
@@ -1508,7 +1508,7 @@ def Proj( |
1508 | 1508 | # on initialization and controls *all* features. |
1509 | 1509 | else: |
1510 | 1510 | # Parse input arguments |
1511 | | - from mpl_toolkits.basemap import Basemap |
| 1511 | + from mpl_toolkits import basemap # ensure present # noqa: F401 |
1512 | 1512 | if name in ('eqc', 'pcarree'): |
1513 | 1513 | name = 'cyl' # PROJ package aliases |
1514 | 1514 | defaults = {'fix_aspect': True, **PROJ_DEFAULTS.get(name, {})} |
|
0 commit comments