You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When following some examples from the internet, there might be a point where hv.Cycle is used. Usage of it needs import with side effects. Without any imports, user will see:
In [1]: importholoviewsashv
...: hv.Cycle("Set1")
---------------------------------------------------------------------------KeyErrorTraceback (mostrecentcalllast)
InputIn [1], in<module>1importholoviewsashv---->2hv.Cycle("Set1")
Filec:\python\venvs\myproj\lib\site-packages\holoviews\core\options.py:325, inCycle.__init__(self, cycle, **params)
323params['key'] =None324super(Cycle, self).__init__(**params)
-->325self.values=self._get_values()
Filec:\python\venvs\myproj\lib\site-packages\holoviews\core\options.py:335, inCycle._get_values(self)
333ifself.values: returnself.values334elifself.key:
-->335returnlist(self.default_cycles[self.key])
336else:
337raiseValueError("Supply either a key or explicit values.")
KeyError: 'Set1'
While the following works (as calling hv.extension has a side effect that is needed for hv.Cycle):
In [1]: importholoviewsashv
...: hv.extension()
...:
...: hv.Cycle("Set1")
Out[1]: Cycle('Set1')
Describe the solution you'd like
Instead of printing
KeyError: 'Set1'
print
KeyError: 'Set1'. Did you forget to call panel.extension?
Describe alternatives you've considered
Another possibility could be to call hv.extension, or somehow else fetch the default list of keys for hv.Cycle, in case of error.
Edit: replaced pn.extension with hv.extension.
The text was updated successfully, but these errors were encountered:
Using: Holoviews 1.14.8
Is your feature request related to a problem? Please describe.
When following some examples from the internet, there might be a point where
hv.Cycle
is used. Usage of it needs import with side effects. Without any imports, user will see:While the following works (as calling
hv.extension
has a side effect that is needed forhv.Cycle
):Describe the solution you'd like
Instead of printing
print
Describe alternatives you've considered
Another possibility could be to call
hv.extension
, or somehow else fetch the default list of keys forhv.Cycle
, in case of error.Edit: replaced
pn.extension
withhv.extension
.The text was updated successfully, but these errors were encountered: