Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

Misleading error on missing Range bounds #74

Open
kcpevey opened this issue Aug 23, 2018 · 0 comments
Open

Misleading error on missing Range bounds #74

kcpevey opened this issue Aug 23, 2018 · 0 comments

Comments

@kcpevey
Copy link

kcpevey commented Aug 23, 2018

Setting Range bounds=None (or not providing them) results in a misleading error:

float_range = param.Range(default=(0.0, 1.57), bounds=None)

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-ede5c729d901> in <module>()
      6     colormap = param.ObjectSelector(default='rainbow', objects=['rainbow', 'bgy', 'bgyw', 'blues', 'coolwarm', 'gray,'])
      7 opts = plot_options(name='')
----> 8 parambokeh.Widgets(opts)

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\param\parameterized.py in __new__(class_, *args, **params)
   2047         inst = class_.instance()
   2048         inst.param._set_name(class_.__name__)
-> 2049         return inst.__call__(*args,**params)
   2050 
   2051     def __call__(self,*args,**kw):

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\parambokeh\__init__.py in __call__(self, parameterized, doc, plots, **params)
    232 
    233         # Initialize widgets and populate container
--> 234         widgets, views = self.widgets()
    235         plots = views + plots
    236         widget_box.children = widgets

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\parambokeh\__init__.py in widgets(self)
    495 
    496         if self.p.show_labels:
--> 497             widgets += [self.widget(pname) for pname in ordered_params]
    498         else:
    499             widgets += [self.widget(pname) for pname in ordered_params]

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\parambokeh\__init__.py in <listcomp>(.0)
    495 
    496         if self.p.show_labels:
--> 497             widgets += [self.widget(pname) for pname in ordered_params]
    498         else:
    499             widgets += [self.widget(pname) for pname in ordered_params]

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\parambokeh\__init__.py in widget(self, param_name)
    459         """Get widget for param_name"""
    460         if param_name not in self._widgets:
--> 461             self._widgets[param_name] = self._make_widget(param_name)
    462         return self._widgets[param_name]
    463 

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\parambokeh\__init__.py in _make_widget(self, p_name)
    403             kw['start'], kw['end'] = p_obj.get_soft_bounds()
    404 
--> 405         w = widget_class(**kw)
    406 
    407         if hasattr(p_obj, 'callbacks') and value is not None:

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\parambokeh\widgets.py in RangeWidget(*args, **kw)
     92     if isinstance(kw['start'], int) and isinstance(kw['end'], int):
     93         kw['step'] = 1
---> 94     return RangeSlider(*args, **kw)
     95 
     96 def PlotWidget(*args, **kw):

C:\ProgramData\Anaconda3\envs\earthsimAUG\lib\site-packages\bokeh\models\widgets\sliders.py in __init__(self, **kwargs)
     22         if 'start' in kwargs and 'end' in kwargs:
     23             if kwargs['start'] == kwargs['end']:
---> 24                 raise ValueError("Slider 'start' and 'end' cannot be equal.")
     25         super(Widget, self).__init__(**kwargs)
     26 

ValueError: Slider 'start' and 'end' cannot be equal.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant