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

Drop usages of len(Element) #1155

Merged
merged 1 commit into from
Feb 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def initialize_plot(self, ranges=None, plot=None, plots=None, source=None):
"""
# Get element key and ranges for frame
if self.batched:
element = [el for el in self.hmap.data.values() if len(el)][-1]
element = [el for el in self.hmap.data.values() if el][-1]
else:
element = self.hmap.last
key = self.keys[-1]
Expand Down Expand Up @@ -1175,7 +1175,7 @@ def _get_factors(self, overlay):

def initialize_plot(self, ranges=None, plot=None, plots=None):
key = self.keys[-1]
nonempty = [el for el in self.hmap.data.values() if len(el)]
nonempty = [el for el in self.hmap.data.values() if el]
if not nonempty:
raise SkipRendering('All Overlays empty, cannot initialize plot.')
element = nonempty[-1]
Expand Down
2 changes: 1 addition & 1 deletion holoviews/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def __init__(self, element, keys=None, ranges=None, dimensions=None,

plot_element = self.hmap.last
if self.batched and not isinstance(self, GenericOverlayPlot):
plot_element = [el for el in plot_element if len(el) > 0][-1]
plot_element = [el for el in plot_element if el][-1]

top_level = keys is None
if top_level:
Expand Down