diff --git a/holoviews/__init__.py b/holoviews/__init__.py index 3f8a8ea6e7..475cc977c6 100644 --- a/holoviews/__init__.py +++ b/holoviews/__init__.py @@ -24,7 +24,7 @@ GridSpace, GridMatrix) from .interface import * # noqa (API import) -from .operation import ElementOperation, MapOperation, TreeOperation # noqa (API import) +from .operation import ElementOperation, TreeOperation # noqa (API import) from .element import * # noqa (API import) from .element import __all__ as elements_list from . import util # noqa (API import) diff --git a/holoviews/core/operation.py b/holoviews/core/operation.py index 4ab2118260..7fed0f0423 100644 --- a/holoviews/core/operation.py +++ b/holoviews/core/operation.py @@ -185,36 +185,6 @@ def __init__(self, callable, **kwargs): super(OperationCallable, self).__init__(callable, **kwargs) -class MapOperation(param.ParameterizedFunction): - """ - A MapOperation takes a HoloMap containing elements or overlays and - processes them at the HoloMap level, returning arbitrary new - HoloMap objects as output. Unlike ElementOperation, MapOperations - can compute over all the keys and dimensions of the input map. - """ - - group = param.String(default='MapOperation', doc=""" - The group string to identify the output of the MapOperation. - By default this will match the MapOperation name.""") - - def __call__(self, vmap, **params): - self.p = param.ParamOverrides(self, params) - - if not isinstance(vmap, HoloMap): - raise Exception('MapOperation can only process Maps.') - - return self._process(vmap) - - - def _process(self, view): - """ - Process a single input HoloMap, returning a new HoloMap - instance. - """ - raise NotImplementedError - - - class TreeOperation(Operation): """ A TreeOperation is the most general Operation type; it accepts any diff --git a/holoviews/core/spaces.py b/holoviews/core/spaces.py index 4f84ea30e0..a7ec9d0723 100644 --- a/holoviews/core/spaces.py +++ b/holoviews/core/spaces.py @@ -259,7 +259,6 @@ def collapse(self, dimensions=None, function=None, spreadfn=None, **kwargs): on the HoloMap. Homogenous Elements may be collapsed by supplying a function, inhomogenous elements are merged. """ - from .operation import MapOperation if not dimensions: dimensions = self.kdims if not isinstance(dimensions, list): dimensions = [dimensions] @@ -273,18 +272,15 @@ def collapse(self, dimensions=None, function=None, spreadfn=None, **kwargs): collapsed = groups.clone(shared_data=False) for key, group in groups.items(): - if isinstance(function, MapOperation): - collapsed[key] = function(group, **kwargs) - else: - group_data = [el.data for el in group] - args = (group_data, function, group.last.kdims) - if hasattr(group.last, 'interface'): - col_data = group.type(group.table().aggregate(group.last.kdims, function, spreadfn, **kwargs)) + group_data = [el.data for el in group] + args = (group_data, function, group.last.kdims) + if hasattr(group.last, 'interface'): + col_data = group.type(group.table().aggregate(group.last.kdims, function, spreadfn, **kwargs)) - else: - data = group.type.collapse_data(*args, **kwargs) - col_data = group.last.clone(data) - collapsed[key] = col_data + else: + data = group.type.collapse_data(*args, **kwargs) + col_data = group.last.clone(data) + collapsed[key] = col_data return collapsed if self.ndims > 1 else collapsed.last diff --git a/holoviews/operation/__init__.py b/holoviews/operation/__init__.py index e50de18937..a2c179e9dd 100644 --- a/holoviews/operation/__init__.py +++ b/holoviews/operation/__init__.py @@ -1,4 +1,4 @@ -from ..core.operation import ElementOperation, MapOperation, TreeOperation # noqa (API import) +from ..core.operation import ElementOperation, TreeOperation # noqa (API import) from ..core.options import Compositor from .element import * # noqa (API import) @@ -6,7 +6,7 @@ def public(obj): if not isinstance(obj, type): return False - baseclasses = [ElementOperation, MapOperation, TreeOperation] + baseclasses = [ElementOperation, TreeOperation] return any([issubclass(obj, bc) for bc in baseclasses])