metpy.plots Cartopy Natural Earth 问题

metpy.plots issue with Cartopy Natural Earth

我刚刚注意到,当我尝试在 NCAR 的 Cheyenne 超级计算机上导入 metpy.plots 时,它在使用 metpy 0.10.0(带有 Cartopy 0.17.0)时加载并工作正常,但我在 metpy 中遇到错误0.12.0 或 0.12.1(使用 Cartopy 0.18.0b2)。这是我得到的错误:

(NPL) jaredlee@cheyenne3:~> python3
Python 3.6.8 (default, Jun 27 2019, 20:02:05) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import metpy
>>> metpy.__version__
'0.12.1'
>>> import metpy.plots as mpplots
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/glade/work/jaredlee/python/my_npl_clone_20200417/lib/python3.6/site-packages/metpy/plots/__init__.py", line 27, in <module>
    from .cartopy_utils import USCOUNTIES, USSTATES
  File "/glade/work/jaredlee/python/my_npl_clone_20200417/lib/python3.6/site-packages/metpy/plots/cartopy_utils.py", line 43, in <module>
    USCOUNTIES = MetPyMapFeature('us_counties', '20m', facecolor='None', edgecolor='black')
  File "/glade/work/jaredlee/python/my_npl_clone_20200417/lib/python3.6/site-packages/metpy/plots/cartopy_utils.py", line 16, in __init__
    super().__init__('', name, scale, **kwargs)
  File "/glade/work/jaredlee/python/my_npl_clone_20200417/lib/python3.6/site-packages/cartopy/feature/__init__.py", line 264, in __init__
    self._validate_scale()
  File "/glade/work/jaredlee/python/my_npl_clone_20200417/lib/python3.6/site-packages/cartopy/feature/__init__.py", line 274, in _validate_scale
    'Valid scales are "110m", "50m", and "10m".'
ValueError: 20m is not a valid Natural Earth scale. Valid scales are "110m", "50m", and "10m".
>>> 

如果我在我的本地 metpy 副本中手动更改 cartopy_utils.py,以便对 MetPyMapFeature 的 USCOUNTIES 和 USSTATES 函数调用使用“10m”而不是“20m”,那么错误就会消失。这个“20m”是 cartopy_utils.py 中的错误吗? Natural Earth 的网页宣传它提供 1:10m、1:50m 和 1:110m 尺度的数据。

MetPy <=0.12.1 与 CartoPy 0.18 不兼容。正如 Daryl 在他的评论中指出的那样,这是一个悬而未决的问题,有望很快得到解决。