Skip to content

Commit

Permalink
Improved GridColumns validation
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 9, 2016
1 parent 49e729a commit a5d134b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions holoviews/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,18 @@ def reshape(cls, eltype, data, kdims, vdims):
if vdims is None:
vdims = eltype.vdims

if not vdims:
raise ValueError('GridColumns interface requires at least '
'one value dimension.')

dimensions = [d.name if isinstance(d, Dimension) else
d for d in kdims + vdims]
if isinstance(data, tuple):
data = {d: v for d, v in zip(dimensions, data)}
else):
raise ValueError('GridColumns must be instantiated as a '
'dictionary or tuple')

if 'vdims' in data:
vdim_array = data.pop('vdims')
for i, vdim in enumerate(vdims):
Expand Down

0 comments on commit a5d134b

Please sign in to comment.