holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.66k stars 396 forks source link

Provide informative messages for missing dependencies #1929

Open jbednar opened 6 years ago

jbednar commented 6 years ago

For anything that holoviews imports but is not declared as a dependency, we should have simple, informative error messages that tell users what to do. E.g.https://github.com/bokeh/datashader/issues/315#issuecomment-323273810 has posts from two different people who could have had a better experience if a message had told them to install datashader. Please edit this text to add any other cases that you know about:

May also need to do something similar for GeoViews.

jlstevens commented 6 years ago

Also scipy for some operations.

jbednar commented 6 years ago

Ok, added that to the list above.

jlstevens commented 6 years ago

In chart3d:

class TrisurfacePlot(ColorbarPlot, Chart3DPlot):

    style_opts = ['cmap']

    def get_data(self, element, ranges):
        try:
            from scipy.spatial import Delaunay
        except:
            SkipRendering("SciPy not available, cannot plot Trisurface")

I'm a little confused about the use in operation.timeseries, I don't see scipy imported there but in TimeseriesOperationTests I see:

    @attr(optional=1) # Requires scipy
    def test_roll_date_with_window_type(self):
        rolled = rolling(self.date_curve, rolling_window=3, window_type='triang')
        rolled_vals = [np.NaN, 2, 3, 4, 5, 6, np.NaN]
        self.assertEqual(rolled, Curve((self.dates, rolled_vals)))

Might be an optional dependency downstream though...

philippjfr commented 6 years ago

Pandas uses SciPy internally for resampling and rolling operations.

jlstevens commented 6 years ago

Ok, that is what I thought. Either way, scipy does belong on that list...