Follow-up from "plotter: parametrize tests with the available engines only"
The following discussion from !351 (merged) should be addressed:
-
@jbweston started a discussion: (+1 comment) Ideally, someone could check it with plotly but without matplotlib (but is this even possible?).
IIRC in the plotly functionality we use some matplotlib explicitly (so that we can use matplotlib colormap names).
At the moment parts of the plotly plotter use matplotlib for dealing with colormaps (see https://gitlab.kwant-project.org/kwant/kwant/blob/ca62fb9545d5386d4d2d30673ad5f3de451fb0aa/kwant/plotter.py#L1086 in plot_plotly
), however there is no consistency check that matplotlib is definitely installed when "enabling" the plotly backend.
This should be relatively simple to fix: we just need to add a clause to plotter.set_engine
(and maybe also this clause in _plotter.py
) to check that both plotly and matplotlib are installed before enabling the plotly backend.