Skip to content

Commit

Permalink
Calling a Dimensioned object with no argument now resets the ids
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Jun 25, 2015
1 parent 187cc11 commit 9e8c343
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions holoviews/core/dimension.py
Expand Up @@ -738,7 +738,8 @@ def __repr__(self):
def __call__(self, options=None, **kwargs):
"""
Apply the supplied options to a clone of the object which is
then returned.
then returned. Note that if no options are supplied at all,
all ids are reset.
"""
groups = set(Store.options().groups.keys())
if kwargs and set(kwargs) <= groups:
Expand All @@ -757,7 +758,11 @@ def __call__(self, options=None, **kwargs):
identifier = self.__class__.__name__

kwargs = {k:{identifier:v} for k,v in kwargs.items()}
deep_clone = self.map(lambda x: x.clone(id=x.id))

if options is None and kwargs=={}:
deep_clone = self.map(lambda x: x.clone(id=None))
else:
deep_clone = self.map(lambda x: x.clone(id=x.id))
StoreOptions.set_options(deep_clone, options, **kwargs)
return deep_clone

Expand Down

0 comments on commit 9e8c343

Please sign in to comment.