Skip to content

Commit

Permalink
Let GridColumns reindex expand format as required
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 22, 2016
1 parent 1e32595 commit dac5beb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions holoviews/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,10 @@ def aggregate(cls, columns, kdims, function, **kwargs):
@classmethod
def reindex(cls, columns, kdims, vdims):
dropped_kdims = [kd for kd in columns.kdims if kd not in kdims]
if dropped_kdims and any(len(columns.data[kd.name]) > 1 for kd in dropped_kdims):
raise ValueError('Compressed format does not allow dropping key dimensions '
'which are not constant.')
if (any(kd for kd in kdims if kd not in columns.kdims) or
any(vd for vd in vdims if vd not in columns.vdims)):
if dropped_kdims and all(len(columns.data[kd.name]) == 1 for kd in dropped_kdims):
pass
elif (any(kd for kd in kdims if kd not in columns.kdims) or
any(vd for vd in vdims if vd not in columns.vdims)) or dropped_kdims:
return columns.clone(columns.columns()).reindex(kdims, vdims)
dropped_vdims = ([vdim for vdim in columns.vdims
if vdim not in vdims] if vdims else [])
Expand Down

0 comments on commit dac5beb

Please sign in to comment.