Skip to content
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

AttributeError: 'ToolbarBox' object has no attribute 'children' #2165

Closed
matteobachetti opened this issue Dec 1, 2017 · 3 comments
Closed
Milestone

Comments

@matteobachetti
Copy link

If I try to run in a notebook the example here I get the AttributeError in the title. I paste below the full traceback.

I'm running holoviews installed through conda.

Thanks in advance for your help.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
    303                 pass
    304             else:
--> 305                 return printer(obj)
    306             # Finally look for special method names
    307             method = get_real_method(obj, self.print_method)

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in pprint_display(obj)
    257     if not ip.display_formatter.formatters['text/plain'].pprint:
    258         return None
--> 259     return display(obj, raw=True)
    260 
    261 

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in display(obj, raw, **kwargs)
    234     if isinstance(obj, GridSpace):
    235         with option_state(obj):
--> 236             html = grid_display(obj)
    237     elif isinstance(obj, (CompositeOverlay, ViewableElement)):
    238         with option_state(obj):

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in wrapped(element)
    130         try:
    131             html = fn(element,
--> 132                       max_frames=OutputSettings.options['max_frames'])
    133 
    134             # Only want to add to the archive for one display hook...

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in grid_display(grid, max_frames)
    223         return None
    224 
--> 225     return render(grid)
    226 
    227 

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in render(obj, **kwargs)
     60     if renderer.fig == 'pdf':
     61         renderer = renderer.instance(fig='png')
---> 62     return renderer.html(obj, **kwargs)
     63 
     64 

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/renderer.py in html(self, obj, fmt, css, comm, **kwargs)
    255         code to initialize a Comm, if the plot supplies one.
    256         """
--> 257         plot, fmt =  self._validate(obj, fmt)
    258         figdata, _ = self(plot, fmt, **kwargs)
    259         if css is None: css = self.css

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/renderer.py in _validate(self, obj, fmt)
    191         if isinstance(obj, tuple(self.widgets.values())):
    192             return obj, 'html'
--> 193         plot = self.get_plot(obj, renderer=self)
    194 
    195         fig_formats = self.mode_formats['fig'][self.mode]

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/renderer.py in get_plot(self_or_cls, obj, doc, renderer)
    114         combining the bokeh model with another plot.
    115         """
--> 116         plot = super(BokehRenderer, self_or_cls).get_plot(obj, renderer)
    117         if self_or_cls.mode == 'server' and doc is None:
    118             doc = curdoc()

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/renderer.py in get_plot(self_or_cls, obj, renderer)
    178             plot = self_or_cls.plotting_class(obj)(obj, renderer=renderer,
    179                                                    **plot_opts)
--> 180             plot.update(0)
    181         else:
    182             plot = obj

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/plot.py in update(self, key)
    483     def update(self, key):
    484         if len(self) == 1 and key == 0 and not self.drawn:
--> 485             return self.initialize_plot()
    486         item = self.__getitem__(key)
    487         self.traverse(lambda x: setattr(x, '_updated', True))

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/plot.py in initialize_plot(self, ranges, plots)
    422 
    423         plot = gridplot(plots[::-1])
--> 424         plot = self._make_axes(plot)
    425 
    426         title = self._get_title(self.keys[-1])

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/plot.py in _make_axes(self, plot)
    440 
    441     def _make_axes(self, plot):
--> 442         width, height = self.renderer.get_size(plot)
    443         x_axis, y_axis = None, None
    444         kwargs = dict(sizing_mode=self.sizing_mode)

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/renderer.py in get_size(self_or_cls, plot)
    283             raise ValueError('Can only compute sizes for HoloViews '
    284                              'and bokeh plot objects.')
--> 285         return compute_plot_size(plot)
    286 
    287 

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/util.py in compute_plot_size(plot)
    158         else:
    159             w_agg, h_agg = (np.max, np.sum)
--> 160         widths, heights = zip(*[compute_plot_size(child) for child in plot.children])
    161         width, height = w_agg(widths), h_agg(heights)
    162     elif isinstance(plot, (Figure, Chart)):

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/util.py in <listcomp>(.0)
    158         else:
    159             w_agg, h_agg = (np.max, np.sum)
--> 160         widths, heights = zip(*[compute_plot_size(child) for child in plot.children])
    161         width, height = w_agg(widths), h_agg(heights)
    162     elif isinstance(plot, (Figure, Chart)):

/home/mbachett/anaconda/envs/py36/lib/python3.6/site-packages/holoviews/plotting/bokeh/util.py in compute_plot_size(plot)
    151         return 0, 0
    152     elif isinstance(plot, (Row, Column, ToolbarBox, WidgetBox, Tabs)):
--> 153         if not plot.children: return 0, 0
    154         if isinstance(plot, Row) or (isinstance(plot, ToolbarBox) and plot.toolbar_location not in ['right', 'left']):
    155             w_agg, h_agg = (np.sum, np.max)

AttributeError: 'ToolbarBox' object has no attribute 'children'

Out[45]:
:GridMatrix   [X,Y]
   :NdOverlay   [species]
      :Scatter   [sepal_width]   (sepal_width)
@philippjfr
Copy link
Member

Thanks for reporting this, it's caused by a change in bokeh 0.12.11 and has been fixed in master (see #2159). We'll try to release 1.9.2 soon, but for the time being I recommend downgrading to bokeh 0.12.10.

@matteobachetti
Copy link
Author

Thanks! Indeed, it works with bokeh 0.12.10.

@philippjfr
Copy link
Member

The plan is to release 1.9.2 later today, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants