Skip to content

Traiterror in ipywidgets 7.0.0b3 and 7.0.0b4 #1566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DougRzz opened this issue Aug 2, 2017 · 2 comments
Closed

Traiterror in ipywidgets 7.0.0b3 and 7.0.0b4 #1566

DougRzz opened this issue Aug 2, 2017 · 2 comments
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@DougRzz
Copy link
Contributor

DougRzz commented Aug 2, 2017

Hi,

When I upgrade to ipywidgets 7.0.0b3 I get the following error message in Jupyter (see below). I do not get this message in 7.0.0b2. The Jupyter cell had numerous ipywidgets including buttons, multi-select drop down widgets. I can try and isolate the issue and send an example if you need more information.


TraitError Traceback (most recent call last)
in ()
138 readout=True,
139 readout_format='i',
--> 140 slider_color='white'
141 )
142 def on_change(change):

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\ipywidgets\widgets\widget_int.py in init(self, value, min, max, step, **kwargs)
59 if step is not None:
60 kwargs['step'] = step
---> 61 super(cls, self).init(**kwargs)
62
63 init.doc = _bounded_int_doc_t

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\ipywidgets\widgets\widget_int.py in init(self, value, min, max, step, **kwargs)
91 if step is not None:
92 kwargs['step'] = step
---> 93 super(_BoundedInt, self).init(**kwargs)
94
95 @Validate('value')

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\ipywidgets\widgets\widget_int.py in init(self, value, **kwargs)
73 if value is not None:
74 kwargs['value'] = value
---> 75 super(_Int, self).init(**kwargs)
76
77

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\ipywidgets\widgets\widget.py in init(self, **kwargs)
367 """Public constructor"""
368 self._model_id = kwargs.pop('model_id', None)
--> 369 super(Widget, self).init(**kwargs)
370
371 Widget._call_widget_constructed(self)

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\traitlets\traitlets.py in init(self, *args, **kwargs)
995 for key, value in kwargs.items():
996 if self.has_trait(key):
--> 997 setattr(self, key, value)
998 else:
999 # passthrough args that don't set traits to super

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\traitlets\traitlets.py in set(self, obj, value)
583 raise TraitError('The "%s" trait is read-only.' % self.name)
584 else:
--> 585 self.set(obj, value)
586
587 def _validate(self, obj, value):

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\traitlets\traitlets.py in set(self, obj, value)
557
558 def set(self, obj, value):
--> 559 new_value = self._validate(obj, value)
560 try:
561 old_value = obj._trait_values[self.name]

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\traitlets\traitlets.py in _validate(self, obj, value)
589 return value
590 if hasattr(self, 'validate'):
--> 591 value = self.validate(obj, value)
592 if obj._cross_validation_lock is False:
593 value = self._cross_validate(obj, value)

C:\Users\Reddeda0\AppData\Local\Continuum\Miniconda3\lib\site-packages\ipywidgets\widgets\trait_types.py in validate(self, obj, value)
182 'be one of {}, but a value of '{}' was '
183 'specified.'.format(
--> 184 list(_number_format_types), format_type)
185 )

TraitError: The type specifier of a NumberFormat trait must be one of ['', 'o', 'b', '%', 'x', 'd', 'e', 'f', 'r', 'p', 'g', 's', 'c', 'X'], but a value of 'i' was specified.

@pbugnion
Copy link
Member

pbugnion commented Aug 2, 2017

Thanks for submitting an issue.

You are using a readout_format value of 'i' (presumably for a slider, but I can't tell exactly), which isn't actually a valid format. Previously, this was silently converted to a readout_format of ''. Part of the confusion is that the docs used 'i' in some places (despite it not being valid). I would just change that slider to use a readout format of '' (an empty string).

x.ref PR #1550 and issue #1544 .

@DougRzz
Copy link
Contributor Author

DougRzz commented Aug 2, 2017

Thanks v much. That fixed it.

@DougRzz DougRzz closed this as completed Aug 2, 2017
@jasongrout jasongrout added this to the Reference milestone Aug 4, 2017
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

No branches or pull requests

3 participants