[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #MVR-694466]: Cartopy (0.14.2) / MetPy (0.12.2) parse(cf) error when using Google Colab



Greetings!

I went ahead and answered your Stack Overflow question here:

  
https://stackoverflow.com/questions/64979083/cartopy-0-14-2-metpy-0-12-2-parsecf-error-when-using-google-colab/64979958#64979958

We can continue any needed discussion there.

Ryan

> Hi All:
> I have a student facing a problem that is similar to what others are 
> reporting when using older versions of MetPy and Cartopy.
> The issue is the parse_cf() command under metpy. And it's happening under 
> Google Colaboratory, of which I have little experience. Things are working 
> fine on other platforms (anaconda, miniconda, homebrew, etc)
> Previous feedback I've seen refers to rolling back the version of the cartopy 
> library from 0.18.*. I have also followed previously posted guidance on 
> Shapely, but we cannot seem to be able to change the versions of cartopy or 
> metpy version in Google CoLab.
> The version information for the environment and python libraries, followed by 
> the code and error is below.
> I'm at a loss here and have troubleshot it for my student about as far as I 
> can go. Guidance would be appreciated by both of us.
> System and Package Information
> MetPy                         0.12.2
> Cartopy                       0.14.2
> 3.6.9 (default, Oct  8 2020, 12:12:24)
> [GCC 8.4.0]
> Linux d8a71c5140a6 4.19.112+ #1 SMP Thu Jul 23 08:00:38 PDT 2020 x86_64 
> x86_64 x86_64 GNU/Linux
> Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic
> 
> python-cartopy/bionic,now 0.14.2+dfsg1-2build3 amd64 [installed]
> python3-cartopy/bionic,now 0.14.2+dfsg1-2build3 amd64 [installed]
> Code to Replicate
> import numpy as np
> import cartopy as c
> import metpy as metpy
> 
> file_218 = 
> "https://www.ncei.noaa.gov/thredds/dodsC/model-nam218/202011/20201121/nam_218_20201121_0000_000.grb2";
> 
> ds218    = xr.open_dataset(file_218)
> ds218    = ds218.metpy.parse_cf()
> 
> Error Message
> ---------------------------------------------------------------------------
> NameError                                 Traceback (most recent call last)
> <ipython-input-9-4362f5b26659> in <module>()
> 9 file_218 = 
> "https://www.ncei.noaa.gov/thredds/dodsC/model-nam218/202011/20201121/nam_218_20201121_0000_000.grb2";
> 10 ds218    = xr.open_dataset(file_218)
> ---> 11 ds218    = ds218.metpy.parse_cf()
> 
> 1 frames
> /usr/local/lib/python3.6/dist-packages/metpy/xarray.py in parse_cf(self, 
> varname, coordinates)
> 510         """
> 511         from .cbook import iterable
> --> 512         from .plots.mapping import CFProjection
> 513
> 514         if varname is None:
> 
> /usr/local/lib/python3.6/dist-packages/metpy/plots/__init__.py in <module>()
> 17 logger = logging.getLogger(__name__)
> 18
> ---> 19 __all__ = ctables.__all__[:]  # pylint: disable=undefined-variable
> 20 __all__.extend(declarative.__all__)  # pylint: disable=undefined-variable
> 21 __all__.extend(skewt.__all__)  # pylint: disable=undefined-variable
> 
> NameError: name 'ctables' is not defined
> 
> Any ideas would be appreciated, I’m out of ‘em here.
> 


Ticket Details
===================
Ticket ID: MVR-694466
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.