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

StationPlot get errors with cartopy=0.18.0 #1437

Closed
NMC-DAVE opened this issue Jul 29, 2020 · 2 comments
Closed

StationPlot get errors with cartopy=0.18.0 #1437

NMC-DAVE opened this issue Jul 29, 2020 · 2 comments
Labels
Area: Plots Pertains to producing plots Status: Duplicate Duplicates an existing issue Type: Bug Something is not working like it should

Comments

@NMC-DAVE
Copy link

Hi:
When StationPlot is imported, I get the fellowing errors. It's like the cartopy 0.18.0 does not support '20m' Natural Earth scale.

from metpy.plots import StationPlot 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-016b453d2765> in <module>
      9 
     10 import metpy.calc as mpcalc
---> 11 from metpy.plots import StationPlot
     12 from metpy.units import units
     13 

~/miniconda3/envs/MET/lib/python3.7/site-packages/metpy/plots/__init__.py in <module>
     25                 convert_gempak_color])  # pylint: disable=undefined-variable
     26 try:
---> 27     from .cartopy_utils import USCOUNTIES, USSTATES
     28     __all__.extend([USCOUNTIES, USSTATES])
     29 except ImportError:

~/miniconda3/envs/MET/lib/python3.7/site-packages/metpy/plots/cartopy_utils.py in <module>
     41 
     42 
---> 43 USCOUNTIES = MetPyMapFeature('us_counties', '20m', facecolor='None', edgecolor='black')
     44 
     45 USSTATES = MetPyMapFeature('us_states', '20m', facecolor='None', edgecolor='black')

~/miniconda3/envs/MET/lib/python3.7/site-packages/metpy/plots/cartopy_utils.py in __init__(self, name, scale, **kwargs)
     14     def __init__(self, name, scale, **kwargs):
     15         """Create USCountiesFeature instance."""
---> 16         super().__init__('', name, scale, **kwargs)
     17 
     18     def geometries(self):

~/miniconda3/envs/MET/lib/python3.7/site-packages/cartopy/feature/__init__.py in __init__(self, category, name, scale, **kwargs)
    262         self.scaler = scale
    263         # Make sure this is a valid resolution
--> 264         self._validate_scale()
    265 
    266     @property

~/miniconda3/envs/MET/lib/python3.7/site-packages/cartopy/feature/__init__.py in _validate_scale(self)
    272             raise ValueError(
    273                 '{} is not a valid Natural Earth scale. '.format(self.scale) +
--> 274                 'Valid scales are "110m", "50m", and "10m".'
    275             )
    276 

ValueError: 20m is not a valid Natural Earth scale. Valid scales are "110m", "50m", and "10m".
@NMC-DAVE NMC-DAVE added the Type: Bug Something is not working like it should label Jul 29, 2020
@akrherz
Copy link
Contributor

akrherz commented Jul 30, 2020

Duplicate of #1368

@jthielen jthielen added Area: Plots Pertains to producing plots Status: Duplicate Duplicates an existing issue labels Jul 30, 2020
@jthielen
Copy link
Collaborator

jthielen commented Jul 30, 2020

Indeed, this is a duplicate of #1368 and #1404, which was recently fixed by #1416. The fix should be available in the upcoming MetPy 0.12.2 release, but in the meantime, the resolution is downgrading Cartopy to 0.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Plots Pertains to producing plots Status: Duplicate Duplicates an existing issue Type: Bug Something is not working like it should
Projects
None yet
Development

No branches or pull requests

3 participants