Skip to content

Commit

Permalink
Image.select prefers the same datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Jun 22, 2017
1 parent 7c3a63f commit 8476d5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions holoviews/element/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,15 @@ def select(self, selection_specs=None, **selection):
selection = (y, x)
sliced = False

datatype = list(util.unique_iterator([self.interface.datatype]+self.datatype))
data = self.interface.ndloc(self, selection)
if not sliced:
if np.isscalar(data):
return data
return self.clone(data[self.ndims:], kdims=[], new_type=Dataset)
return self.clone(data[self.ndims:], kdims=[], new_type=Dataset,
datatype=datatype)
else:
return self.clone(data, xdensity=self.xdensity,
return self.clone(data, xdensity=self.xdensity, datatype=datatype,
ydensity=self.ydensity, bounds=bounds)


Expand Down

0 comments on commit 8476d5a

Please sign in to comment.