You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running code from HRRR Data. It works perfectly in a local Jupyter notebook, but runs into an error on Google Colab (with condacolab installed). Am I missing a library somewhere?
My code :
!pip install -q condacolab
import condacolab
condacolab.install()
!mamba install -q -c conda-forge cartopy metpy herbie-data
!pip install git+https://github.com/blaylockbk/Carpenter_Workshop.git
from herbie import Herbie
from toolbox import EasyMap, pc
from paint.standard2 import cm_tmp
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from metpy import units
H = Herbie(
"2022-12-24",
model="hrrr",
product="sfc",
fxx=0,
)
ds = H.xarray("TMP:2 m above")
ax = EasyMap("50m", crs=ds.herbie.crs, figsize=[20, 12]).STATES().ax
ax.set_extent([-125, -105, 35, 50])
p = ax.pcolormesh(
ds.longitude,
ds.latitude,
ds.t2m.metpy.convert_units('degF'),
transform=pc,
**cm_tmp(units="F").cmap_kwargs,
)
plt.colorbar(
p,
ax=ax,
orientation="horizontal",
pad=0.01,
shrink=0.8,
**cm_tmp(units="F").cbar_kwargs,
)
ax.set_title(
f"{ds.model.upper()}: {H.product_description}\nValid: {ds.valid_time.dt.strftime('%H:%M UTC %d %b %Y').item()}",
loc="left",
)
ax.set_title(ds.t2m.GRIB_name, loc="right")
I have never tried running this on Google colab. I did hear from someone once that they had an issue due to a python or matplotlib version.
It looks like you are using python 3.8. That should be fine. But what version of matplotlib is installed? That error TypeError: __init__() got an unexpected keyword argument 'extend' seems like the version of matplotlib might be out of date.
Matplotlib version is 3.6.2, which I believe is current. Perhaps Google has problems with **kwargs. Those are the only lines that produce the error. Given that it works perfectly on Jupyter Lab, the issue must be on Google's side.
I'm running code from HRRR Data. It works perfectly in a local Jupyter notebook, but runs into an error on Google Colab (with condacolab installed). Am I missing a library somewhere?
My code :
The resulting error on Colab:
The text was updated successfully, but these errors were encountered: