Skip to content

Commit

Permalink
Use conditional import function to import cartopy in the hrrr_zarr mo…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
rafa-guedes committed May 21, 2024
1 parent d3d7c85 commit 95867e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion herbie/hrrr_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@

import datetime

import cartopy.crs as ccrs
import pandas as pd
import s3fs
import xarray as xr

from herbie.misc import try_import


def load_dataset(urls):
"""
Expand All @@ -26,6 +27,8 @@ def load_dataset(urls):
and latitude/longitude. We also promote the "time" attribute to a coordinate
so that combining the datasets for each hour will work later on.
"""
try_import("cartopy.crs", as_name="ccrs")

projection = ccrs.LambertConformal(
central_longitude=262.5,
central_latitude=38.5,
Expand Down

0 comments on commit 95867e9

Please sign in to comment.