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

Allowed NdMappings with no kdims #841

Merged
merged 1 commit into from
Aug 31, 2016
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
2 changes: 2 additions & 0 deletions holoviews/core/ndmapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ def __getitem__(self, indexslice):
raise IndexError("Boolean index must match length of sliced object")
selection = zip(indexslice, self.data.items())
return self.clone([item for c, item in selection if c])
elif indexslice == () and not self.kdims:
return self.data[()]
elif indexslice in [Ellipsis, ()]:
return self
elif Ellipsis in wrap_tuple(indexslice):
Expand Down
4 changes: 3 additions & 1 deletion holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,9 @@ def get_dynamic_item(map_obj, dimensions, key):
and a corresponding key. The dimensions must be a subset
of the map_obj key dimensions.
"""
if isinstance(key, tuple):
if key == () and not dimensions:
return key, map_obj[()]
elif isinstance(key, tuple):
dims = {d.name: k for d, k in zip(dimensions, key)
if d in map_obj.kdims}
key = tuple(dims.get(d.name) for d in map_obj.kdims)
Expand Down
3 changes: 2 additions & 1 deletion holoviews/plotting/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def _validate(self, obj, fmt):

if fmt in ['auto', None]:
if ((len(plot) == 1 and not plot.dynamic)
or (len(plot) > 1 and self.holomap is None)):
or (len(plot) > 1 and self.holomap is None) or
(plot.dynamic and len(plot.keys[0]) == 0)):
fmt = fig_formats[0] if self.fig=='auto' else self.fig
else:
fmt = holomap_formats[0] if self.holomap=='auto' else self.holomap
Expand Down