Skip to content

Commit

Permalink
Answer to #issuecomment-1120099909
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario Stelitano committed May 7, 2022
1 parent d2c80fb commit 9fad58e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
- mock
- libtiff
- geoviews
- hvplot
- zarr
- python-eccodes
# 2.19.1 seems to cause library linking issues
Expand Down
10 changes: 9 additions & 1 deletion satpy/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import warnings
from typing import Callable

import hvplot.xarray # noqa
import numpy as np
import xarray as xr
from holoviews import Overlay
Expand All @@ -39,6 +38,12 @@
from satpy.resample import get_area_def, prepare_resampler, resample_dataset
from satpy.writers import load_writer

try:
import hvplot.xarray # noqa
except ImportError:
hvplot.xarray = None


LOG = logging.getLogger(__name__)


Expand Down Expand Up @@ -1061,6 +1066,9 @@ def _plot_quadmesh(xarray_ds, variable, **defaults):
clabel=f'[{_get_units(xarray_ds,variable)}]', title=title,
**defaults)

if hvplot is None:
raise ImportError("'hvplot' must be installed to use this feature")

plot = Overlay()
xarray_ds = self.to_xarray_dataset(datasets)
ccrs = _get_crs(xarray_ds)
Expand Down

0 comments on commit 9fad58e

Please sign in to comment.