Skip to content

Commit

Permalink
Fixed flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Dec 6, 2019
1 parent 7a4119e commit b56dd9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
17 changes: 9 additions & 8 deletions holoviews/core/data/spatialpandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def dtype(cls, dataset, dimension):

@classmethod
def has_holes(cls, dataset):
from spatialpandas.geometry import MultiPolygonDtype, PolygonDtype
from spatialpandas.geometry import (
MultiPolygonDtype, PolygonDtype, Polygon, MultiPolygon
)
col = cls.geo_column(dataset.data)
series = dataset.data[col]
if isinstance(series.dtype, (MultiPolygonDtype, PolygonDtype)):
Expand All @@ -146,7 +148,6 @@ def has_holes(cls, dataset):

@classmethod
def holes(cls, dataset):
from spatialpandas.geometry import MultiPolygonDtype, PolygonDtype
holes = []
if not len(dataset.data):
return holes
Expand Down Expand Up @@ -277,22 +278,22 @@ def range(cls, dataset, dim):
vals = dataset.data[dim.name]
return vals.min(), vals.max()

@classmethod
def aggregate(cls, columns, dimensions, function, **kwargs):
raise NotImplementedError

@classmethod
def groupby(cls, columns, dimensions, container_type, group_type, **kwargs):
return PandasInterface.groupby(columns, dimensions, container_type, group_type, **kwargs)

@classmethod
def reindex(cls, dataset, kdims=None, vdims=None):
return dataset.data
def aggregate(cls, columns, dimensions, function, **kwargs):
raise NotImplementedError

@classmethod
def sample(cls, columns, samples=[]):
raise NotImplementedError

@classmethod
def reindex(cls, dataset, kdims=None, vdims=None):
return dataset.data

@classmethod
def shape(cls, dataset):
return PandasInterface.shape(dataset)
Expand Down
5 changes: 2 additions & 3 deletions holoviews/operation/datashader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,11 @@ def _process(self, element, key=None):
x0, x1 = x_range
y0, y1 = y_range

params = self._get_agg_params(element, xdim, ydim, agg_fn, (x0, y0, x1, y1))

if width == 0 or height == 0:
return self._empty_agg(element, xdim, ydim, width, height, xs, ys, agg_fn, **params)

params = self._get_agg_params(element, xdim, ydim, agg_fn, (x0, y0, x1, y1))

cvs = ds.Canvas(plot_width=width, plot_height=height,
x_range=x_range, y_range=y_range)

Expand All @@ -1107,7 +1107,6 @@ def _process(self, element, key=None):
if isinstance(agg_fn, ds.count_cat):
data[agg_fn.column] = data[agg_fn.column].astype('category')
col = element.interface.geo_column(element.data)
geoms = data[col]

if isinstance(element, Polygons) :
agg = cvs.polygons(data, geometry=col, agg=agg_fn)
Expand Down

0 comments on commit b56dd9d

Please sign in to comment.