Skip to content

Commit

Permalink
Miscellaneous minor bug fixes (#2346)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored and jlstevens committed Feb 16, 2018
1 parent ff47ad1 commit 98acc9d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion holoviews/core/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def unique_dimkeys(obj, default_dim='Frame'):
for d, k in zip(dims, key):
dim_keys[d.name] = k
if dim_keys:
keys = [tuple(dim_keys[dim.name] for dim in dimensions)]
keys = [tuple(dim_keys.get(dim.name) for dim in dimensions)]
else:
keys = []
return merge_dimensions(dim_groups), keys
Expand Down
2 changes: 1 addition & 1 deletion holoviews/element/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def dframe(self, dimensions=None):
dimensions = [self.get_dimension(d, strict=True) for d in dimensions
if d in dimensions.kdims]
else:
dimensions = dimensions.kdims
dimensions = self.kdims
return self.interface.dframe(self, dimensions)


Expand Down
2 changes: 2 additions & 0 deletions holoviews/element/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def circular_layout(nodes):
Lay out nodes on a circle and add node index.
"""
N = len(nodes)
if not N:
return ([], [], [])
circ = np.pi/N*np.arange(N)*2
x = np.cos(circ)
y = np.sin(circ)
Expand Down
3 changes: 2 additions & 1 deletion holoviews/plotting/bokeh/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def _init_plot_handles(self):
requested[h] = handles[h]
elif h in self.extra_models:
print("Warning %s could not find the %s model. "
"The corresponding stream may not work.")
"The corresponding stream may not work."
% (type(self).__name__, h))
self.handle_ids.update(self._get_stream_handle_ids(requested))

return requested
Expand Down
2 changes: 2 additions & 0 deletions holoviews/plotting/bokeh/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def get_data(self, element, ranges, style):

# Compute statistics
vals = g.dimension_values(g.vdims[0])
vals = vals[np.isfinite(vals)]
if len(vals):
q1, q2, q3 = (np.percentile(vals, q=q)
for q in range(25, 100, 25))
Expand Down Expand Up @@ -322,6 +323,7 @@ def _kde_data(self, el, key, **kwargs):

bars, segments, scatter = defaultdict(list), defaultdict(list), {}
values = el.dimension_values(vdim)
values = values[np.isfinite(values)]
if self.inner == 'quartiles':
for stat_fn in self._stat_fns:
stat = stat_fn(values)
Expand Down

0 comments on commit 98acc9d

Please sign in to comment.