Skip to content

Commit

Permalink
Fixes after merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 2, 2017
1 parent 03e759f commit 9407a51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions holoviews/core/data/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def groupby(cls, dataset, dim_names, container_type, group_type, **kwargs):
select = dict(zip(dim_names, unique_key))
if drop_dim:
group_data = dataset.select(**select)
group_data = group_data if np.isscalar(group_data) else group_data.columns()
group_data, _ = group_data if np.isscalar(group_data) else (group_data.columns(), None)
else:
group_data = cls.select(dataset, **select)
group_data, _ = cls.select(dataset, **select)
if np.isscalar(group_data):
group_data = {dataset.vdims[0].name: np.atleast_1d(group_data)}
for dim, v in zip(dim_names, unique_key):
Expand Down
16 changes: 8 additions & 8 deletions holoviews/core/data/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ def init(cls, eltype, data, kdims, vdims):
vdims = eltype.vdims

kwargs = {}
dimensions = [d.alias if isinstance(d, Dimension) else
dimensions = [d.name if isinstance(d, Dimension) else
d for d in kdims + vdims]
if isinstance(data, tuple):
data = dict(zip(dimensions, data))
if isinstance(data, dict):
xs, ys = np.asarray(data[kdims[0].alias]), np.asarray(data[kdims[1].alias])
xs, ys = np.asarray(data[kdims[0].name]), np.asarray(data[kdims[1].name])
l, r, xdensity, invertx = util.bound_range(xs, None)
b, t, ydensity, inverty = util.bound_range(ys, None)
kwargs['bounds'] = BoundingBox(points=((l, b), (r, t)))
if len(vdims) == 1:
data = np.flipud(np.asarray(data[vdims[0].alias]))
data = np.flipud(np.asarray(data[vdims[0].name]))
else:
data = np.dstack([np.flipud(data[vd.alias]) for vd in vdims])
data = np.dstack([np.flipud(data[vd.name]) for vd in vdims])
if invertx:
data = data[:, ::-1]
if inverty:
Expand Down Expand Up @@ -123,7 +123,7 @@ def select(cls, dataset, selection_mask=None, **selection):
"""
selection = {k: slice(*sel) if isinstance(sel, tuple) else sel
for k, sel in selection.items()}
coords = tuple(selection[kd.alias] if kd.alias in selection else slice(None)
coords = tuple(selection[kd.name] if kd.name in selection else slice(None)
for kd in dataset.kdims)
if not any([isinstance(el, slice) for el in coords]):
return dataset.data[dataset.sheet2matrixidx(*coords)], {}
Expand Down Expand Up @@ -195,7 +195,7 @@ def sample(cls, dataset, samples=[]):
tuple.
"""
if len(samples[0]) == 1:
return dataset.select(**{dataset.kdims[0].alias:
return dataset.select(**{dataset.kdims[0].name:
[s[0] for s in samples]}).columns()
else:
return [c+(dataset.data[dataset._coord2matrix(c)],)
Expand Down Expand Up @@ -247,7 +247,7 @@ def groupby(cls, dataset, dim_names, container_type, group_type, **kwargs):

@classmethod
def aggregate(cls, dataset, kdims, function, **kwargs):
kdims = [kd.alias if isinstance(kd, Dimension) else kd for kd in kdims]
kdims = [kd.name if isinstance(kd, Dimension) else kd for kd in kdims]
axes = tuple(dataset.ndims-dataset.get_dimension_index(kdim)-1
for kdim in dataset.kdims if kdim not in kdims)

Expand All @@ -256,7 +256,7 @@ def aggregate(cls, dataset, kdims, function, **kwargs):
return data
elif len(axes) == 1:
return {kdims[0]: cls.values(dataset, axes[0], expanded=False),
dataset.vdims[0].alias: data}
dataset.vdims[0].name: data}


Interface.register(ImageInterface)

0 comments on commit 9407a51

Please sign in to comment.