Skip to content

Commit

Permalink
Ignore non-referenced data in dictionary format
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jul 6, 2018
1 parent 435f00c commit 50340f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions holoviews/core/data/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def init(cls, eltype, data, kdims, vdims):
if not np.isscalar(vals) and not vals.ndim == 1 and d in dimensions:
raise ValueError('DictInterface expects data for each column to be flat.')
unpacked.append((d, vals))
if not cls.expanded([d[1] for d in unpacked if not np.isscalar(d[1])]):
if not cls.expanded([v for d, v in unpacked if d in dimensions and not np.isscalar(v)]):
raise ValueError('DictInterface expects data to be of uniform shape.')
if isinstance(data, odict_types):
data.update(unpacked)
Expand Down Expand Up @@ -158,7 +158,7 @@ def shape(cls, dataset):

@classmethod
def length(cls, dataset):
lengths = [len(vals) for vals in dataset.data.values() if not np.isscalar(vals)]
lengths = [len(vals) for d, vals in dataset.data.items() if d in dataset.dimensions() and not np.isscalar(vals)]
return max(lengths) if lengths else 1

@classmethod
Expand Down

0 comments on commit 50340f0

Please sign in to comment.