From 6fb7721de74bbb19de4e19f6762d0a00e08a12b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Wed, 19 Jul 2023 11:50:02 +0200 Subject: [PATCH] Add docstring to selector --- holoviews/operation/datashader.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/holoviews/operation/datashader.py b/holoviews/operation/datashader.py index 5d33da0628..24b6c8bd7a 100644 --- a/holoviews/operation/datashader.py +++ b/holoviews/operation/datashader.py @@ -59,14 +59,18 @@ class AggregationOperation(ResampleOperation2D): aggregator parameter used to define a datashader Reduction. """ - aggregator = param.ClassSelector(class_=(rd.Reduction, str, rd.summary), + aggregator = param.ClassSelector(class_=(rd.Reduction, rd.summary, str), default=rd.count(), doc=""" Datashader reduction function used for aggregating the data. The aggregator may also define a column to aggregate; if no column is defined the first value dimension of the element will be used. May also be defined as a string.""") - selector = param.ClassSelector(class_=(rd.min, rd.max, rd.first, rd.last), default=None) + selector = param.ClassSelector(class_=(rd.min, rd.max, rd.first, rd.last), + default=None, doc=""" + Selector is a datashader reduction function used for selecting data. + The selector only works with aggregators which selects an item from + the original data. These selectors are min, max, first and last.""") vdim_prefix = param.String(default='{kdims} ', allow_None=True, doc=""" Prefix to prepend to value dimension name where {kdims} @@ -188,7 +192,6 @@ def _get_agg_params(self, element, x, y, agg_fn, bounds): vdims.nodata = 0 else: vdims = Dimension(f'{vdim_prefix}{agg_name}', label=agg_name, nodata=0) - params['vdims'] = vdims return params @@ -777,7 +780,7 @@ class regrid(AggregationOperation): """ aggregator = param.ClassSelector(default=rd.mean(), - class_=(rd.Reduction, str, rd.summary)) + class_=(rd.Reduction, rd.summary, str)) expand = param.Boolean(default=False, doc=""" Whether the x_range and y_range should be allowed to expand