partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
BoundingBox.containsbb_exclusive
Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive.
holoviews/core/boundingregion.py
def containsbb_exclusive(self, x): """ Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive. """ left, bottom, right, top = self.aarect().lbrt() leftx, bottomx, rightx, to...
def containsbb_exclusive(self, x): """ Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive. """ left, bottom, right, top = self.aarect().lbrt() leftx, bottomx, rightx, to...
[ "Returns", "true", "if", "the", "given", "BoundingBox", "x", "is", "contained", "within", "the", "bounding", "box", "where", "at", "least", "one", "of", "the", "boundaries", "of", "the", "box", "has", "to", "be", "exclusive", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/boundingregion.py#L167-L176
[ "def", "containsbb_exclusive", "(", "self", ",", "x", ")", ":", "left", ",", "bottom", ",", "right", ",", "top", "=", "self", ".", "aarect", "(", ")", ".", "lbrt", "(", ")", "leftx", ",", "bottomx", ",", "rightx", ",", "topx", "=", "x", ".", "aar...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
AARectangle.lbrt
Return (left,bottom,right,top) as a tuple.
holoviews/core/boundingregion.py
def lbrt(self): """Return (left,bottom,right,top) as a tuple.""" return self._left, self._bottom, self._right, self._top
def lbrt(self): """Return (left,bottom,right,top) as a tuple.""" return self._left, self._bottom, self._right, self._top
[ "Return", "(", "left", "bottom", "right", "top", ")", "as", "a", "tuple", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/boundingregion.py#L298-L300
[ "def", "lbrt", "(", "self", ")", ":", "return", "self", ".", "_left", ",", "self", ".", "_bottom", ",", "self", ".", "_right", ",", "self", ".", "_top" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
AARectangle.centroid
Return the centroid of the rectangle.
holoviews/core/boundingregion.py
def centroid(self): """ Return the centroid of the rectangle. """ left, bottom, right, top = self.lbrt() return (right + left) / 2.0, (top + bottom) / 2.0
def centroid(self): """ Return the centroid of the rectangle. """ left, bottom, right, top = self.lbrt() return (right + left) / 2.0, (top + bottom) / 2.0
[ "Return", "the", "centroid", "of", "the", "rectangle", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/boundingregion.py#L303-L308
[ "def", "centroid", "(", "self", ")", ":", "left", ",", "bottom", ",", "right", ",", "top", "=", "self", ".", "lbrt", "(", ")", "return", "(", "right", "+", "left", ")", "/", "2.0", ",", "(", "top", "+", "bottom", ")", "/", "2.0" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_nested_dmaps
Recurses DynamicMap to find DynamicMaps inputs Args: dmap: DynamicMap to recurse to look for DynamicMap inputs Returns: List of DynamicMap instances that were found
holoviews/core/spaces.py
def get_nested_dmaps(dmap): """Recurses DynamicMap to find DynamicMaps inputs Args: dmap: DynamicMap to recurse to look for DynamicMap inputs Returns: List of DynamicMap instances that were found """ if not isinstance(dmap, DynamicMap): return [] dmaps = [dmap] for ...
def get_nested_dmaps(dmap): """Recurses DynamicMap to find DynamicMaps inputs Args: dmap: DynamicMap to recurse to look for DynamicMap inputs Returns: List of DynamicMap instances that were found """ if not isinstance(dmap, DynamicMap): return [] dmaps = [dmap] for ...
[ "Recurses", "DynamicMap", "to", "find", "DynamicMaps", "inputs" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L778-L792
[ "def", "get_nested_dmaps", "(", "dmap", ")", ":", "if", "not", "isinstance", "(", "dmap", ",", "DynamicMap", ")", ":", "return", "[", "]", "dmaps", "=", "[", "dmap", "]", "for", "o", "in", "dmap", ".", "callback", ".", "inputs", ":", "dmaps", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_nested_streams
Recurses supplied DynamicMap to find all streams Args: dmap: DynamicMap to recurse to look for streams Returns: List of streams that were found
holoviews/core/spaces.py
def get_nested_streams(dmap): """Recurses supplied DynamicMap to find all streams Args: dmap: DynamicMap to recurse to look for streams Returns: List of streams that were found """ return list({s for dmap in get_nested_dmaps(dmap) for s in dmap.streams})
def get_nested_streams(dmap): """Recurses supplied DynamicMap to find all streams Args: dmap: DynamicMap to recurse to look for streams Returns: List of streams that were found """ return list({s for dmap in get_nested_dmaps(dmap) for s in dmap.streams})
[ "Recurses", "supplied", "DynamicMap", "to", "find", "all", "streams" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L795-L804
[ "def", "get_nested_streams", "(", "dmap", ")", ":", "return", "list", "(", "{", "s", "for", "dmap", "in", "get_nested_dmaps", "(", "dmap", ")", "for", "s", "in", "dmap", ".", "streams", "}", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dynamicmap_memoization
Determine whether the Callable should have memoization enabled based on the supplied streams (typically by a DynamicMap). Memoization is disabled if any of the streams require it it and are currently in a triggered state.
holoviews/core/spaces.py
def dynamicmap_memoization(callable_obj, streams): """ Determine whether the Callable should have memoization enabled based on the supplied streams (typically by a DynamicMap). Memoization is disabled if any of the streams require it it and are currently in a triggered state. """ memoization...
def dynamicmap_memoization(callable_obj, streams): """ Determine whether the Callable should have memoization enabled based on the supplied streams (typically by a DynamicMap). Memoization is disabled if any of the streams require it it and are currently in a triggered state. """ memoization...
[ "Determine", "whether", "the", "Callable", "should", "have", "memoization", "enabled", "based", "on", "the", "supplied", "streams", "(", "typically", "by", "a", "DynamicMap", ")", ".", "Memoization", "is", "disabled", "if", "any", "of", "the", "streams", "requ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L808-L822
[ "def", "dynamicmap_memoization", "(", "callable_obj", ",", "streams", ")", ":", "memoization_state", "=", "bool", "(", "callable_obj", ".", "_stream_memoization", ")", "callable_obj", ".", "_stream_memoization", "&=", "not", "any", "(", "s", ".", "transient", "and...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.overlay
Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: NdOverlay object(s) with supplied dimensions
holoviews/core/spaces.py
def overlay(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: N...
def overlay(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: N...
[ "Group", "by", "supplied", "dimension", "(", "s", ")", "and", "overlay", "each", "group" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L44-L62
[ "def", "overlay", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "dimensions", "=", "self", ".", "_valid_dimensions", "(", "dimensions", ")", "if", "len", "(", "dimensions", ")", "==", "self", ".", "ndims", ":", "with",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.grid
Group by supplied dimension(s) and lay out groups in grid Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: Grid...
holoviews/core/spaces.py
def grid(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and lay out groups in grid Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace. Args: dimensions: Dimension/str or list Dimension or list of dim...
def grid(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and lay out groups in grid Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace. Args: dimensions: Dimension/str or list Dimension or list of dim...
[ "Group", "by", "supplied", "dimension", "(", "s", ")", "and", "lay", "out", "groups", "in", "grid" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L65-L82
[ "def", "grid", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "dimensions", "=", "self", ".", "_valid_dimensions", "(", "dimensions", ")", "if", "len", "(", "dimensions", ")", "==", "self", ".", "ndims", ":", "with", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.layout
Group by supplied dimension(s) and lay out groups Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout. Args: dimensions: Dimension(s) to group by Returns: NdLayout with supplied dimensions
holoviews/core/spaces.py
def layout(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and lay out groups Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout. Args: dimensions: Dimension(s) to group by Returns: NdLayo...
def layout(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and lay out groups Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout. Args: dimensions: Dimension(s) to group by Returns: NdLayo...
[ "Group", "by", "supplied", "dimension", "(", "s", ")", "and", "lay", "out", "groups" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L85-L101
[ "def", "layout", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "dimensions", "=", "self", ".", "_valid_dimensions", "(", "dimensions", ")", "if", "len", "(", "dimensions", ")", "==", "self", ".", "ndims", ":", "with", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.options
Applies simplified option definition returning a new object Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects in the HoloMap a simple format may be used, e.g.: obj.options(cmap='viridis',...
holoviews/core/spaces.py
def options(self, *args, **kwargs): """Applies simplified option definition returning a new object Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects in the HoloMap a simple format may be used,...
def options(self, *args, **kwargs): """Applies simplified option definition returning a new object Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects in the HoloMap a simple format may be used,...
[ "Applies", "simplified", "option", "definition", "returning", "a", "new", "object" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L104-L141
[ "def", "options", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "data", "=", "OrderedDict", "(", "[", "(", "k", ",", "v", ".", "options", "(", "*", "args", ",", "*", "*", "kwargs", ")", ")", "for", "k", ",", "v", "in", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.split_overlays
Deprecated method to split overlays inside the HoloMap.
holoviews/core/spaces.py
def split_overlays(self): "Deprecated method to split overlays inside the HoloMap." if util.config.future_deprecations: self.param.warning("split_overlays is deprecated and is now " "a private method.") return self._split_overlays()
def split_overlays(self): "Deprecated method to split overlays inside the HoloMap." if util.config.future_deprecations: self.param.warning("split_overlays is deprecated and is now " "a private method.") return self._split_overlays()
[ "Deprecated", "method", "to", "split", "overlays", "inside", "the", "HoloMap", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L144-L149
[ "def", "split_overlays", "(", "self", ")", ":", "if", "util", ".", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", "warning", "(", "\"split_overlays is deprecated and is now \"", "\"a private method.\"", ")", "return", "self", ".", "_split_over...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap._split_overlays
Splits overlays inside the HoloMap into list of HoloMaps
holoviews/core/spaces.py
def _split_overlays(self): "Splits overlays inside the HoloMap into list of HoloMaps" if not issubclass(self.type, CompositeOverlay): return None, self.clone() item_maps = OrderedDict() for k, overlay in self.data.items(): for key, el in overlay.items(): ...
def _split_overlays(self): "Splits overlays inside the HoloMap into list of HoloMaps" if not issubclass(self.type, CompositeOverlay): return None, self.clone() item_maps = OrderedDict() for k, overlay in self.data.items(): for key, el in overlay.items(): ...
[ "Splits", "overlays", "inside", "the", "HoloMap", "into", "list", "of", "HoloMaps" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L152-L169
[ "def", "_split_overlays", "(", "self", ")", ":", "if", "not", "issubclass", "(", "self", ".", "type", ",", "CompositeOverlay", ")", ":", "return", "None", ",", "self", ".", "clone", "(", ")", "item_maps", "=", "OrderedDict", "(", ")", "for", "k", ",", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap._dimension_keys
Helper for __mul__ that returns the list of keys together with the dimension labels.
holoviews/core/spaces.py
def _dimension_keys(self): """ Helper for __mul__ that returns the list of keys together with the dimension labels. """ return [tuple(zip([d.name for d in self.kdims], [k] if self.ndims == 1 else k)) for k in self.keys()]
def _dimension_keys(self): """ Helper for __mul__ that returns the list of keys together with the dimension labels. """ return [tuple(zip([d.name for d in self.kdims], [k] if self.ndims == 1 else k)) for k in self.keys()]
[ "Helper", "for", "__mul__", "that", "returns", "the", "list", "of", "keys", "together", "with", "the", "dimension", "labels", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L172-L178
[ "def", "_dimension_keys", "(", "self", ")", ":", "return", "[", "tuple", "(", "zip", "(", "[", "d", ".", "name", "for", "d", "in", "self", ".", "kdims", "]", ",", "[", "k", "]", "if", "self", ".", "ndims", "==", "1", "else", "k", ")", ")", "f...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap._dynamic_mul
Implements dynamic version of overlaying operation overlaying DynamicMaps and HoloMaps where the key dimensions of one is a strict superset of the other.
holoviews/core/spaces.py
def _dynamic_mul(self, dimensions, other, keys): """ Implements dynamic version of overlaying operation overlaying DynamicMaps and HoloMaps where the key dimensions of one is a strict superset of the other. """ # If either is a HoloMap compute Dimension values if ...
def _dynamic_mul(self, dimensions, other, keys): """ Implements dynamic version of overlaying operation overlaying DynamicMaps and HoloMaps where the key dimensions of one is a strict superset of the other. """ # If either is a HoloMap compute Dimension values if ...
[ "Implements", "dynamic", "version", "of", "overlaying", "operation", "overlaying", "DynamicMaps", "and", "HoloMaps", "where", "the", "key", "dimensions", "of", "one", "is", "a", "strict", "superset", "of", "the", "other", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L181-L225
[ "def", "_dynamic_mul", "(", "self", ",", "dimensions", ",", "other", ",", "keys", ")", ":", "# If either is a HoloMap compute Dimension values", "if", "not", "isinstance", "(", "self", ",", "DynamicMap", ")", "or", "not", "isinstance", "(", "other", ",", "Dynami...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.collate
Collate allows reordering nested containers Collation allows collapsing nested mapping types by merging their dimensions. In simple terms in merges nested containers into a single merged type. In the simple case a HoloMap containing other HoloMaps can easily be joined in this w...
holoviews/core/spaces.py
def collate(self, merge_type=None, drop=[], drop_constant=False): """Collate allows reordering nested containers Collation allows collapsing nested mapping types by merging their dimensions. In simple terms in merges nested containers into a single merged type. In the simple ca...
def collate(self, merge_type=None, drop=[], drop_constant=False): """Collate allows reordering nested containers Collation allows collapsing nested mapping types by merging their dimensions. In simple terms in merges nested containers into a single merged type. In the simple ca...
[ "Collate", "allows", "reordering", "nested", "containers" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L322-L349
[ "def", "collate", "(", "self", ",", "merge_type", "=", "None", ",", "drop", "=", "[", "]", ",", "drop_constant", "=", "False", ")", ":", "from", ".", "element", "import", "Collator", "merge_type", "=", "merge_type", "if", "merge_type", "else", "self", "....
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.collapse
Concatenates and aggregates along supplied dimensions Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves. Args: dimensions: Dimension(s) to collapse Defaults to all key dimensions function: Aggregation ...
holoviews/core/spaces.py
def collapse(self, dimensions=None, function=None, spreadfn=None, **kwargs): """Concatenates and aggregates along supplied dimensions Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves. Args: dimensions: Dimension(s) to co...
def collapse(self, dimensions=None, function=None, spreadfn=None, **kwargs): """Concatenates and aggregates along supplied dimensions Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves. Args: dimensions: Dimension(s) to co...
[ "Concatenates", "and", "aggregates", "along", "supplied", "dimensions" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L352-L396
[ "def", "collapse", "(", "self", ",", "dimensions", "=", "None", ",", "function", "=", "None", ",", "spreadfn", "=", "None", ",", "*", "*", "kwargs", ")", ":", "from", ".", "data", "import", "concat", "if", "not", "dimensions", ":", "dimensions", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.sample
Samples element values at supplied coordinates. Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures: Sampling with a list of coordinates, e.g.: ds.sampl...
holoviews/core/spaces.py
def sample(self, samples=[], bounds=None, **sample_values): """Samples element values at supplied coordinates. Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures: ...
def sample(self, samples=[], bounds=None, **sample_values): """Samples element values at supplied coordinates. Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures: ...
[ "Samples", "element", "values", "at", "supplied", "coordinates", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L399-L469
[ "def", "sample", "(", "self", ",", "samples", "=", "[", "]", ",", "bounds", "=", "None", ",", "*", "*", "sample_values", ")", ":", "if", "util", ".", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", "warning", "(", "'The HoloMap.sa...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.reduce
Applies reduction to elements along the specified dimension(s). Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures: Reducing with a list of dimensions, e.g.: ds.reduce(['x'], np.mean) Defining a reduction using k...
holoviews/core/spaces.py
def reduce(self, dimensions=None, function=None, spread_fn=None, **reduce_map): """Applies reduction to elements along the specified dimension(s). Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures: Reducing with a list of dim...
def reduce(self, dimensions=None, function=None, spread_fn=None, **reduce_map): """Applies reduction to elements along the specified dimension(s). Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures: Reducing with a list of dim...
[ "Applies", "reduction", "to", "elements", "along", "the", "specified", "dimension", "(", "s", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L472-L512
[ "def", "reduce", "(", "self", ",", "dimensions", "=", "None", ",", "function", "=", "None", ",", "spread_fn", "=", "None", ",", "*", "*", "reduce_map", ")", ":", "if", "util", ".", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.relabel
Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to wh...
holoviews/core/spaces.py
def relabel(self, label=None, group=None, depth=1): """Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to...
def relabel(self, label=None, group=None, depth=1): """Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to...
[ "Clone", "object", "and", "apply", "new", "group", "and", "/", "or", "label", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L515-L530
[ "def", "relabel", "(", "self", ",", "label", "=", "None", ",", "group", "=", "None", ",", "depth", "=", "1", ")", ":", "return", "super", "(", "HoloMap", ",", "self", ")", ".", "relabel", "(", "label", "=", "label", ",", "group", "=", "group", ",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HoloMap.hist
Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (t...
holoviews/core/spaces.py
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, individually=True, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: ...
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, individually=True, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: ...
[ "Computes", "and", "adjoins", "histogram", "along", "specified", "dimension", "(", "s", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L533-L587
[ "def", "hist", "(", "self", ",", "dimension", "=", "None", ",", "num_bins", "=", "20", ",", "bin_range", "=", "None", ",", "adjoin", "=", "True", ",", "individually", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "dimension", "is", "not", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Callable.noargs
Returns True if the callable takes no arguments
holoviews/core/spaces.py
def noargs(self): "Returns True if the callable takes no arguments" noargs = inspect.ArgSpec(args=[], varargs=None, keywords=None, defaults=None) return self.argspec == noargs
def noargs(self): "Returns True if the callable takes no arguments" noargs = inspect.ArgSpec(args=[], varargs=None, keywords=None, defaults=None) return self.argspec == noargs
[ "Returns", "True", "if", "the", "callable", "takes", "no", "arguments" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L663-L666
[ "def", "noargs", "(", "self", ")", ":", "noargs", "=", "inspect", ".", "ArgSpec", "(", "args", "=", "[", "]", ",", "varargs", "=", "None", ",", "keywords", "=", "None", ",", "defaults", "=", "None", ")", "return", "self", ".", "argspec", "==", "noa...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Callable.clone
Clones the Callable optionally with new settings Args: callable: New callable function to wrap **overrides: Parameter overrides to apply Returns: Cloned Callable object
holoviews/core/spaces.py
def clone(self, callable=None, **overrides): """Clones the Callable optionally with new settings Args: callable: New callable function to wrap **overrides: Parameter overrides to apply Returns: Cloned Callable object """ old = {k: v for k, v ...
def clone(self, callable=None, **overrides): """Clones the Callable optionally with new settings Args: callable: New callable function to wrap **overrides: Parameter overrides to apply Returns: Cloned Callable object """ old = {k: v for k, v ...
[ "Clones", "the", "Callable", "optionally", "with", "new", "settings" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L669-L683
[ "def", "clone", "(", "self", ",", "callable", "=", "None", ",", "*", "*", "overrides", ")", ":", "old", "=", "{", "k", ":", "v", "for", "k", ",", "v", "in", "self", ".", "get_param_values", "(", ")", "if", "k", "not", "in", "[", "'callable'", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.unbounded
Returns a list of key dimensions that are unbounded, excluding stream parameters. If any of theses key dimensions are unbounded, the DynamicMap as a whole is also unbounded.
holoviews/core/spaces.py
def unbounded(self): """ Returns a list of key dimensions that are unbounded, excluding stream parameters. If any of theses key dimensions are unbounded, the DynamicMap as a whole is also unbounded. """ unbounded_dims = [] # Dimensioned streams do not need to be b...
def unbounded(self): """ Returns a list of key dimensions that are unbounded, excluding stream parameters. If any of theses key dimensions are unbounded, the DynamicMap as a whole is also unbounded. """ unbounded_dims = [] # Dimensioned streams do not need to be b...
[ "Returns", "a", "list", "of", "key", "dimensions", "that", "are", "unbounded", "excluding", "stream", "parameters", ".", "If", "any", "of", "theses", "key", "dimensions", "are", "unbounded", "the", "DynamicMap", "as", "a", "whole", "is", "also", "unbounded", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L962-L978
[ "def", "unbounded", "(", "self", ")", ":", "unbounded_dims", "=", "[", "]", "# Dimensioned streams do not need to be bounded", "stream_params", "=", "set", "(", "util", ".", "stream_parameters", "(", "self", ".", "streams", ")", ")", "for", "kdim", "in", "self",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._initial_key
Construct an initial key for based on the lower range bounds or values on the key dimensions.
holoviews/core/spaces.py
def _initial_key(self): """ Construct an initial key for based on the lower range bounds or values on the key dimensions. """ key = [] undefined = [] stream_params = set(util.stream_parameters(self.streams)) for kdim in self.kdims: if str(kdim)...
def _initial_key(self): """ Construct an initial key for based on the lower range bounds or values on the key dimensions. """ key = [] undefined = [] stream_params = set(util.stream_parameters(self.streams)) for kdim in self.kdims: if str(kdim)...
[ "Construct", "an", "initial", "key", "for", "based", "on", "the", "lower", "range", "bounds", "or", "values", "on", "the", "key", "dimensions", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L980-L1008
[ "def", "_initial_key", "(", "self", ")", ":", "key", "=", "[", "]", "undefined", "=", "[", "]", "stream_params", "=", "set", "(", "util", ".", "stream_parameters", "(", "self", ".", "streams", ")", ")", "for", "kdim", "in", "self", ".", "kdims", ":",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._validate_key
Make sure the supplied key values are within the bounds specified by the corresponding dimension range and soft_range.
holoviews/core/spaces.py
def _validate_key(self, key): """ Make sure the supplied key values are within the bounds specified by the corresponding dimension range and soft_range. """ if key == () and len(self.kdims) == 0: return () key = util.wrap_tuple(key) assert len(key) == len(self.kdi...
def _validate_key(self, key): """ Make sure the supplied key values are within the bounds specified by the corresponding dimension range and soft_range. """ if key == () and len(self.kdims) == 0: return () key = util.wrap_tuple(key) assert len(key) == len(self.kdi...
[ "Make", "sure", "the", "supplied", "key", "values", "are", "within", "the", "bounds", "specified", "by", "the", "corresponding", "dimension", "range", "and", "soft_range", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1011-L1029
[ "def", "_validate_key", "(", "self", ",", "key", ")", ":", "if", "key", "==", "(", ")", "and", "len", "(", "self", ".", "kdims", ")", "==", "0", ":", "return", "(", ")", "key", "=", "util", ".", "wrap_tuple", "(", "key", ")", "assert", "len", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.event
Updates attached streams and triggers events Automatically find streams matching the supplied kwargs to update and trigger events on them. Args: **kwargs: Events to update streams with
holoviews/core/spaces.py
def event(self, **kwargs): """Updates attached streams and triggers events Automatically find streams matching the supplied kwargs to update and trigger events on them. Args: **kwargs: Events to update streams with """ if self.callback.noargs and self.stream...
def event(self, **kwargs): """Updates attached streams and triggers events Automatically find streams matching the supplied kwargs to update and trigger events on them. Args: **kwargs: Events to update streams with """ if self.callback.noargs and self.stream...
[ "Updates", "attached", "streams", "and", "triggers", "events" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1031-L1067
[ "def", "event", "(", "self", ",", "*", "*", "kwargs", ")", ":", "if", "self", ".", "callback", ".", "noargs", "and", "self", ".", "streams", "==", "[", "]", ":", "self", ".", "param", ".", "warning", "(", "'No streams declared. To update a DynamicMaps usin...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._style
Applies custom option tree to values return by the callback.
holoviews/core/spaces.py
def _style(self, retval): "Applies custom option tree to values return by the callback." if self.id not in Store.custom_options(): return retval spec = StoreOptions.tree_to_dict(Store.custom_options()[self.id]) return retval.opts(spec)
def _style(self, retval): "Applies custom option tree to values return by the callback." if self.id not in Store.custom_options(): return retval spec = StoreOptions.tree_to_dict(Store.custom_options()[self.id]) return retval.opts(spec)
[ "Applies", "custom", "option", "tree", "to", "values", "return", "by", "the", "callback", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1070-L1075
[ "def", "_style", "(", "self", ",", "retval", ")", ":", "if", "self", ".", "id", "not", "in", "Store", ".", "custom_options", "(", ")", ":", "return", "retval", "spec", "=", "StoreOptions", ".", "tree_to_dict", "(", "Store", ".", "custom_options", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._execute_callback
Executes the callback with the appropriate args and kwargs
holoviews/core/spaces.py
def _execute_callback(self, *args): "Executes the callback with the appropriate args and kwargs" self._validate_key(args) # Validate input key # Additional validation needed to ensure kwargs don't clash kdims = [kdim.name for kdim in self.kdims] kwarg_items = [s.contents.it...
def _execute_callback(self, *args): "Executes the callback with the appropriate args and kwargs" self._validate_key(args) # Validate input key # Additional validation needed to ensure kwargs don't clash kdims = [kdim.name for kdim in self.kdims] kwarg_items = [s.contents.it...
[ "Executes", "the", "callback", "with", "the", "appropriate", "args", "and", "kwargs" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1078-L1099
[ "def", "_execute_callback", "(", "self", ",", "*", "args", ")", ":", "self", ".", "_validate_key", "(", "args", ")", "# Validate input key", "# Additional validation needed to ensure kwargs don't clash", "kdims", "=", "[", "kdim", ".", "name", "for", "kdim", "in", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.options
Applies simplified option definition returning a new object. Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects returned by the DynamicMap a simple format may be used, e.g.: obj.options(cm...
holoviews/core/spaces.py
def options(self, *args, **kwargs): """Applies simplified option definition returning a new object. Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects returned by the DynamicMap a simple format...
def options(self, *args, **kwargs): """Applies simplified option definition returning a new object. Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects returned by the DynamicMap a simple format...
[ "Applies", "simplified", "option", "definition", "returning", "a", "new", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1102-L1139
[ "def", "options", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "'clone'", "not", "in", "kwargs", ":", "kwargs", "[", "'clone'", "]", "=", "True", "return", "self", ".", "opts", "(", "*", "args", ",", "*", "*", "kwargs",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.clone
Clones the object, overriding data and parameters. Args: data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked ...
holoviews/core/spaces.py
def clone(self, data=None, shared_data=True, new_type=None, link=True, *args, **overrides): """Clones the object, overriding data and parameters. Args: data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data ...
def clone(self, data=None, shared_data=True, new_type=None, link=True, *args, **overrides): """Clones the object, overriding data and parameters. Args: data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data ...
[ "Clones", "the", "object", "overriding", "data", "and", "parameters", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1142-L1179
[ "def", "clone", "(", "self", ",", "data", "=", "None", ",", "shared_data", "=", "True", ",", "new_type", "=", "None", ",", "link", "=", "True", ",", "*", "args", ",", "*", "*", "overrides", ")", ":", "if", "'link_inputs'", "in", "overrides", "and", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._cross_product
Returns a new DynamicMap if the key (tuple form) expresses a cross product, otherwise returns None. The cache argument is a dictionary (key:element pairs) of all the data found in the cache for this key. Each key inside the cross product is looked up in the cache (self.data) to ...
holoviews/core/spaces.py
def _cross_product(self, tuple_key, cache, data_slice): """ Returns a new DynamicMap if the key (tuple form) expresses a cross product, otherwise returns None. The cache argument is a dictionary (key:element pairs) of all the data found in the cache for this key. Each ke...
def _cross_product(self, tuple_key, cache, data_slice): """ Returns a new DynamicMap if the key (tuple form) expresses a cross product, otherwise returns None. The cache argument is a dictionary (key:element pairs) of all the data found in the cache for this key. Each ke...
[ "Returns", "a", "new", "DynamicMap", "if", "the", "key", "(", "tuple", "form", ")", "expresses", "a", "cross", "product", "otherwise", "returns", "None", ".", "The", "cache", "argument", "is", "a", "dictionary", "(", "key", ":", "element", "pairs", ")", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1188-L1229
[ "def", "_cross_product", "(", "self", ",", "tuple_key", ",", "cache", ",", "data_slice", ")", ":", "if", "not", "any", "(", "isinstance", "(", "el", ",", "(", "list", ",", "set", ")", ")", "for", "el", "in", "tuple_key", ")", ":", "return", "None", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._slice_bounded
Slices bounded DynamicMaps by setting the soft_ranges on key dimensions and applies data slice to cached and dynamic values.
holoviews/core/spaces.py
def _slice_bounded(self, tuple_key, data_slice): """ Slices bounded DynamicMaps by setting the soft_ranges on key dimensions and applies data slice to cached and dynamic values. """ slices = [el for el in tuple_key if isinstance(el, slice)] if any(el.step for el i...
def _slice_bounded(self, tuple_key, data_slice): """ Slices bounded DynamicMaps by setting the soft_ranges on key dimensions and applies data slice to cached and dynamic values. """ slices = [el for el in tuple_key if isinstance(el, slice)] if any(el.step for el i...
[ "Slices", "bounded", "DynamicMaps", "by", "setting", "the", "soft_ranges", "on", "key", "dimensions", "and", "applies", "data", "slice", "to", "cached", "and", "dynamic", "values", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1232-L1266
[ "def", "_slice_bounded", "(", "self", ",", "tuple_key", ",", "data_slice", ")", ":", "slices", "=", "[", "el", "for", "el", "in", "tuple_key", "if", "isinstance", "(", "el", ",", "slice", ")", "]", "if", "any", "(", "el", ".", "step", "for", "el", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.select
Applies selection by dimension name Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well. Selections ma...
holoviews/core/spaces.py
def select(self, selection_specs=None, **kwargs): """Applies selection by dimension name Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection wi...
def select(self, selection_specs=None, **kwargs): """Applies selection by dimension name Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection wi...
[ "Applies", "selection", "by", "dimension", "name" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1332-L1388
[ "def", "select", "(", "self", ",", "selection_specs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "selection_specs", "is", "not", "None", "and", "not", "isinstance", "(", "selection_specs", ",", "(", "list", ",", "tuple", ")", ")", ":", "sele...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._cache
Request that a key/value pair be considered for caching.
holoviews/core/spaces.py
def _cache(self, key, val): """ Request that a key/value pair be considered for caching. """ cache_size = (1 if util.dimensionless_contents(self.streams, self.kdims) else self.cache_size) if len(self) >= cache_size: first_key = next(k for k in se...
def _cache(self, key, val): """ Request that a key/value pair be considered for caching. """ cache_size = (1 if util.dimensionless_contents(self.streams, self.kdims) else self.cache_size) if len(self) >= cache_size: first_key = next(k for k in se...
[ "Request", "that", "a", "key", "/", "value", "pair", "be", "considered", "for", "caching", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1391-L1400
[ "def", "_cache", "(", "self", ",", "key", ",", "val", ")", ":", "cache_size", "=", "(", "1", "if", "util", ".", "dimensionless_contents", "(", "self", ".", "streams", ",", "self", ".", "kdims", ")", "else", "self", ".", "cache_size", ")", "if", "len"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.map
Map a function to all objects matching the specs Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects: dmap.map(fn, hv.Curve) Args: map_fn: Function...
holoviews/core/spaces.py
def map(self, map_fn, specs=None, clone=True, link_inputs=True): """Map a function to all objects matching the specs Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects: ...
def map(self, map_fn, specs=None, clone=True, link_inputs=True): """Map a function to all objects matching the specs Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects: ...
[ "Map", "a", "function", "to", "all", "objects", "matching", "the", "specs" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1403-L1432
[ "def", "map", "(", "self", ",", "map_fn", ",", "specs", "=", "None", ",", "clone", "=", "True", ",", "link_inputs", "=", "True", ")", ":", "deep_mapped", "=", "super", "(", "DynamicMap", ",", "self", ")", ".", "map", "(", "map_fn", ",", "specs", ",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.relabel
Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to wh...
holoviews/core/spaces.py
def relabel(self, label=None, group=None, depth=1): """Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to...
def relabel(self, label=None, group=None, depth=1): """Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to...
[ "Clone", "object", "and", "apply", "new", "group", "and", "/", "or", "label", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1435-L1461
[ "def", "relabel", "(", "self", ",", "label", "=", "None", ",", "group", "=", "None", ",", "depth", "=", "1", ")", ":", "relabelled", "=", "super", "(", "DynamicMap", ",", "self", ")", ".", "relabel", "(", "label", ",", "group", ",", "depth", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap._split_overlays
Splits a DynamicMap into its components. Only well defined for DynamicMap with consistent number and order of layers.
holoviews/core/spaces.py
def _split_overlays(self): """ Splits a DynamicMap into its components. Only well defined for DynamicMap with consistent number and order of layers. """ if not len(self): raise ValueError('Cannot split DynamicMap before it has been initialized') elif not issub...
def _split_overlays(self): """ Splits a DynamicMap into its components. Only well defined for DynamicMap with consistent number and order of layers. """ if not len(self): raise ValueError('Cannot split DynamicMap before it has been initialized') elif not issub...
[ "Splits", "a", "DynamicMap", "into", "its", "components", ".", "Only", "well", "defined", "for", "DynamicMap", "with", "consistent", "number", "and", "order", "of", "layers", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1472-L1502
[ "def", "_split_overlays", "(", "self", ")", ":", "if", "not", "len", "(", "self", ")", ":", "raise", "ValueError", "(", "'Cannot split DynamicMap before it has been initialized'", ")", "elif", "not", "issubclass", "(", "self", ".", "type", ",", "CompositeOverlay",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.collate
Unpacks DynamicMap into container of DynamicMaps Collation allows unpacking DynamicMaps which return Layout, NdLayout or GridSpace objects into a single such object containing DynamicMaps. Assumes that the items in the layout or grid that is returned do not change. Returns: ...
holoviews/core/spaces.py
def collate(self): """Unpacks DynamicMap into container of DynamicMaps Collation allows unpacking DynamicMaps which return Layout, NdLayout or GridSpace objects into a single such object containing DynamicMaps. Assumes that the items in the layout or grid that is returned do not...
def collate(self): """Unpacks DynamicMap into container of DynamicMaps Collation allows unpacking DynamicMaps which return Layout, NdLayout or GridSpace objects into a single such object containing DynamicMaps. Assumes that the items in the layout or grid that is returned do not...
[ "Unpacks", "DynamicMap", "into", "container", "of", "DynamicMaps" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1505-L1603
[ "def", "collate", "(", "self", ")", ":", "# Initialize", "if", "self", ".", "last", "is", "not", "None", ":", "initialized", "=", "self", "else", ":", "initialized", "=", "self", ".", "clone", "(", ")", "initialized", "[", "initialized", ".", "_initial_k...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.groupby
Groups DynamicMap by one or more dimensions Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups. Args: dimensions: Dimension(s) to group by container_type: Type...
holoviews/core/spaces.py
def groupby(self, dimensions=None, container_type=None, group_type=None, **kwargs): """Groups DynamicMap by one or more dimensions Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups. ...
def groupby(self, dimensions=None, container_type=None, group_type=None, **kwargs): """Groups DynamicMap by one or more dimensions Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups. ...
[ "Groups", "DynamicMap", "by", "one", "or", "more", "dimensions" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1606-L1688
[ "def", "groupby", "(", "self", ",", "dimensions", "=", "None", ",", "container_type", "=", "None", ",", "group_type", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dimensions", "is", "None", ":", "dimensions", "=", "self", ".", "kdims", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.grid
Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: grid: GridSpace GridSpace with supplied dimensions
holoviews/core/spaces.py
def grid(self, dimensions=None, **kwargs): """ Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: grid: GridSp...
def grid(self, dimensions=None, **kwargs): """ Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: grid: GridSp...
[ "Groups", "data", "by", "supplied", "dimension", "(", "s", ")", "laying", "the", "groups", "along", "the", "dimension", "(", "s", ")", "out", "in", "a", "GridSpace", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1691-L1704
[ "def", "grid", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "groupby", "(", "dimensions", ",", "container_type", "=", "GridSpace", ",", "*", "*", "kwargs", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.layout
Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: layout: NdLayout NdLayout with supplied dimensions
holoviews/core/spaces.py
def layout(self, dimensions=None, **kwargs): """ Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: layout: NdL...
def layout(self, dimensions=None, **kwargs): """ Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout. Args: dimensions: Dimension/str or list Dimension or list of dimensions to group by Returns: layout: NdL...
[ "Groups", "data", "by", "supplied", "dimension", "(", "s", ")", "laying", "the", "groups", "along", "the", "dimension", "(", "s", ")", "out", "in", "a", "NdLayout", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1707-L1720
[ "def", "layout", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "groupby", "(", "dimensions", ",", "container_type", "=", "NdLayout", ",", "*", "*", "kwargs", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.overlay
Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: NdOverlay object(s) with supplied dimensions
holoviews/core/spaces.py
def overlay(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: N...
def overlay(self, dimensions=None, **kwargs): """Group by supplied dimension(s) and overlay each group Groups data by supplied dimension(s) overlaying the groups along the dimension(s). Args: dimensions: Dimension(s) of dimensions to group by Returns: N...
[ "Group", "by", "supplied", "dimension", "(", "s", ")", "and", "overlay", "each", "group" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1723-L1743
[ "def", "overlay", "(", "self", ",", "dimensions", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "dimensions", "is", "None", ":", "dimensions", "=", "self", ".", "kdims", "else", ":", "if", "not", "isinstance", "(", "dimensions", ",", "(", "li...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.hist
Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (t...
holoviews/core/spaces.py
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimens...
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimens...
[ "Computes", "and", "adjoins", "histogram", "along", "specified", "dimension", "(", "s", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1746-L1776
[ "def", "hist", "(", "self", ",", "dimension", "=", "None", ",", "num_bins", "=", "20", ",", "bin_range", "=", "None", ",", "adjoin", "=", "True", ",", "*", "*", "kwargs", ")", ":", "def", "dynamic_hist", "(", "obj", ",", "*", "*", "dynkwargs", ")",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
DynamicMap.reindex
Reorders key dimensions on DynamicMap Create a new object with a reordered set of key dimensions. Dropping dimensions is not allowed on a DynamicMap. Args: kdims: List of dimensions to reindex the mapping with force: Not applicable to a DynamicMap Returns: ...
holoviews/core/spaces.py
def reindex(self, kdims=[], force=False): """Reorders key dimensions on DynamicMap Create a new object with a reordered set of key dimensions. Dropping dimensions is not allowed on a DynamicMap. Args: kdims: List of dimensions to reindex the mapping with force: ...
def reindex(self, kdims=[], force=False): """Reorders key dimensions on DynamicMap Create a new object with a reordered set of key dimensions. Dropping dimensions is not allowed on a DynamicMap. Args: kdims: List of dimensions to reindex the mapping with force: ...
[ "Reorders", "key", "dimensions", "on", "DynamicMap" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1779-L1799
[ "def", "reindex", "(", "self", ",", "kdims", "=", "[", "]", ",", "force", "=", "False", ")", ":", "if", "not", "isinstance", "(", "kdims", ",", "list", ")", ":", "kdims", "=", "[", "kdims", "]", "kdims", "=", "[", "self", ".", "get_dimension", "(...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridSpace._transform_indices
Snaps indices into the GridSpace to the closest coordinate. Args: key: Tuple index into the GridSpace Returns: Transformed key snapped to closest numeric coordinates
holoviews/core/spaces.py
def _transform_indices(self, key): """Snaps indices into the GridSpace to the closest coordinate. Args: key: Tuple index into the GridSpace Returns: Transformed key snapped to closest numeric coordinates """ ndims = self.ndims if all(not (isinsta...
def _transform_indices(self, key): """Snaps indices into the GridSpace to the closest coordinate. Args: key: Tuple index into the GridSpace Returns: Transformed key snapped to closest numeric coordinates """ ndims = self.ndims if all(not (isinsta...
[ "Snaps", "indices", "into", "the", "GridSpace", "to", "the", "closest", "coordinate", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1850-L1891
[ "def", "_transform_indices", "(", "self", ",", "key", ")", ":", "ndims", "=", "self", ".", "ndims", "if", "all", "(", "not", "(", "isinstance", "(", "el", ",", "slice", ")", "or", "callable", "(", "el", ")", ")", "for", "el", "in", "key", ")", ":...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridSpace.keys
Returns the keys of the GridSpace Args: full_grid (bool, optional): Return full cross-product of keys Returns: List of keys
holoviews/core/spaces.py
def keys(self, full_grid=False): """Returns the keys of the GridSpace Args: full_grid (bool, optional): Return full cross-product of keys Returns: List of keys """ keys = super(GridSpace, self).keys() if self.ndims == 1 or not full_grid: ...
def keys(self, full_grid=False): """Returns the keys of the GridSpace Args: full_grid (bool, optional): Return full cross-product of keys Returns: List of keys """ keys = super(GridSpace, self).keys() if self.ndims == 1 or not full_grid: ...
[ "Returns", "the", "keys", "of", "the", "GridSpace" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1894-L1908
[ "def", "keys", "(", "self", ",", "full_grid", "=", "False", ")", ":", "keys", "=", "super", "(", "GridSpace", ",", "self", ")", ".", "keys", "(", ")", "if", "self", ".", "ndims", "==", "1", "or", "not", "full_grid", ":", "return", "keys", "dim1_key...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridSpace.last
The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.
holoviews/core/spaces.py
def last(self): """ The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method. """ if self.type == HoloMap: ...
def last(self): """ The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method. """ if self.type == HoloMap: ...
[ "The", "last", "of", "a", "GridSpace", "is", "another", "GridSpace", "constituted", "of", "the", "last", "of", "the", "individual", "elements", ".", "To", "access", "the", "elements", "by", "their", "X", "Y", "position", "either", "index", "the", "position",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1912-L1924
[ "def", "last", "(", "self", ")", ":", "if", "self", ".", "type", "==", "HoloMap", ":", "last_items", "=", "[", "(", "k", ",", "v", ".", "last", "if", "isinstance", "(", "v", ",", "HoloMap", ")", "else", "v", ")", "for", "(", "k", ",", "v", ")...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridSpace.shape
Returns the 2D shape of the GridSpace as (rows, cols).
holoviews/core/spaces.py
def shape(self): "Returns the 2D shape of the GridSpace as (rows, cols)." keys = self.keys() if self.ndims == 1: return (len(keys), 1) return len(set(k[0] for k in keys)), len(set(k[1] for k in keys))
def shape(self): "Returns the 2D shape of the GridSpace as (rows, cols)." keys = self.keys() if self.ndims == 1: return (len(keys), 1) return len(set(k[0] for k in keys)), len(set(k[1] for k in keys))
[ "Returns", "the", "2D", "shape", "of", "the", "GridSpace", "as", "(", "rows", "cols", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/spaces.py#L1942-L1947
[ "def", "shape", "(", "self", ")", ":", "keys", "=", "self", ".", "keys", "(", ")", "if", "self", ".", "ndims", "==", "1", ":", "return", "(", "len", "(", "keys", ")", ",", "1", ")", "return", "len", "(", "set", "(", "k", "[", "0", "]", "for...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PathPlot._get_hover_data
Initializes hover data based on Element dimension values.
holoviews/plotting/bokeh/path.py
def _get_hover_data(self, data, element): """ Initializes hover data based on Element dimension values. """ if 'hover' not in self.handles or self.static_source: return for k, v in self.overlay_dims.items(): dim = util.dimension_sanitizer(k.name) ...
def _get_hover_data(self, data, element): """ Initializes hover data based on Element dimension values. """ if 'hover' not in self.handles or self.static_source: return for k, v in self.overlay_dims.items(): dim = util.dimension_sanitizer(k.name) ...
[ "Initializes", "hover", "data", "based", "on", "Element", "dimension", "values", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/path.py#L45-L55
[ "def", "_get_hover_data", "(", "self", ",", "data", ",", "element", ")", ":", "if", "'hover'", "not", "in", "self", ".", "handles", "or", "self", ".", "static_source", ":", "return", "for", "k", ",", "v", "in", "self", ".", "overlay_dims", ".", "items"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ContourPlot._get_hover_data
Initializes hover data based on Element dimension values. If empty initializes with no data.
holoviews/plotting/bokeh/path.py
def _get_hover_data(self, data, element): """ Initializes hover data based on Element dimension values. If empty initializes with no data. """ if 'hover' not in self.handles or self.static_source: return npath = len([vs for vs in data.values()][0]) fo...
def _get_hover_data(self, data, element): """ Initializes hover data based on Element dimension values. If empty initializes with no data. """ if 'hover' not in self.handles or self.static_source: return npath = len([vs for vs in data.values()][0]) fo...
[ "Initializes", "hover", "data", "based", "on", "Element", "dimension", "values", ".", "If", "empty", "initializes", "with", "no", "data", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/path.py#L170-L194
[ "def", "_get_hover_data", "(", "self", ",", "data", ",", "element", ")", ":", "if", "'hover'", "not", "in", "self", ".", "handles", "or", "self", ".", "static_source", ":", "return", "npath", "=", "len", "(", "[", "vs", "for", "vs", "in", "data", "."...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ContourPlot._init_glyph
Returns a Bokeh glyph object.
holoviews/plotting/bokeh/path.py
def _init_glyph(self, plot, mapping, properties): """ Returns a Bokeh glyph object. """ plot_method = properties.pop('plot_method', None) properties = mpl_to_bokeh(properties) data = dict(properties, **mapping) if self._has_holes: plot_method = 'multi_...
def _init_glyph(self, plot, mapping, properties): """ Returns a Bokeh glyph object. """ plot_method = properties.pop('plot_method', None) properties = mpl_to_bokeh(properties) data = dict(properties, **mapping) if self._has_holes: plot_method = 'multi_...
[ "Returns", "a", "Bokeh", "glyph", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/path.py#L250-L267
[ "def", "_init_glyph", "(", "self", ",", "plot", ",", "mapping", ",", "properties", ")", ":", "plot_method", "=", "properties", ".", "pop", "(", "'plot_method'", ",", "None", ")", "properties", "=", "mpl_to_bokeh", "(", "properties", ")", "data", "=", "dict...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
CompositeOverlay.hist
Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (t...
holoviews/core/overlay.py
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, index=0, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimensio...
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, index=0, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimensio...
[ "Computes", "and", "adjoins", "histogram", "along", "specified", "dimension", "(", "s", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/overlay.py#L54-L93
[ "def", "hist", "(", "self", ",", "dimension", "=", "None", ",", "num_bins", "=", "20", ",", "bin_range", "=", "None", ",", "adjoin", "=", "True", ",", "index", "=", "0", ",", "*", "*", "kwargs", ")", ":", "valid_ind", "=", "isinstance", "(", "index...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
CompositeOverlay.dimension_values
Return the values along the requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, behavior depends on the type of data: * Colum...
holoviews/core/overlay.py
def dimension_values(self, dimension, expanded=True, flat=True): """Return the values along the requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, beh...
def dimension_values(self, dimension, expanded=True, flat=True): """Return the values along the requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, beh...
[ "Return", "the", "values", "along", "the", "requested", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/overlay.py#L96-L124
[ "def", "dimension_values", "(", "self", ",", "dimension", ",", "expanded", "=", "True", ",", "flat", "=", "True", ")", ":", "values", "=", "[", "]", "found", "=", "False", "for", "el", "in", "self", ":", "if", "dimension", "in", "el", ".", "dimension...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Overlay.get
Get a layer in the Overlay. Get a particular layer in the Overlay using its path string or an integer index. Args: identifier: Index or path string of the item to return default: Value to return if no item is found Returns: The indexed layer of the ...
holoviews/core/overlay.py
def get(self, identifier, default=None): """Get a layer in the Overlay. Get a particular layer in the Overlay using its path string or an integer index. Args: identifier: Index or path string of the item to return default: Value to return if no item is found ...
def get(self, identifier, default=None): """Get a layer in the Overlay. Get a particular layer in the Overlay using its path string or an integer index. Args: identifier: Index or path string of the item to return default: Value to return if no item is found ...
[ "Get", "a", "layer", "in", "the", "Overlay", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/overlay.py#L153-L172
[ "def", "get", "(", "self", ",", "identifier", ",", "default", "=", "None", ")", ":", "if", "isinstance", "(", "identifier", ",", "int", ")", ":", "values", "=", "list", "(", "self", ".", "data", ".", "values", "(", ")", ")", "if", "0", "<=", "ide...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Overlay.collapse
Deprecated method to collapse layers in the Overlay.
holoviews/core/overlay.py
def collapse(self, function): "Deprecated method to collapse layers in the Overlay." if config.future_deprecations: self.param.warning('Overlay.collapse is deprecated, to' 'collapse multiple elements use a HoloMap.') elements = list(self) types...
def collapse(self, function): "Deprecated method to collapse layers in the Overlay." if config.future_deprecations: self.param.warning('Overlay.collapse is deprecated, to' 'collapse multiple elements use a HoloMap.') elements = list(self) types...
[ "Deprecated", "method", "to", "collapse", "layers", "in", "the", "Overlay", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/overlay.py#L263-L277
[ "def", "collapse", "(", "self", ",", "function", ")", ":", "if", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", "warning", "(", "'Overlay.collapse is deprecated, to'", "'collapse multiple elements use a HoloMap.'", ")", "elements", "=", "list", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
displayable
Predicate that returns whether the object is displayable or not (i.e whether the object obeys the nesting hierarchy
holoviews/plotting/util.py
def displayable(obj): """ Predicate that returns whether the object is displayable or not (i.e whether the object obeys the nesting hierarchy """ if isinstance(obj, Overlay) and any(isinstance(o, (HoloMap, GridSpace)) for o in obj): return False if...
def displayable(obj): """ Predicate that returns whether the object is displayable or not (i.e whether the object obeys the nesting hierarchy """ if isinstance(obj, Overlay) and any(isinstance(o, (HoloMap, GridSpace)) for o in obj): return False if...
[ "Predicate", "that", "returns", "whether", "the", "object", "is", "displayable", "or", "not", "(", "i", ".", "e", "whether", "the", "object", "obeys", "the", "nesting", "hierarchy" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L25-L40
[ "def", "displayable", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "Overlay", ")", "and", "any", "(", "isinstance", "(", "o", ",", "(", "HoloMap", ",", "GridSpace", ")", ")", "for", "o", "in", "obj", ")", ":", "return", "False", "if",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
overlay_depth
Computes the depth of a DynamicMap overlay if it can be determined otherwise return None.
holoviews/plotting/util.py
def overlay_depth(obj): """ Computes the depth of a DynamicMap overlay if it can be determined otherwise return None. """ if isinstance(obj, DynamicMap): if isinstance(obj.last, CompositeOverlay): return len(obj.last) elif obj.last is None: return None ...
def overlay_depth(obj): """ Computes the depth of a DynamicMap overlay if it can be determined otherwise return None. """ if isinstance(obj, DynamicMap): if isinstance(obj.last, CompositeOverlay): return len(obj.last) elif obj.last is None: return None ...
[ "Computes", "the", "depth", "of", "a", "DynamicMap", "overlay", "if", "it", "can", "be", "determined", "otherwise", "return", "None", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L103-L115
[ "def", "overlay_depth", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "DynamicMap", ")", ":", "if", "isinstance", "(", "obj", ".", "last", ",", "CompositeOverlay", ")", ":", "return", "len", "(", "obj", ".", "last", ")", "elif", "obj", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
compute_overlayable_zorders
Traverses an overlayable composite container to determine which objects are associated with specific (Nd)Overlay layers by z-order, making sure to take DynamicMap Callables into account. Returns a mapping between the zorders of each layer and a corresponding lists of objects. Used to determine whic...
holoviews/plotting/util.py
def compute_overlayable_zorders(obj, path=[]): """ Traverses an overlayable composite container to determine which objects are associated with specific (Nd)Overlay layers by z-order, making sure to take DynamicMap Callables into account. Returns a mapping between the zorders of each layer and a ...
def compute_overlayable_zorders(obj, path=[]): """ Traverses an overlayable composite container to determine which objects are associated with specific (Nd)Overlay layers by z-order, making sure to take DynamicMap Callables into account. Returns a mapping between the zorders of each layer and a ...
[ "Traverses", "an", "overlayable", "composite", "container", "to", "determine", "which", "objects", "are", "associated", "with", "specific", "(", "Nd", ")", "Overlay", "layers", "by", "z", "-", "order", "making", "sure", "to", "take", "DynamicMap", "Callables", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L118-L191
[ "def", "compute_overlayable_zorders", "(", "obj", ",", "path", "=", "[", "]", ")", ":", "path", "=", "path", "+", "[", "obj", "]", "zorder_map", "=", "defaultdict", "(", "list", ")", "# Process non-dynamic layers", "if", "not", "isinstance", "(", "obj", ",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
is_dynamic_overlay
Traverses a DynamicMap graph and determines if any components were overlaid dynamically (i.e. by * on a DynamicMap).
holoviews/plotting/util.py
def is_dynamic_overlay(dmap): """ Traverses a DynamicMap graph and determines if any components were overlaid dynamically (i.e. by * on a DynamicMap). """ if not isinstance(dmap, DynamicMap): return False elif dmap.callback._is_overlay: return True else: return any(is...
def is_dynamic_overlay(dmap): """ Traverses a DynamicMap graph and determines if any components were overlaid dynamically (i.e. by * on a DynamicMap). """ if not isinstance(dmap, DynamicMap): return False elif dmap.callback._is_overlay: return True else: return any(is...
[ "Traverses", "a", "DynamicMap", "graph", "and", "determines", "if", "any", "components", "were", "overlaid", "dynamically", "(", "i", ".", "e", ".", "by", "*", "on", "a", "DynamicMap", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L194-L204
[ "def", "is_dynamic_overlay", "(", "dmap", ")", ":", "if", "not", "isinstance", "(", "dmap", ",", "DynamicMap", ")", ":", "return", "False", "elif", "dmap", ".", "callback", ".", "_is_overlay", ":", "return", "True", "else", ":", "return", "any", "(", "is...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
split_dmap_overlay
Splits a DynamicMap into the original component layers it was constructed from by traversing the graph to search for dynamically overlaid components (i.e. constructed by using * on a DynamicMap). Useful for assigning subplots of an OverlayPlot the streams that are responsible for driving their updates. ...
holoviews/plotting/util.py
def split_dmap_overlay(obj, depth=0): """ Splits a DynamicMap into the original component layers it was constructed from by traversing the graph to search for dynamically overlaid components (i.e. constructed by using * on a DynamicMap). Useful for assigning subplots of an OverlayPlot the streams th...
def split_dmap_overlay(obj, depth=0): """ Splits a DynamicMap into the original component layers it was constructed from by traversing the graph to search for dynamically overlaid components (i.e. constructed by using * on a DynamicMap). Useful for assigning subplots of an OverlayPlot the streams th...
[ "Splits", "a", "DynamicMap", "into", "the", "original", "component", "layers", "it", "was", "constructed", "from", "by", "traversing", "the", "graph", "to", "search", "for", "dynamically", "overlaid", "components", "(", "i", ".", "e", ".", "constructed", "by",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L207-L237
[ "def", "split_dmap_overlay", "(", "obj", ",", "depth", "=", "0", ")", ":", "layers", "=", "[", "]", "if", "isinstance", "(", "obj", ",", "DynamicMap", ")", ":", "if", "issubclass", "(", "obj", ".", "type", ",", "NdOverlay", ")", "and", "not", "depth"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
initialize_dynamic
Initializes all DynamicMap objects contained by the object
holoviews/plotting/util.py
def initialize_dynamic(obj): """ Initializes all DynamicMap objects contained by the object """ dmaps = obj.traverse(lambda x: x, specs=[DynamicMap]) for dmap in dmaps: if dmap.unbounded: # Skip initialization until plotting code continue if not len(dmap): ...
def initialize_dynamic(obj): """ Initializes all DynamicMap objects contained by the object """ dmaps = obj.traverse(lambda x: x, specs=[DynamicMap]) for dmap in dmaps: if dmap.unbounded: # Skip initialization until plotting code continue if not len(dmap): ...
[ "Initializes", "all", "DynamicMap", "objects", "contained", "by", "the", "object" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L240-L250
[ "def", "initialize_dynamic", "(", "obj", ")", ":", "dmaps", "=", "obj", ".", "traverse", "(", "lambda", "x", ":", "x", ",", "specs", "=", "[", "DynamicMap", "]", ")", "for", "dmap", "in", "dmaps", ":", "if", "dmap", ".", "unbounded", ":", "# Skip ini...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_plot_frame
Returns the current frame in a mapping given a key mapping. Args: obj: Nested Dimensioned object key_map: Dictionary mapping between dimensions and key value cached: Whether to allow looking up key in cache Returns: The item in the mapping corresponding to the supplied key.
holoviews/plotting/util.py
def get_plot_frame(map_obj, key_map, cached=False): """Returns the current frame in a mapping given a key mapping. Args: obj: Nested Dimensioned object key_map: Dictionary mapping between dimensions and key value cached: Whether to allow looking up key in cache Returns: The...
def get_plot_frame(map_obj, key_map, cached=False): """Returns the current frame in a mapping given a key mapping. Args: obj: Nested Dimensioned object key_map: Dictionary mapping between dimensions and key value cached: Whether to allow looking up key in cache Returns: The...
[ "Returns", "the", "current", "frame", "in", "a", "mapping", "given", "a", "key", "mapping", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L253-L279
[ "def", "get_plot_frame", "(", "map_obj", ",", "key_map", ",", "cached", "=", "False", ")", ":", "if", "map_obj", ".", "kdims", "and", "len", "(", "map_obj", ".", "kdims", ")", "==", "1", "and", "map_obj", ".", "kdims", "[", "0", "]", "==", "'Frame'",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_nested_plot_frame
Extracts a single frame from a nested object. Replaces any HoloMap or DynamicMap in the nested data structure, with the item corresponding to the supplied key. Args: obj: Nested Dimensioned object key_map: Dictionary mapping between dimensions and key value cached: Whether to allow...
holoviews/plotting/util.py
def get_nested_plot_frame(obj, key_map, cached=False): """Extracts a single frame from a nested object. Replaces any HoloMap or DynamicMap in the nested data structure, with the item corresponding to the supplied key. Args: obj: Nested Dimensioned object key_map: Dictionary mapping bet...
def get_nested_plot_frame(obj, key_map, cached=False): """Extracts a single frame from a nested object. Replaces any HoloMap or DynamicMap in the nested data structure, with the item corresponding to the supplied key. Args: obj: Nested Dimensioned object key_map: Dictionary mapping bet...
[ "Extracts", "a", "single", "frame", "from", "a", "nested", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L282-L306
[ "def", "get_nested_plot_frame", "(", "obj", ",", "key_map", ",", "cached", "=", "False", ")", ":", "clone", "=", "obj", ".", "map", "(", "lambda", "x", ":", "x", ")", "# Ensure that DynamicMaps in the cloned frame have", "# identical callback inputs to allow memoizati...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
undisplayable_info
Generate helpful message regarding an undisplayable object
holoviews/plotting/util.py
def undisplayable_info(obj, html=False): "Generate helpful message regarding an undisplayable object" collate = '<tt>collate</tt>' if html else 'collate' info = "For more information, please consult the Composing Data tutorial (http://git.io/vtIQh)" if isinstance(obj, HoloMap): error = "HoloMap...
def undisplayable_info(obj, html=False): "Generate helpful message regarding an undisplayable object" collate = '<tt>collate</tt>' if html else 'collate' info = "For more information, please consult the Composing Data tutorial (http://git.io/vtIQh)" if isinstance(obj, HoloMap): error = "HoloMap...
[ "Generate", "helpful", "message", "regarding", "an", "undisplayable", "object" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L309-L328
[ "def", "undisplayable_info", "(", "obj", ",", "html", "=", "False", ")", ":", "collate", "=", "'<tt>collate</tt>'", "if", "html", "else", "'collate'", "info", "=", "\"For more information, please consult the Composing Data tutorial (http://git.io/vtIQh)\"", "if", "isinstanc...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
compute_sizes
Scales point sizes according to a scaling factor, base size and size_fn, which will be applied before scaling.
holoviews/plotting/util.py
def compute_sizes(sizes, size_fn, scaling_factor, scaling_method, base_size): """ Scales point sizes according to a scaling factor, base size and size_fn, which will be applied before scaling. """ if sizes.dtype.kind not in ('i', 'f'): return None if scaling_method == 'area': ...
def compute_sizes(sizes, size_fn, scaling_factor, scaling_method, base_size): """ Scales point sizes according to a scaling factor, base size and size_fn, which will be applied before scaling. """ if sizes.dtype.kind not in ('i', 'f'): return None if scaling_method == 'area': ...
[ "Scales", "point", "sizes", "according", "to", "a", "scaling", "factor", "base", "size", "and", "size_fn", "which", "will", "be", "applied", "before", "scaling", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L331-L348
[ "def", "compute_sizes", "(", "sizes", ",", "size_fn", ",", "scaling_factor", ",", "scaling_method", ",", "base_size", ")", ":", "if", "sizes", ".", "dtype", ".", "kind", "not", "in", "(", "'i'", ",", "'f'", ")", ":", "return", "None", "if", "scaling_meth...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_axis_padding
Process a padding value supplied as a tuple or number and returns padding values for x-, y- and z-axis.
holoviews/plotting/util.py
def get_axis_padding(padding): """ Process a padding value supplied as a tuple or number and returns padding values for x-, y- and z-axis. """ if isinstance(padding, tuple): if len(padding) == 2: xpad, ypad = padding zpad = 0 elif len(padding) == 3: ...
def get_axis_padding(padding): """ Process a padding value supplied as a tuple or number and returns padding values for x-, y- and z-axis. """ if isinstance(padding, tuple): if len(padding) == 2: xpad, ypad = padding zpad = 0 elif len(padding) == 3: ...
[ "Process", "a", "padding", "value", "supplied", "as", "a", "tuple", "or", "number", "and", "returns", "padding", "values", "for", "x", "-", "y", "-", "and", "z", "-", "axis", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L351-L368
[ "def", "get_axis_padding", "(", "padding", ")", ":", "if", "isinstance", "(", "padding", ",", "tuple", ")", ":", "if", "len", "(", "padding", ")", "==", "2", ":", "xpad", ",", "ypad", "=", "padding", "zpad", "=", "0", "elif", "len", "(", "padding", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_minimum_span
If lower and high values are equal ensures they are separated by the defined span.
holoviews/plotting/util.py
def get_minimum_span(low, high, span): """ If lower and high values are equal ensures they are separated by the defined span. """ if is_number(low) and low == high: if isinstance(low, np.datetime64): span = span * np.timedelta64(1, 's') low, high = low-span, high+span ...
def get_minimum_span(low, high, span): """ If lower and high values are equal ensures they are separated by the defined span. """ if is_number(low) and low == high: if isinstance(low, np.datetime64): span = span * np.timedelta64(1, 's') low, high = low-span, high+span ...
[ "If", "lower", "and", "high", "values", "are", "equal", "ensures", "they", "are", "separated", "by", "the", "defined", "span", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L371-L380
[ "def", "get_minimum_span", "(", "low", ",", "high", ",", "span", ")", ":", "if", "is_number", "(", "low", ")", "and", "low", "==", "high", ":", "if", "isinstance", "(", "low", ",", "np", ".", "datetime64", ")", ":", "span", "=", "span", "*", "np", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_range
Computes the data, soft- and hard-range along a dimension given an element and a dictionary of ranges.
holoviews/plotting/util.py
def get_range(element, ranges, dimension): """ Computes the data, soft- and hard-range along a dimension given an element and a dictionary of ranges. """ if dimension and dimension != 'categorical': if ranges and dimension.name in ranges: drange = ranges[dimension.name]['data'] ...
def get_range(element, ranges, dimension): """ Computes the data, soft- and hard-range along a dimension given an element and a dictionary of ranges. """ if dimension and dimension != 'categorical': if ranges and dimension.name in ranges: drange = ranges[dimension.name]['data'] ...
[ "Computes", "the", "data", "soft", "-", "and", "hard", "-", "range", "along", "a", "dimension", "given", "an", "element", "and", "a", "dictionary", "of", "ranges", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L383-L399
[ "def", "get_range", "(", "element", ",", "ranges", ",", "dimension", ")", ":", "if", "dimension", "and", "dimension", "!=", "'categorical'", ":", "if", "ranges", "and", "dimension", ".", "name", "in", "ranges", ":", "drange", "=", "ranges", "[", "dimension...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_sideplot_ranges
Utility to find the range for an adjoined plot given the plot, the element, the Element the plot is adjoined to and the dictionary of ranges.
holoviews/plotting/util.py
def get_sideplot_ranges(plot, element, main, ranges): """ Utility to find the range for an adjoined plot given the plot, the element, the Element the plot is adjoined to and the dictionary of ranges. """ key = plot.current_key dims = element.dimensions() dim = dims[0] if 'frequency' ...
def get_sideplot_ranges(plot, element, main, ranges): """ Utility to find the range for an adjoined plot given the plot, the element, the Element the plot is adjoined to and the dictionary of ranges. """ key = plot.current_key dims = element.dimensions() dim = dims[0] if 'frequency' ...
[ "Utility", "to", "find", "the", "range", "for", "an", "adjoined", "plot", "given", "the", "plot", "the", "element", "the", "Element", "the", "plot", "is", "adjoined", "to", "and", "the", "dictionary", "of", "ranges", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L402-L436
[ "def", "get_sideplot_ranges", "(", "plot", ",", "element", ",", "main", ",", "ranges", ")", ":", "key", "=", "plot", ".", "current_key", "dims", "=", "element", ".", "dimensions", "(", ")", "dim", "=", "dims", "[", "0", "]", "if", "'frequency'", "in", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
within_range
Checks whether range1 is within the range specified by range2.
holoviews/plotting/util.py
def within_range(range1, range2): """Checks whether range1 is within the range specified by range2.""" range1 = [r if isfinite(r) else None for r in range1] range2 = [r if isfinite(r) else None for r in range2] return ((range1[0] is None or range2[0] is None or range1[0] >= range2[0]) and (r...
def within_range(range1, range2): """Checks whether range1 is within the range specified by range2.""" range1 = [r if isfinite(r) else None for r in range1] range2 = [r if isfinite(r) else None for r in range2] return ((range1[0] is None or range2[0] is None or range1[0] >= range2[0]) and (r...
[ "Checks", "whether", "range1", "is", "within", "the", "range", "specified", "by", "range2", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L439-L444
[ "def", "within_range", "(", "range1", ",", "range2", ")", ":", "range1", "=", "[", "r", "if", "isfinite", "(", "r", ")", "else", "None", "for", "r", "in", "range1", "]", "range2", "=", "[", "r", "if", "isfinite", "(", "r", ")", "else", "None", "f...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_dynamic_mode
Returns the common mode of the dynamic maps in given composite object
holoviews/plotting/util.py
def get_dynamic_mode(composite): "Returns the common mode of the dynamic maps in given composite object" dynmaps = composite.traverse(lambda x: x, [DynamicMap]) holomaps = composite.traverse(lambda x: x, ['HoloMap']) dynamic_unbounded = any(m.unbounded for m in dynmaps) if holomaps: validate...
def get_dynamic_mode(composite): "Returns the common mode of the dynamic maps in given composite object" dynmaps = composite.traverse(lambda x: x, [DynamicMap]) holomaps = composite.traverse(lambda x: x, ['HoloMap']) dynamic_unbounded = any(m.unbounded for m in dynmaps) if holomaps: validate...
[ "Returns", "the", "common", "mode", "of", "the", "dynamic", "maps", "in", "given", "composite", "object" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L461-L471
[ "def", "get_dynamic_mode", "(", "composite", ")", ":", "dynmaps", "=", "composite", ".", "traverse", "(", "lambda", "x", ":", "x", ",", "[", "DynamicMap", "]", ")", "holomaps", "=", "composite", ".", "traverse", "(", "lambda", "x", ":", "x", ",", "[", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
initialize_unbounded
Initializes any DynamicMaps in unbounded mode.
holoviews/plotting/util.py
def initialize_unbounded(obj, dimensions, key): """ Initializes any DynamicMaps in unbounded mode. """ select = dict(zip([d.name for d in dimensions], key)) try: obj.select([DynamicMap], **select) except KeyError: pass
def initialize_unbounded(obj, dimensions, key): """ Initializes any DynamicMaps in unbounded mode. """ select = dict(zip([d.name for d in dimensions], key)) try: obj.select([DynamicMap], **select) except KeyError: pass
[ "Initializes", "any", "DynamicMaps", "in", "unbounded", "mode", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L474-L482
[ "def", "initialize_unbounded", "(", "obj", ",", "dimensions", ",", "key", ")", ":", "select", "=", "dict", "(", "zip", "(", "[", "d", ".", "name", "for", "d", "in", "dimensions", "]", ",", "key", ")", ")", "try", ":", "obj", ".", "select", "(", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
save_frames
Utility to export object to files frame by frame, numbered individually. Will use default backend and figure format by default.
holoviews/plotting/util.py
def save_frames(obj, filename, fmt=None, backend=None, options=None): """ Utility to export object to files frame by frame, numbered individually. Will use default backend and figure format by default. """ backend = Store.current_backend if backend is None else backend renderer = Store.renderers...
def save_frames(obj, filename, fmt=None, backend=None, options=None): """ Utility to export object to files frame by frame, numbered individually. Will use default backend and figure format by default. """ backend = Store.current_backend if backend is None else backend renderer = Store.renderers...
[ "Utility", "to", "export", "object", "to", "files", "frame", "by", "frame", "numbered", "individually", ".", "Will", "use", "default", "backend", "and", "figure", "format", "by", "default", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L485-L496
[ "def", "save_frames", "(", "obj", ",", "filename", ",", "fmt", "=", "None", ",", "backend", "=", "None", ",", "options", "=", "None", ")", ":", "backend", "=", "Store", ".", "current_backend", "if", "backend", "is", "None", "else", "backend", "renderer",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dynamic_update
Given a plot, subplot and dynamically generated (Nd)Overlay find the closest matching Element for that plot.
holoviews/plotting/util.py
def dynamic_update(plot, subplot, key, overlay, items): """ Given a plot, subplot and dynamically generated (Nd)Overlay find the closest matching Element for that plot. """ match_spec = get_overlay_spec(overlay, wrap_tuple(key), sub...
def dynamic_update(plot, subplot, key, overlay, items): """ Given a plot, subplot and dynamically generated (Nd)Overlay find the closest matching Element for that plot. """ match_spec = get_overlay_spec(overlay, wrap_tuple(key), sub...
[ "Given", "a", "plot", "subplot", "and", "dynamically", "generated", "(", "Nd", ")", "Overlay", "find", "the", "closest", "matching", "Element", "for", "that", "plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L499-L513
[ "def", "dynamic_update", "(", "plot", ",", "subplot", ",", "key", ",", "overlay", ",", "items", ")", ":", "match_spec", "=", "get_overlay_spec", "(", "overlay", ",", "wrap_tuple", "(", "key", ")", ",", "subplot", ".", "current_frame", ")", "specs", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
map_colors
Maps an array of values to RGB hex strings, given a color range and colormap.
holoviews/plotting/util.py
def map_colors(arr, crange, cmap, hex=True): """ Maps an array of values to RGB hex strings, given a color range and colormap. """ if isinstance(crange, np.ndarray): xsorted = np.argsort(crange) ypos = np.searchsorted(crange, arr) arr = xsorted[ypos] else: if isin...
def map_colors(arr, crange, cmap, hex=True): """ Maps an array of values to RGB hex strings, given a color range and colormap. """ if isinstance(crange, np.ndarray): xsorted = np.argsort(crange) ypos = np.searchsorted(crange, arr) arr = xsorted[ypos] else: if isin...
[ "Maps", "an", "array", "of", "values", "to", "RGB", "hex", "strings", "given", "a", "color", "range", "and", "colormap", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L516-L536
[ "def", "map_colors", "(", "arr", ",", "crange", ",", "cmap", ",", "hex", "=", "True", ")", ":", "if", "isinstance", "(", "crange", ",", "np", ".", "ndarray", ")", ":", "xsorted", "=", "np", ".", "argsort", "(", "crange", ")", "ypos", "=", "np", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
mplcmap_to_palette
Converts a matplotlib colormap to palette of RGB hex strings."
holoviews/plotting/util.py
def mplcmap_to_palette(cmap, ncolors=None, categorical=False): """ Converts a matplotlib colormap to palette of RGB hex strings." """ from matplotlib.colors import Colormap, ListedColormap ncolors = ncolors or 256 if not isinstance(cmap, Colormap): import matplotlib.cm as cm # A...
def mplcmap_to_palette(cmap, ncolors=None, categorical=False): """ Converts a matplotlib colormap to palette of RGB hex strings." """ from matplotlib.colors import Colormap, ListedColormap ncolors = ncolors or 256 if not isinstance(cmap, Colormap): import matplotlib.cm as cm # A...
[ "Converts", "a", "matplotlib", "colormap", "to", "palette", "of", "RGB", "hex", "strings", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L539-L564
[ "def", "mplcmap_to_palette", "(", "cmap", ",", "ncolors", "=", "None", ",", "categorical", "=", "False", ")", ":", "from", "matplotlib", ".", "colors", "import", "Colormap", ",", "ListedColormap", "ncolors", "=", "ncolors", "or", "256", "if", "not", "isinsta...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
linear_gradient
Interpolates the color gradient between to hex colors
holoviews/plotting/util.py
def linear_gradient(start_hex, finish_hex, n=10): """ Interpolates the color gradient between to hex colors """ s = hex2rgb(start_hex) f = hex2rgb(finish_hex) gradient = [s] for t in range(1, n): curr_vector = [int(s[j] + (float(t)/(n-1))*(f[j]-s[j])) for j in range(3)] gradi...
def linear_gradient(start_hex, finish_hex, n=10): """ Interpolates the color gradient between to hex colors """ s = hex2rgb(start_hex) f = hex2rgb(finish_hex) gradient = [s] for t in range(1, n): curr_vector = [int(s[j] + (float(t)/(n-1))*(f[j]-s[j])) for j in range(3)] gradi...
[ "Interpolates", "the", "color", "gradient", "between", "to", "hex", "colors" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L616-L626
[ "def", "linear_gradient", "(", "start_hex", ",", "finish_hex", ",", "n", "=", "10", ")", ":", "s", "=", "hex2rgb", "(", "start_hex", ")", "f", "=", "hex2rgb", "(", "finish_hex", ")", "gradient", "=", "[", "s", "]", "for", "t", "in", "range", "(", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
polylinear_gradient
Interpolates the color gradients between a list of hex colors.
holoviews/plotting/util.py
def polylinear_gradient(colors, n): """ Interpolates the color gradients between a list of hex colors. """ n_out = int(float(n) / (len(colors)-1)) gradient = linear_gradient(colors[0], colors[1], n_out) if len(colors) == len(gradient): return gradient for col in range(1, len(colors...
def polylinear_gradient(colors, n): """ Interpolates the color gradients between a list of hex colors. """ n_out = int(float(n) / (len(colors)-1)) gradient = linear_gradient(colors[0], colors[1], n_out) if len(colors) == len(gradient): return gradient for col in range(1, len(colors...
[ "Interpolates", "the", "color", "gradients", "between", "a", "list", "of", "hex", "colors", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L629-L642
[ "def", "polylinear_gradient", "(", "colors", ",", "n", ")", ":", "n_out", "=", "int", "(", "float", "(", "n", ")", "/", "(", "len", "(", "colors", ")", "-", "1", ")", ")", "gradient", "=", "linear_gradient", "(", "colors", "[", "0", "]", ",", "co...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
_list_cmaps
List available colormaps by combining matplotlib, bokeh, and colorcet colormaps or palettes if available. May also be narrowed down to a particular provider or list of providers.
holoviews/plotting/util.py
def _list_cmaps(provider=None, records=False): """ List available colormaps by combining matplotlib, bokeh, and colorcet colormaps or palettes if available. May also be narrowed down to a particular provider or list of providers. """ if provider is None: provider = providers elif isi...
def _list_cmaps(provider=None, records=False): """ List available colormaps by combining matplotlib, bokeh, and colorcet colormaps or palettes if available. May also be narrowed down to a particular provider or list of providers. """ if provider is None: provider = providers elif isi...
[ "List", "available", "colormaps", "by", "combining", "matplotlib", "bokeh", "and", "colorcet", "colormaps", "or", "palettes", "if", "available", ".", "May", "also", "be", "narrowed", "down", "to", "a", "particular", "provider", "or", "list", "of", "providers", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L650-L696
[ "def", "_list_cmaps", "(", "provider", "=", "None", ",", "records", "=", "False", ")", ":", "if", "provider", "is", "None", ":", "provider", "=", "providers", "elif", "isinstance", "(", "provider", ",", "basestring", ")", ":", "if", "provider", "not", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
register_cmaps
Maintain descriptions of colormaps that include the following information: name - string name for the colormap category - intended use or purpose, mostly following matplotlib provider - package providing the colormap directly source - original source or creator of the colormaps bg - bas...
holoviews/plotting/util.py
def register_cmaps(category, provider, source, bg, names): """ Maintain descriptions of colormaps that include the following information: name - string name for the colormap category - intended use or purpose, mostly following matplotlib provider - package providing the colormap directly so...
def register_cmaps(category, provider, source, bg, names): """ Maintain descriptions of colormaps that include the following information: name - string name for the colormap category - intended use or purpose, mostly following matplotlib provider - package providing the colormap directly so...
[ "Maintain", "descriptions", "of", "colormaps", "that", "include", "the", "following", "information", ":" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L699-L713
[ "def", "register_cmaps", "(", "category", ",", "provider", ",", "source", ",", "bg", ",", "names", ")", ":", "for", "name", "in", "names", ":", "bisect", ".", "insort", "(", "cmap_info", ",", "CMapInfo", "(", "name", "=", "name", ",", "provider", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
list_cmaps
Return colormap names matching the specified filters.
holoviews/plotting/util.py
def list_cmaps(provider=None, records=False, name=None, category=None, source=None, bg=None, reverse=None): """ Return colormap names matching the specified filters. """ # Only uses names actually imported and currently available available = _list_cmaps(provider=provider, records=True...
def list_cmaps(provider=None, records=False, name=None, category=None, source=None, bg=None, reverse=None): """ Return colormap names matching the specified filters. """ # Only uses names actually imported and currently available available = _list_cmaps(provider=provider, records=True...
[ "Return", "colormap", "names", "matching", "the", "specified", "filters", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L716-L764
[ "def", "list_cmaps", "(", "provider", "=", "None", ",", "records", "=", "False", ",", "name", "=", "None", ",", "category", "=", "None", ",", "source", "=", "None", ",", "bg", "=", "None", ",", "reverse", "=", "None", ")", ":", "# Only uses names actua...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
process_cmap
Convert valid colormap specifications to a list of colors.
holoviews/plotting/util.py
def process_cmap(cmap, ncolors=None, provider=None, categorical=False): """ Convert valid colormap specifications to a list of colors. """ providers_checked="matplotlib, bokeh, or colorcet" if provider is None else provider if isinstance(cmap, Cycle): palette = [rgb2hex(c) if isinstance(c, ...
def process_cmap(cmap, ncolors=None, provider=None, categorical=False): """ Convert valid colormap specifications to a list of colors. """ providers_checked="matplotlib, bokeh, or colorcet" if provider is None else provider if isinstance(cmap, Cycle): palette = [rgb2hex(c) if isinstance(c, ...
[ "Convert", "valid", "colormap", "specifications", "to", "a", "list", "of", "colors", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L868-L906
[ "def", "process_cmap", "(", "cmap", ",", "ncolors", "=", "None", ",", "provider", "=", "None", ",", "categorical", "=", "False", ")", ":", "providers_checked", "=", "\"matplotlib, bokeh, or colorcet\"", "if", "provider", "is", "None", "else", "provider", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
color_intervals
Maps the supplied colors into bins defined by the supplied levels. If a clip tuple is defined the bins are clipped to the defined range otherwise the range is computed from the levels and returned. Arguments --------- colors: list List of colors (usually hex string or named colors) levels...
holoviews/plotting/util.py
def color_intervals(colors, levels, clip=None, N=255): """ Maps the supplied colors into bins defined by the supplied levels. If a clip tuple is defined the bins are clipped to the defined range otherwise the range is computed from the levels and returned. Arguments --------- colors: list ...
def color_intervals(colors, levels, clip=None, N=255): """ Maps the supplied colors into bins defined by the supplied levels. If a clip tuple is defined the bins are clipped to the defined range otherwise the range is computed from the levels and returned. Arguments --------- colors: list ...
[ "Maps", "the", "supplied", "colors", "into", "bins", "defined", "by", "the", "supplied", "levels", ".", "If", "a", "clip", "tuple", "is", "defined", "the", "bins", "are", "clipped", "to", "the", "defined", "range", "otherwise", "the", "range", "is", "compu...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L909-L955
[ "def", "color_intervals", "(", "colors", ",", "levels", ",", "clip", "=", "None", ",", "N", "=", "255", ")", ":", "if", "len", "(", "colors", ")", "!=", "len", "(", "levels", ")", "-", "1", ":", "raise", "ValueError", "(", "'The number of colors in the...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim_axis_label
Returns an axis label for one or more dimensions.
holoviews/plotting/util.py
def dim_axis_label(dimensions, separator=', '): """ Returns an axis label for one or more dimensions. """ if not isinstance(dimensions, list): dimensions = [dimensions] return separator.join([d.pprint_label for d in dimensions])
def dim_axis_label(dimensions, separator=', '): """ Returns an axis label for one or more dimensions. """ if not isinstance(dimensions, list): dimensions = [dimensions] return separator.join([d.pprint_label for d in dimensions])
[ "Returns", "an", "axis", "label", "for", "one", "or", "more", "dimensions", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L958-L963
[ "def", "dim_axis_label", "(", "dimensions", ",", "separator", "=", "', '", ")", ":", "if", "not", "isinstance", "(", "dimensions", ",", "list", ")", ":", "dimensions", "=", "[", "dimensions", "]", "return", "separator", ".", "join", "(", "[", "d", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
attach_streams
Attaches plot refresh to all streams on the object.
holoviews/plotting/util.py
def attach_streams(plot, obj, precedence=1.1): """ Attaches plot refresh to all streams on the object. """ def append_refresh(dmap): for stream in get_nested_streams(dmap): if plot.refresh not in stream._subscribers: stream.add_subscriber(plot.refresh, precedence) ...
def attach_streams(plot, obj, precedence=1.1): """ Attaches plot refresh to all streams on the object. """ def append_refresh(dmap): for stream in get_nested_streams(dmap): if plot.refresh not in stream._subscribers: stream.add_subscriber(plot.refresh, precedence) ...
[ "Attaches", "plot", "refresh", "to", "all", "streams", "on", "the", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L966-L974
[ "def", "attach_streams", "(", "plot", ",", "obj", ",", "precedence", "=", "1.1", ")", ":", "def", "append_refresh", "(", "dmap", ")", ":", "for", "stream", "in", "get_nested_streams", "(", "dmap", ")", ":", "if", "plot", ".", "refresh", "not", "in", "s...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
traverse_setter
Traverses the object and sets the supplied attribute on the object. Supports Dimensioned and DimensionedPlot types.
holoviews/plotting/util.py
def traverse_setter(obj, attribute, value): """ Traverses the object and sets the supplied attribute on the object. Supports Dimensioned and DimensionedPlot types. """ obj.traverse(lambda x: setattr(x, attribute, value))
def traverse_setter(obj, attribute, value): """ Traverses the object and sets the supplied attribute on the object. Supports Dimensioned and DimensionedPlot types. """ obj.traverse(lambda x: setattr(x, attribute, value))
[ "Traverses", "the", "object", "and", "sets", "the", "supplied", "attribute", "on", "the", "object", ".", "Supports", "Dimensioned", "and", "DimensionedPlot", "types", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L977-L982
[ "def", "traverse_setter", "(", "obj", ",", "attribute", ",", "value", ")", ":", "obj", ".", "traverse", "(", "lambda", "x", ":", "setattr", "(", "x", ",", "attribute", ",", "value", ")", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
_get_min_distance_numpy
NumPy based implementation of get_min_distance
holoviews/plotting/util.py
def _get_min_distance_numpy(element): """ NumPy based implementation of get_min_distance """ xys = element.array([0, 1]) with warnings.catch_warnings(): warnings.filterwarnings('ignore', r'invalid value encountered in') xys = xys.astype('float32').view(np.complex64) distances...
def _get_min_distance_numpy(element): """ NumPy based implementation of get_min_distance """ xys = element.array([0, 1]) with warnings.catch_warnings(): warnings.filterwarnings('ignore', r'invalid value encountered in') xys = xys.astype('float32').view(np.complex64) distances...
[ "NumPy", "based", "implementation", "of", "get_min_distance" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L985-L998
[ "def", "_get_min_distance_numpy", "(", "element", ")", ":", "xys", "=", "element", ".", "array", "(", "[", "0", ",", "1", "]", ")", "with", "warnings", ".", "catch_warnings", "(", ")", ":", "warnings", ".", "filterwarnings", "(", "'ignore'", ",", "r'inva...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_min_distance
Gets the minimum sampling distance of the x- and y-coordinates in a grid.
holoviews/plotting/util.py
def get_min_distance(element): """ Gets the minimum sampling distance of the x- and y-coordinates in a grid. """ try: from scipy.spatial.distance import pdist return pdist(element.array([0, 1])).min() except: return _get_min_distance_numpy(element)
def get_min_distance(element): """ Gets the minimum sampling distance of the x- and y-coordinates in a grid. """ try: from scipy.spatial.distance import pdist return pdist(element.array([0, 1])).min() except: return _get_min_distance_numpy(element)
[ "Gets", "the", "minimum", "sampling", "distance", "of", "the", "x", "-", "and", "y", "-", "coordinates", "in", "a", "grid", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L1001-L1010
[ "def", "get_min_distance", "(", "element", ")", ":", "try", ":", "from", "scipy", ".", "spatial", ".", "distance", "import", "pdist", "return", "pdist", "(", "element", ".", "array", "(", "[", "0", ",", "1", "]", ")", ")", ".", "min", "(", ")", "ex...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_directed_graph_paths
Computes paths for a directed path which include an arrow to indicate the directionality of each edge.
holoviews/plotting/util.py
def get_directed_graph_paths(element, arrow_length): """ Computes paths for a directed path which include an arrow to indicate the directionality of each edge. """ edgepaths = element._split_edgepaths edges = edgepaths.split(datatype='array', dimensions=edgepaths.kdims) arrows = [] for e...
def get_directed_graph_paths(element, arrow_length): """ Computes paths for a directed path which include an arrow to indicate the directionality of each edge. """ edgepaths = element._split_edgepaths edges = edgepaths.split(datatype='array', dimensions=edgepaths.kdims) arrows = [] for e...
[ "Computes", "paths", "for", "a", "directed", "path", "which", "include", "an", "arrow", "to", "indicate", "the", "directionality", "of", "each", "edge", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L1013-L1032
[ "def", "get_directed_graph_paths", "(", "element", ",", "arrow_length", ")", ":", "edgepaths", "=", "element", ".", "_split_edgepaths", "edges", "=", "edgepaths", ".", "split", "(", "datatype", "=", "'array'", ",", "dimensions", "=", "edgepaths", ".", "kdims", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
rgb2hex
Convert RGB(A) tuple to hex.
holoviews/plotting/util.py
def rgb2hex(rgb): """ Convert RGB(A) tuple to hex. """ if len(rgb) > 3: rgb = rgb[:-1] return "#{0:02x}{1:02x}{2:02x}".format(*(int(v*255) for v in rgb))
def rgb2hex(rgb): """ Convert RGB(A) tuple to hex. """ if len(rgb) > 3: rgb = rgb[:-1] return "#{0:02x}{1:02x}{2:02x}".format(*(int(v*255) for v in rgb))
[ "Convert", "RGB", "(", "A", ")", "tuple", "to", "hex", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L1035-L1041
[ "def", "rgb2hex", "(", "rgb", ")", ":", "if", "len", "(", "rgb", ")", ">", "3", ":", "rgb", "=", "rgb", "[", ":", "-", "1", "]", "return", "\"#{0:02x}{1:02x}{2:02x}\"", ".", "format", "(", "*", "(", "int", "(", "v", "*", "255", ")", "for", "v",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim_range_key
Returns the key to look up a dimension range.
holoviews/plotting/util.py
def dim_range_key(eldim): """ Returns the key to look up a dimension range. """ if isinstance(eldim, dim): dim_name = repr(eldim) if dim_name.startswith("'") and dim_name.endswith("'"): dim_name = dim_name[1:-1] else: dim_name = eldim.name return dim_name
def dim_range_key(eldim): """ Returns the key to look up a dimension range. """ if isinstance(eldim, dim): dim_name = repr(eldim) if dim_name.startswith("'") and dim_name.endswith("'"): dim_name = dim_name[1:-1] else: dim_name = eldim.name return dim_name
[ "Returns", "the", "key", "to", "look", "up", "a", "dimension", "range", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/util.py#L1044-L1054
[ "def", "dim_range_key", "(", "eldim", ")", ":", "if", "isinstance", "(", "eldim", ",", "dim", ")", ":", "dim_name", "=", "repr", "(", "eldim", ")", "if", "dim_name", ".", "startswith", "(", "\"'\"", ")", "and", "dim_name", ".", "endswith", "(", "\"'\""...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehServerWidgets.create_widget
Given a Dimension creates bokeh widgets to select along that dimension. For numeric data a slider widget is created which may be either discrete, if a holomap is supplied or the Dimension.values are set, or a continuous widget for DynamicMaps. If the slider is discrete the returned mappi...
holoviews/plotting/bokeh/widgets.py
def create_widget(self, dim, holomap=None, editable=False): """" Given a Dimension creates bokeh widgets to select along that dimension. For numeric data a slider widget is created which may be either discrete, if a holomap is supplied or the Dimension.values are set, or a contin...
def create_widget(self, dim, holomap=None, editable=False): """" Given a Dimension creates bokeh widgets to select along that dimension. For numeric data a slider widget is created which may be either discrete, if a holomap is supplied or the Dimension.values are set, or a contin...
[ "Given", "a", "Dimension", "creates", "bokeh", "widgets", "to", "select", "along", "that", "dimension", ".", "For", "numeric", "data", "a", "slider", "widget", "is", "created", "which", "may", "be", "either", "discrete", "if", "a", "holomap", "is", "supplied...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/widgets.py#L86-L174
[ "def", "create_widget", "(", "self", ",", "dim", ",", "holomap", "=", "None", ",", "editable", "=", "False", ")", ":", "label", ",", "mapping", "=", "None", ",", "None", "if", "holomap", "is", "None", ":", "if", "dim", ".", "values", ":", "if", "di...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehServerWidgets.get_widgets
Creates a set of widgets representing the dimensions on the plot object used to instantiate the widgets class.
holoviews/plotting/bokeh/widgets.py
def get_widgets(self): """ Creates a set of widgets representing the dimensions on the plot object used to instantiate the widgets class. """ widgets = OrderedDict() mappings = {} for dim in self.mock_obj.kdims: holomap = None if self.plot.dynamic else...
def get_widgets(self): """ Creates a set of widgets representing the dimensions on the plot object used to instantiate the widgets class. """ widgets = OrderedDict() mappings = {} for dim in self.mock_obj.kdims: holomap = None if self.plot.dynamic else...
[ "Creates", "a", "set", "of", "widgets", "representing", "the", "dimensions", "on", "the", "plot", "object", "used", "to", "instantiate", "the", "widgets", "class", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/widgets.py#L177-L193
[ "def", "get_widgets", "(", "self", ")", ":", "widgets", "=", "OrderedDict", "(", ")", "mappings", "=", "{", "}", "for", "dim", "in", "self", ".", "mock_obj", ".", "kdims", ":", "holomap", "=", "None", "if", "self", ".", "plot", ".", "dynamic", "else"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehServerWidgets.update
Handle update events on bokeh server.
holoviews/plotting/bokeh/widgets.py
def update(self): """ Handle update events on bokeh server. """ if not self._queue: return dim, widget_type, attr, old, new = self._queue[-1] self._queue = [] dim_label = dim.pprint_label label, widget = self.widgets[dim_label] if wid...
def update(self): """ Handle update events on bokeh server. """ if not self._queue: return dim, widget_type, attr, old, new = self._queue[-1] self._queue = [] dim_label = dim.pprint_label label, widget = self.widgets[dim_label] if wid...
[ "Handle", "update", "events", "on", "bokeh", "server", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/widgets.py#L223-L264
[ "def", "update", "(", "self", ")", ":", "if", "not", "self", ".", "_queue", ":", "return", "dim", ",", "widget_type", ",", "attr", ",", "old", ",", "new", "=", "self", ".", "_queue", "[", "-", "1", "]", "self", ".", "_queue", "=", "[", "]", "di...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehWidget._plot_figure
Returns the figure in html format on the first call and
holoviews/plotting/bokeh/widgets.py
def _plot_figure(self, idx, fig_format='json'): """ Returns the figure in html format on the first call and """ self.plot.update(idx) if self.embed: patch = self.renderer.diff(self.plot, binary=False) msg = serialize_json(dict(content=patch.content...
def _plot_figure(self, idx, fig_format='json'): """ Returns the figure in html format on the first call and """ self.plot.update(idx) if self.embed: patch = self.renderer.diff(self.plot, binary=False) msg = serialize_json(dict(content=patch.content...
[ "Returns", "the", "figure", "in", "html", "format", "on", "the", "first", "call", "and" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/widgets.py#L301-L311
[ "def", "_plot_figure", "(", "self", ",", "idx", ",", "fig_format", "=", "'json'", ")", ":", "self", ".", "plot", ".", "update", "(", "idx", ")", "if", "self", ".", "embed", ":", "patch", "=", "self", ".", "renderer", ".", "diff", "(", "self", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._init_tools
Processes the list of tools to be supplied to the plot.
holoviews/plotting/bokeh/element.py
def _init_tools(self, element, callbacks=[]): """ Processes the list of tools to be supplied to the plot. """ tooltips, hover_opts = self._hover_opts(element) tooltips = [(ttp.pprint_label, '@{%s}' % util.dimension_sanitizer(ttp.name)) if isinstance(ttp, Dimen...
def _init_tools(self, element, callbacks=[]): """ Processes the list of tools to be supplied to the plot. """ tooltips, hover_opts = self._hover_opts(element) tooltips = [(ttp.pprint_label, '@{%s}' % util.dimension_sanitizer(ttp.name)) if isinstance(ttp, Dimen...
[ "Processes", "the", "list", "of", "tools", "to", "be", "supplied", "to", "the", "plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/element.py#L212-L257
[ "def", "_init_tools", "(", "self", ",", "element", ",", "callbacks", "=", "[", "]", ")", ":", "tooltips", ",", "hover_opts", "=", "self", ".", "_hover_opts", "(", "element", ")", "tooltips", "=", "[", "(", "ttp", ".", "pprint_label", ",", "'@{%s}'", "%...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._get_hover_data
Initializes hover data based on Element dimension values. If empty initializes with no data.
holoviews/plotting/bokeh/element.py
def _get_hover_data(self, data, element, dimensions=None): """ Initializes hover data based on Element dimension values. If empty initializes with no data. """ if 'hover' not in self.handles or self.static_source: return for d in (dimensions or element.dimens...
def _get_hover_data(self, data, element, dimensions=None): """ Initializes hover data based on Element dimension values. If empty initializes with no data. """ if 'hover' not in self.handles or self.static_source: return for d in (dimensions or element.dimens...
[ "Initializes", "hover", "data", "based", "on", "Element", "dimension", "values", ".", "If", "empty", "initializes", "with", "no", "data", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/element.py#L267-L287
[ "def", "_get_hover_data", "(", "self", ",", "data", ",", "element", ",", "dimensions", "=", "None", ")", ":", "if", "'hover'", "not", "in", "self", ".", "handles", "or", "self", ".", "static_source", ":", "return", "for", "d", "in", "(", "dimensions", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._merge_ranges
Given a list of other plots return axes that are shared with another plot by matching the dimensions specs stored as tags on the dimensions.
holoviews/plotting/bokeh/element.py
def _merge_ranges(self, plots, xspecs, yspecs): """ Given a list of other plots return axes that are shared with another plot by matching the dimensions specs stored as tags on the dimensions. """ plot_ranges = {} for plot in plots: if plot is None: ...
def _merge_ranges(self, plots, xspecs, yspecs): """ Given a list of other plots return axes that are shared with another plot by matching the dimensions specs stored as tags on the dimensions. """ plot_ranges = {} for plot in plots: if plot is None: ...
[ "Given", "a", "list", "of", "other", "plots", "return", "axes", "that", "are", "shared", "with", "another", "plot", "by", "matching", "the", "dimensions", "specs", "stored", "as", "tags", "on", "the", "dimensions", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/element.py#L290-L310
[ "def", "_merge_ranges", "(", "self", ",", "plots", ",", "xspecs", ",", "yspecs", ")", ":", "plot_ranges", "=", "{", "}", "for", "plot", "in", "plots", ":", "if", "plot", "is", "None", ":", "continue", "if", "hasattr", "(", "plot", ",", "'x_range'", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._get_axis_dims
Returns the dimensions corresponding to each axis. Should return a list of dimensions or list of lists of dimensions, which will be formatted to label the axis and to link axes.
holoviews/plotting/bokeh/element.py
def _get_axis_dims(self, element): """Returns the dimensions corresponding to each axis. Should return a list of dimensions or list of lists of dimensions, which will be formatted to label the axis and to link axes. """ dims = element.dimensions()[:2] if len(dims...
def _get_axis_dims(self, element): """Returns the dimensions corresponding to each axis. Should return a list of dimensions or list of lists of dimensions, which will be formatted to label the axis and to link axes. """ dims = element.dimensions()[:2] if len(dims...
[ "Returns", "the", "dimensions", "corresponding", "to", "each", "axis", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/element.py#L313-L324
[ "def", "_get_axis_dims", "(", "self", ",", "element", ")", ":", "dims", "=", "element", ".", "dimensions", "(", ")", "[", ":", "2", "]", "if", "len", "(", "dims", ")", "==", "1", ":", "return", "dims", "+", "[", "None", ",", "None", "]", "else", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._init_plot
Initializes Bokeh figure to draw Element into and sets basic figure and axis attributes including axes types, labels, titles and plot height and width.
holoviews/plotting/bokeh/element.py
def _init_plot(self, key, element, plots, ranges=None): """ Initializes Bokeh figure to draw Element into and sets basic figure and axis attributes including axes types, labels, titles and plot height and width. """ subplots = list(self.subplots.values()) if self.subplots...
def _init_plot(self, key, element, plots, ranges=None): """ Initializes Bokeh figure to draw Element into and sets basic figure and axis attributes including axes types, labels, titles and plot height and width. """ subplots = list(self.subplots.values()) if self.subplots...
[ "Initializes", "Bokeh", "figure", "to", "draw", "Element", "into", "and", "sets", "basic", "figure", "and", "axis", "attributes", "including", "axes", "types", "labels", "titles", "and", "plot", "height", "and", "width", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/element.py#L425-L467
[ "def", "_init_plot", "(", "self", ",", "key", ",", "element", ",", "plots", ",", "ranges", "=", "None", ")", ":", "subplots", "=", "list", "(", "self", ".", "subplots", ".", "values", "(", ")", ")", "if", "self", ".", "subplots", "else", "[", "]", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655