holoviews
holoviews copied to clipboard
.opts / .options warning raised when no options are set
When calling .opts
on an element without passing any options a warning is emitted.
import holoviews as hv
hv.extension('bokeh')
hv.Scatter([0]).opts()
WARNING:param.main: Calling the .opts method with options broken down by options group (i.e. separate plot, style and norm groups) is deprecated. Use the .options method converting to the simplified format instead or use hv.opts.apply_groups for backward compatibility.
Users are unlikely to write that directly, but libraries like GeoViews use that in various places, for example: https://github.com/holoviz/geoviews/blob/master/geoviews/element/geo.py#L149-L150
Maybe it's just a matter of removing this condition: https://github.com/holoviz/holoviews/blob/master/holoviews/core/util.py#L248-L249
I can't tell what that used to point to, but I do think there should be an easy check that would fix this, and it's important to avoid those false alarms.
I noticed that an empty opts
will reset previous options, this should not be the case in my opinion.
As .opts.clear()
exists already, the easiest thing is to do nothing when you have an empty.opts
(so it is a no-op, without the warning).