This repository was archived by the owner on Nov 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
ListSelector : AttributeError: 'CrossSelect' object has no attribute '_options_dict' #84
Copy link
Copy link
Open
Description
Hello,
I had weird behavior with small list it worked with more than 20 elements I had this problem:
AttributeError Traceback (most recent call last)
~/.conda/envs/jupyter/lib/python3.6/site-packages/paramnb/widgets.py in _apply_selection(self, event)
242 self._lists[selected].options = merged if merged else ['']
243 self._lists[not selected].options = leftovers if leftovers else ['']
--> 244 self.value = [self._options_dict[o] for o in self._lists[True].options if o != '']
245 self._apply_filters()
246
~/.conda/envs/jupyter/lib/python3.6/site-packages/paramnb/widgets.py in <listcomp>(.0)
242 self._lists[selected].options = merged if merged else ['']
243 self._lists[not selected].options = leftovers if leftovers else ['']
--> 244 self.value = [self._options_dict[o] for o in self._lists[True].options if o != '']
245 self._apply_filters()
246
A minimal exemple working:
import paramnb
import param
import numpy as np
testVar = tuple(np.arange(10))
class SelectionVariables(param.Parameterized):
int_list = param.ListSelector(default=testVar, objects=testVar)
select = paramnb.Widgets(SelectionVariables)
select
A minimal exemple not working:
import paramnb
import param
import numpy as np
testVar = tuple(np.arange(21))
class SelectionVariables(param.Parameterized):
int_list = param.ListSelector(default=testVar, objects=testVar)
select = paramnb.Widgets(SelectionVariables)
select
After digging the documentation the class ListSelectorWidget mention, it switches from a regular SelectMultiple widget to a two-pane CrossSelect widget.
The command below gives me the version of each module:
import ipywidgets
print(ipywidgets.__version__)
print(param.__version__)
print(paramnb.__version__)
7.2.1
1.6.1
2.0.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels