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
Renderer.plotting_class
Given an object or Element class, return the suitable plotting class needed to render it with the current renderer.
holoviews/plotting/renderer.py
def plotting_class(cls, obj): """ Given an object or Element class, return the suitable plotting class needed to render it with the current renderer. """ if isinstance(obj, AdjointLayout) or obj is AdjointLayout: obj = Layout if isinstance(obj, type): ...
def plotting_class(cls, obj): """ Given an object or Element class, return the suitable plotting class needed to render it with the current renderer. """ if isinstance(obj, AdjointLayout) or obj is AdjointLayout: obj = Layout if isinstance(obj, type): ...
[ "Given", "an", "object", "or", "Element", "class", "return", "the", "suitable", "plotting", "class", "needed", "to", "render", "it", "with", "the", "current", "renderer", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/renderer.py#L434-L450
[ "def", "plotting_class", "(", "cls", ",", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "AdjointLayout", ")", "or", "obj", "is", "AdjointLayout", ":", "obj", "=", "Layout", "if", "isinstance", "(", "obj", ",", "type", ")", ":", "element_type", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Renderer.html_assets
Returns JS and CSS and for embedding of widgets.
holoviews/plotting/renderer.py
def html_assets(cls, core=True, extras=True, backends=None, script=False): """ Returns JS and CSS and for embedding of widgets. """ if backends is None: backends = [cls.backend] if cls.backend else [] # Get all the widgets and find the set of required js widget files...
def html_assets(cls, core=True, extras=True, backends=None, script=False): """ Returns JS and CSS and for embedding of widgets. """ if backends is None: backends = [cls.backend] if cls.backend else [] # Get all the widgets and find the set of required js widget files...
[ "Returns", "JS", "and", "CSS", "and", "for", "embedding", "of", "widgets", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/renderer.py#L454-L520
[ "def", "html_assets", "(", "cls", ",", "core", "=", "True", ",", "extras", "=", "True", ",", "backends", "=", "None", ",", "script", "=", "False", ")", ":", "if", "backends", "is", "None", ":", "backends", "=", "[", "cls", ".", "backend", "]", "if"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Renderer.save
Save a HoloViews object to file, either using an explicitly supplied format or to the appropriate default.
holoviews/plotting/renderer.py
def save(self_or_cls, obj, basename, fmt='auto', key={}, info={}, options=None, **kwargs): """ Save a HoloViews object to file, either using an explicitly supplied format or to the appropriate default. """ if info or key: raise Exception('Renderer does not support sav...
def save(self_or_cls, obj, basename, fmt='auto', key={}, info={}, options=None, **kwargs): """ Save a HoloViews object to file, either using an explicitly supplied format or to the appropriate default. """ if info or key: raise Exception('Renderer does not support sav...
[ "Save", "a", "HoloViews", "object", "to", "file", "either", "using", "an", "explicitly", "supplied", "format", "or", "to", "the", "appropriate", "default", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/renderer.py#L537-L571
[ "def", "save", "(", "self_or_cls", ",", "obj", ",", "basename", ",", "fmt", "=", "'auto'", ",", "key", "=", "{", "}", ",", "info", "=", "{", "}", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "info", "or", "key", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Renderer.load_nb
Loads any resources required for display of plots in the Jupyter notebook
holoviews/plotting/renderer.py
def load_nb(cls, inline=True): """ Loads any resources required for display of plots in the Jupyter notebook """ with param.logging_level('ERROR'): cls.notebook_context = True cls.comm_manager = JupyterCommManager
def load_nb(cls, inline=True): """ Loads any resources required for display of plots in the Jupyter notebook """ with param.logging_level('ERROR'): cls.notebook_context = True cls.comm_manager = JupyterCommManager
[ "Loads", "any", "resources", "required", "for", "display", "of", "plots", "in", "the", "Jupyter", "notebook" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/renderer.py#L609-L616
[ "def", "load_nb", "(", "cls", ",", "inline", "=", "True", ")", ":", "with", "param", ".", "logging_level", "(", "'ERROR'", ")", ":", "cls", ".", "notebook_context", "=", "True", "cls", ".", "comm_manager", "=", "JupyterCommManager" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Renderer._delete_plot
Deletes registered plots and calls Plot.cleanup
holoviews/plotting/renderer.py
def _delete_plot(cls, plot_id): """ Deletes registered plots and calls Plot.cleanup """ plot = cls._plots.get(plot_id) if plot is None: return plot.cleanup() del cls._plots[plot_id]
def _delete_plot(cls, plot_id): """ Deletes registered plots and calls Plot.cleanup """ plot = cls._plots.get(plot_id) if plot is None: return plot.cleanup() del cls._plots[plot_id]
[ "Deletes", "registered", "plots", "and", "calls", "Plot", ".", "cleanup" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/renderer.py#L620-L628
[ "def", "_delete_plot", "(", "cls", ",", "plot_id", ")", ":", "plot", "=", "cls", ".", "_plots", ".", "get", "(", "plot_id", ")", "if", "plot", "is", "None", ":", "return", "plot", ".", "cleanup", "(", ")", "del", "cls", ".", "_plots", "[", "plot_id...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
image_overlay._match
Return the strength of the match (None if no match)
holoviews/operation/element.py
def _match(cls, el, spec): "Return the strength of the match (None if no match)" spec_dict = dict(zip(['type', 'group', 'label'], spec.split('.'))) if not isinstance(el, Image) or spec_dict['type'] != 'Image': raise NotImplementedError("Only Image currently supported") sanit...
def _match(cls, el, spec): "Return the strength of the match (None if no match)" spec_dict = dict(zip(['type', 'group', 'label'], spec.split('.'))) if not isinstance(el, Image) or spec_dict['type'] != 'Image': raise NotImplementedError("Only Image currently supported") sanit...
[ "Return", "the", "strength", "of", "the", "match", "(", "None", "if", "no", "match", ")" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/operation/element.py#L212-L225
[ "def", "_match", "(", "cls", ",", "el", ",", "spec", ")", ":", "spec_dict", "=", "dict", "(", "zip", "(", "[", "'type'", ",", "'group'", ",", "'label'", "]", ",", "spec", ".", "split", "(", "'.'", ")", ")", ")", "if", "not", "isinstance", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
image_overlay._match_overlay
Given a raster or input overlay, generate a list of matched elements (None if no match) and corresponding tuple of match strength values.
holoviews/operation/element.py
def _match_overlay(self, raster, overlay_spec): """ Given a raster or input overlay, generate a list of matched elements (None if no match) and corresponding tuple of match strength values. """ ordering = [None]*len(overlay_spec) # Elements to overlay strengths = ...
def _match_overlay(self, raster, overlay_spec): """ Given a raster or input overlay, generate a list of matched elements (None if no match) and corresponding tuple of match strength values. """ ordering = [None]*len(overlay_spec) # Elements to overlay strengths = ...
[ "Given", "a", "raster", "or", "input", "overlay", "generate", "a", "list", "of", "matched", "elements", "(", "None", "if", "no", "match", ")", "and", "corresponding", "tuple", "of", "match", "strength", "values", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/operation/element.py#L228-L247
[ "def", "_match_overlay", "(", "self", ",", "raster", ",", "overlay_spec", ")", ":", "ordering", "=", "[", "None", "]", "*", "len", "(", "overlay_spec", ")", "# Elements to overlay", "strengths", "=", "[", "0", "]", "*", "len", "(", "overlay_spec", ")", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface._inner_dataset_template
Returns a Dataset template used as a wrapper around the data contained within the multi-interface dataset.
holoviews/core/data/multipath.py
def _inner_dataset_template(cls, dataset): """ Returns a Dataset template used as a wrapper around the data contained within the multi-interface dataset. """ from . import Dataset vdims = dataset.vdims if getattr(dataset, 'level', None) is None else [] return Data...
def _inner_dataset_template(cls, dataset): """ Returns a Dataset template used as a wrapper around the data contained within the multi-interface dataset. """ from . import Dataset vdims = dataset.vdims if getattr(dataset, 'level', None) is None else [] return Data...
[ "Returns", "a", "Dataset", "template", "used", "as", "a", "wrapper", "around", "the", "data", "contained", "within", "the", "multi", "-", "interface", "dataset", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L79-L87
[ "def", "_inner_dataset_template", "(", "cls", ",", "dataset", ")", ":", "from", ".", "import", "Dataset", "vdims", "=", "dataset", ".", "vdims", "if", "getattr", "(", "dataset", ",", "'level'", ",", "None", ")", "is", "None", "else", "[", "]", "return", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.isscalar
Tests if dimension is scalar in each subpath.
holoviews/core/data/multipath.py
def isscalar(cls, dataset, dim): """ Tests if dimension is scalar in each subpath. """ if not dataset.data: return True ds = cls._inner_dataset_template(dataset) isscalar = [] for d in dataset.data: ds.data = d isscalar.append(d...
def isscalar(cls, dataset, dim): """ Tests if dimension is scalar in each subpath. """ if not dataset.data: return True ds = cls._inner_dataset_template(dataset) isscalar = [] for d in dataset.data: ds.data = d isscalar.append(d...
[ "Tests", "if", "dimension", "is", "scalar", "in", "each", "subpath", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L142-L153
[ "def", "isscalar", "(", "cls", ",", "dataset", ",", "dim", ")", ":", "if", "not", "dataset", ".", "data", ":", "return", "True", "ds", "=", "cls", ".", "_inner_dataset_template", "(", "dataset", ")", "isscalar", "=", "[", "]", "for", "d", "in", "data...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.select
Applies selectiong on all the subpaths.
holoviews/core/data/multipath.py
def select(cls, dataset, selection_mask=None, **selection): """ Applies selectiong on all the subpaths. """ if not dataset.data: return [] ds = cls._inner_dataset_template(dataset) data = [] for d in dataset.data: ds.data = d se...
def select(cls, dataset, selection_mask=None, **selection): """ Applies selectiong on all the subpaths. """ if not dataset.data: return [] ds = cls._inner_dataset_template(dataset) data = [] for d in dataset.data: ds.data = d se...
[ "Applies", "selectiong", "on", "all", "the", "subpaths", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L157-L169
[ "def", "select", "(", "cls", ",", "dataset", ",", "selection_mask", "=", "None", ",", "*", "*", "selection", ")", ":", "if", "not", "dataset", ".", "data", ":", "return", "[", "]", "ds", "=", "cls", ".", "_inner_dataset_template", "(", "dataset", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.select_paths
Allows selecting paths with usual NumPy slicing index.
holoviews/core/data/multipath.py
def select_paths(cls, dataset, selection): """ Allows selecting paths with usual NumPy slicing index. """ return [s[0] for s in np.array([{0: p} for p in dataset.data])[selection]]
def select_paths(cls, dataset, selection): """ Allows selecting paths with usual NumPy slicing index. """ return [s[0] for s in np.array([{0: p} for p in dataset.data])[selection]]
[ "Allows", "selecting", "paths", "with", "usual", "NumPy", "slicing", "index", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L172-L176
[ "def", "select_paths", "(", "cls", ",", "dataset", ",", "selection", ")", ":", "return", "[", "s", "[", "0", "]", "for", "s", "in", "np", ".", "array", "(", "[", "{", "0", ":", "p", "}", "for", "p", "in", "dataset", ".", "data", "]", ")", "["...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.shape
Returns the shape of all subpaths, making it appear like a single array of concatenated subpaths separated by NaN values.
holoviews/core/data/multipath.py
def shape(cls, dataset): """ Returns the shape of all subpaths, making it appear like a single array of concatenated subpaths separated by NaN values. """ if not dataset.data: return (0, len(dataset.dimensions())) rows, cols = 0, 0 ds = cls._inner_dat...
def shape(cls, dataset): """ Returns the shape of all subpaths, making it appear like a single array of concatenated subpaths separated by NaN values. """ if not dataset.data: return (0, len(dataset.dimensions())) rows, cols = 0, 0 ds = cls._inner_dat...
[ "Returns", "the", "shape", "of", "all", "subpaths", "making", "it", "appear", "like", "a", "single", "array", "of", "concatenated", "subpaths", "separated", "by", "NaN", "values", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L229-L243
[ "def", "shape", "(", "cls", ",", "dataset", ")", ":", "if", "not", "dataset", ".", "data", ":", "return", "(", "0", ",", "len", "(", "dataset", ".", "dimensions", "(", ")", ")", ")", "rows", ",", "cols", "=", "0", ",", "0", "ds", "=", "cls", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.length
Returns the length of the multi-tabular dataset making it appear like a single array of concatenated subpaths separated by NaN values.
holoviews/core/data/multipath.py
def length(cls, dataset): """ Returns the length of the multi-tabular dataset making it appear like a single array of concatenated subpaths separated by NaN values. """ if not dataset.data: return 0 length = 0 ds = cls._inner_dataset_template(d...
def length(cls, dataset): """ Returns the length of the multi-tabular dataset making it appear like a single array of concatenated subpaths separated by NaN values. """ if not dataset.data: return 0 length = 0 ds = cls._inner_dataset_template(d...
[ "Returns", "the", "length", "of", "the", "multi", "-", "tabular", "dataset", "making", "it", "appear", "like", "a", "single", "array", "of", "concatenated", "subpaths", "separated", "by", "NaN", "values", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L246-L259
[ "def", "length", "(", "cls", ",", "dataset", ")", ":", "if", "not", "dataset", ".", "data", ":", "return", "0", "length", "=", "0", "ds", "=", "cls", ".", "_inner_dataset_template", "(", "dataset", ")", "for", "d", "in", "dataset", ".", "data", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.values
Returns a single concatenated array of all subpaths separated by NaN values. If expanded keyword is False an array of arrays is returned.
holoviews/core/data/multipath.py
def values(cls, dataset, dimension, expanded, flat): """ Returns a single concatenated array of all subpaths separated by NaN values. If expanded keyword is False an array of arrays is returned. """ if not dataset.data: return np.array([]) values = [] ...
def values(cls, dataset, dimension, expanded, flat): """ Returns a single concatenated array of all subpaths separated by NaN values. If expanded keyword is False an array of arrays is returned. """ if not dataset.data: return np.array([]) values = [] ...
[ "Returns", "a", "single", "concatenated", "array", "of", "all", "subpaths", "separated", "by", "NaN", "values", ".", "If", "expanded", "keyword", "is", "False", "an", "array", "of", "arrays", "is", "returned", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L277-L302
[ "def", "values", "(", "cls", ",", "dataset", ",", "dimension", ",", "expanded", ",", "flat", ")", ":", "if", "not", "dataset", ".", "data", ":", "return", "np", ".", "array", "(", "[", "]", ")", "values", "=", "[", "]", "ds", "=", "cls", ".", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MultiInterface.split
Splits a multi-interface Dataset into regular Datasets using regular tabular interfaces.
holoviews/core/data/multipath.py
def split(cls, dataset, start, end, datatype, **kwargs): """ Splits a multi-interface Dataset into regular Datasets using regular tabular interfaces. """ objs = [] if datatype is None: for d in dataset.data[start: end]: objs.append(dataset.clon...
def split(cls, dataset, start, end, datatype, **kwargs): """ Splits a multi-interface Dataset into regular Datasets using regular tabular interfaces. """ objs = [] if datatype is None: for d in dataset.data[start: end]: objs.append(dataset.clon...
[ "Splits", "a", "multi", "-", "interface", "Dataset", "into", "regular", "Datasets", "using", "regular", "tabular", "interfaces", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/multipath.py#L305-L332
[ "def", "split", "(", "cls", ",", "dataset", ",", "start", ",", "end", ",", "datatype", ",", "*", "*", "kwargs", ")", ":", "objs", "=", "[", "]", "if", "datatype", "is", "None", ":", "for", "d", "in", "dataset", ".", "data", "[", "start", ":", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Element.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/element.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/element.py#L29-L61
[ "def", "hist", "(", "self", ",", "dimension", "=", "None", ",", "num_bins", "=", "20", ",", "bin_range", "=", "None", ",", "adjoin", "=", "True", ",", "*", "*", "kwargs", ")", ":", "from", ".", ".", "operation", "import", "histogram", "if", "not", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Element.dframe
Convert dimension values to DataFrame. Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions. Args: dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index Return...
holoviews/core/element.py
def dframe(self, dimensions=None, multi_index=False): """Convert dimension values to DataFrame. Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions. Args: dimensions: Dimensions to return as columns mul...
def dframe(self, dimensions=None, multi_index=False): """Convert dimension values to DataFrame. Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions. Args: dimensions: Dimensions to return as columns mul...
[ "Convert", "dimension", "values", "to", "DataFrame", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L207-L230
[ "def", "dframe", "(", "self", ",", "dimensions", "=", "None", ",", "multi_index", "=", "False", ")", ":", "import", "pandas", "as", "pd", "if", "dimensions", "is", "None", ":", "dimensions", "=", "[", "d", ".", "name", "for", "d", "in", "self", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Element.array
Convert dimension values to columnar array. Args: dimensions: List of dimensions to return Returns: Array of columns corresponding to each dimension
holoviews/core/element.py
def array(self, dimensions=None): """Convert dimension values to columnar array. Args: dimensions: List of dimensions to return Returns: Array of columns corresponding to each dimension """ if dimensions is None: dims = [d for d in self.kdims...
def array(self, dimensions=None): """Convert dimension values to columnar array. Args: dimensions: List of dimensions to return Returns: Array of columns corresponding to each dimension """ if dimensions is None: dims = [d for d in self.kdims...
[ "Convert", "dimension", "values", "to", "columnar", "array", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L233-L254
[ "def", "array", "(", "self", ",", "dimensions", "=", "None", ")", ":", "if", "dimensions", "is", "None", ":", "dims", "=", "[", "d", "for", "d", "in", "self", ".", "kdims", "+", "self", ".", "vdims", "]", "else", ":", "dims", "=", "[", "self", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Element.table
Deprecated method to convert any Element to a Table.
holoviews/core/element.py
def table(self, datatype=None): "Deprecated method to convert any Element to a Table." if config.future_deprecations: self.param.warning( "The table method is deprecated and should no " "longer be used. Instead cast the %s to a " "a Table direc...
def table(self, datatype=None): "Deprecated method to convert any Element to a Table." if config.future_deprecations: self.param.warning( "The table method is deprecated and should no " "longer be used. Instead cast the %s to a " "a Table direc...
[ "Deprecated", "method", "to", "convert", "any", "Element", "to", "a", "Table", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L261-L272
[ "def", "table", "(", "self", ",", "datatype", "=", "None", ")", ":", "if", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", "warning", "(", "\"The table method is deprecated and should no \"", "\"longer be used. Instead cast the %s to a \"", "\"a Ta...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Element.mapping
Deprecated method to convert data to dictionary
holoviews/core/element.py
def mapping(self, kdims=None, vdims=None, **kwargs): "Deprecated method to convert data to dictionary" if config.future_deprecations: self.param.warning( "The mapping method is deprecated and should no " "longer be used. Use another one of the common " ...
def mapping(self, kdims=None, vdims=None, **kwargs): "Deprecated method to convert data to dictionary" if config.future_deprecations: self.param.warning( "The mapping method is deprecated and should no " "longer be used. Use another one of the common " ...
[ "Deprecated", "method", "to", "convert", "data", "to", "dictionary" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L275-L297
[ "def", "mapping", "(", "self", ",", "kdims", "=", "None", ",", "vdims", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", "warning", "(", "\"The mapping method is deprecated and should...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Tabular.pprint_cell
Formatted contents of table cell. Args: row (int): Integer index of table row col (int): Integer index of table column Returns: Formatted table cell contents
holoviews/core/element.py
def pprint_cell(self, row, col): """Formatted contents of table cell. Args: row (int): Integer index of table row col (int): Integer index of table column Returns: Formatted table cell contents """ ndims = self.ndims if col >= self.co...
def pprint_cell(self, row, col): """Formatted contents of table cell. Args: row (int): Integer index of table row col (int): Integer index of table column Returns: Formatted table cell contents """ ndims = self.ndims if col >= self.co...
[ "Formatted", "contents", "of", "table", "cell", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L320-L344
[ "def", "pprint_cell", "(", "self", ",", "row", ",", "col", ")", ":", "ndims", "=", "self", ".", "ndims", "if", "col", ">=", "self", ".", "cols", ":", "raise", "Exception", "(", "\"Maximum column index is %d\"", "%", "self", ".", "cols", "-", "1", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Collator.static_dimensions
Return all constant dimensions.
holoviews/core/element.py
def static_dimensions(self): """ Return all constant dimensions. """ dimensions = [] for dim in self.kdims: if len(set(self.dimension_values(dim.name))) == 1: dimensions.append(dim) return dimensions
def static_dimensions(self): """ Return all constant dimensions. """ dimensions = [] for dim in self.kdims: if len(set(self.dimension_values(dim.name))) == 1: dimensions.append(dim) return dimensions
[ "Return", "all", "constant", "dimensions", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L481-L489
[ "def", "static_dimensions", "(", "self", ")", ":", "dimensions", "=", "[", "]", "for", "dim", "in", "self", ".", "kdims", ":", "if", "len", "(", "set", "(", "self", ".", "dimension_values", "(", "dim", ".", "name", ")", ")", ")", "==", "1", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Collator._add_dimensions
Recursively descend through an Layout and NdMapping objects in order to add the supplied dimension values to all contained HoloMaps.
holoviews/core/element.py
def _add_dimensions(self, item, dims, constant_keys): """ Recursively descend through an Layout and NdMapping objects in order to add the supplied dimension values to all contained HoloMaps. """ if isinstance(item, Layout): item.fixed = False dim_vals...
def _add_dimensions(self, item, dims, constant_keys): """ Recursively descend through an Layout and NdMapping objects in order to add the supplied dimension values to all contained HoloMaps. """ if isinstance(item, Layout): item.fixed = False dim_vals...
[ "Recursively", "descend", "through", "an", "Layout", "and", "NdMapping", "objects", "in", "order", "to", "add", "the", "supplied", "dimension", "values", "to", "all", "contained", "HoloMaps", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/element.py#L492-L523
[ "def", "_add_dimensions", "(", "self", ",", "item", ",", "dims", ",", "constant_keys", ")", ":", "if", "isinstance", "(", "item", ",", "Layout", ")", ":", "item", ".", "fixed", "=", "False", "dim_vals", "=", "[", "(", "dim", ",", "val", ")", "for", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
_kde_support
Establish support for a kernel density estimate.
holoviews/operation/stats.py
def _kde_support(bin_range, bw, gridsize, cut, clip): """Establish support for a kernel density estimate.""" kmin, kmax = bin_range[0] - bw * cut, bin_range[1] + bw * cut if isfinite(clip[0]): kmin = max(kmin, clip[0]) if isfinite(clip[1]): kmax = min(kmax, clip[1]) return np.linspac...
def _kde_support(bin_range, bw, gridsize, cut, clip): """Establish support for a kernel density estimate.""" kmin, kmax = bin_range[0] - bw * cut, bin_range[1] + bw * cut if isfinite(clip[0]): kmin = max(kmin, clip[0]) if isfinite(clip[1]): kmax = min(kmax, clip[1]) return np.linspac...
[ "Establish", "support", "for", "a", "kernel", "density", "estimate", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/operation/stats.py#L13-L20
[ "def", "_kde_support", "(", "bin_range", ",", "bw", ",", "gridsize", ",", "cut", ",", "clip", ")", ":", "kmin", ",", "kmax", "=", "bin_range", "[", "0", "]", "-", "bw", "*", "cut", ",", "bin_range", "[", "1", "]", "+", "bw", "*", "cut", "if", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer.show
Renders the supplied object and displays it using the active GUI backend.
holoviews/plotting/mpl/renderer.py
def show(self, obj): """ Renders the supplied object and displays it using the active GUI backend. """ if self.interactive: if isinstance(obj, list): return [self.get_plot(o) for o in obj] return self.get_plot(obj) from .plot impor...
def show(self, obj): """ Renders the supplied object and displays it using the active GUI backend. """ if self.interactive: if isinstance(obj, list): return [self.get_plot(o) for o in obj] return self.get_plot(obj) from .plot impor...
[ "Renders", "the", "supplied", "object", "and", "displays", "it", "using", "the", "active", "GUI", "backend", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L117-L139
[ "def", "show", "(", "self", ",", "obj", ")", ":", "if", "self", ".", "interactive", ":", "if", "isinstance", "(", "obj", ",", "list", ")", ":", "return", "[", "self", ".", "get_plot", "(", "o", ")", "for", "o", "in", "obj", "]", "return", "self",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer.plot_options
Given a holoviews object and a percentage size, apply heuristics to compute a suitable figure size. For instance, scaling layouts and grids linearly can result in unwieldy figure sizes when there are a large number of elements. As ad hoc heuristics are used, this functionality is kept se...
holoviews/plotting/mpl/renderer.py
def plot_options(cls, obj, percent_size): """ Given a holoviews object and a percentage size, apply heuristics to compute a suitable figure size. For instance, scaling layouts and grids linearly can result in unwieldy figure sizes when there are a large number of elements. As ad ...
def plot_options(cls, obj, percent_size): """ Given a holoviews object and a percentage size, apply heuristics to compute a suitable figure size. For instance, scaling layouts and grids linearly can result in unwieldy figure sizes when there are a large number of elements. As ad ...
[ "Given", "a", "holoviews", "object", "and", "a", "percentage", "size", "apply", "heuristics", "to", "compute", "a", "suitable", "figure", "size", ".", "For", "instance", "scaling", "layouts", "and", "grids", "linearly", "can", "result", "in", "unwieldy", "figu...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L143-L163
[ "def", "plot_options", "(", "cls", ",", "obj", ",", "percent_size", ")", ":", "from", ".", "plot", "import", "MPLPlot", "factor", "=", "percent_size", "/", "100.0", "obj", "=", "obj", ".", "last", "if", "isinstance", "(", "obj", ",", "HoloMap", ")", "e...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer.diff
Returns the latest plot data to update an existing plot.
holoviews/plotting/mpl/renderer.py
def diff(self, plot): """ Returns the latest plot data to update an existing plot. """ if self.fig == 'auto': figure_format = self.params('fig').objects[0] else: figure_format = self.fig return self.html(plot, figure_format)
def diff(self, plot): """ Returns the latest plot data to update an existing plot. """ if self.fig == 'auto': figure_format = self.params('fig').objects[0] else: figure_format = self.fig return self.html(plot, figure_format)
[ "Returns", "the", "latest", "plot", "data", "to", "update", "an", "existing", "plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L173-L181
[ "def", "diff", "(", "self", ",", "plot", ")", ":", "if", "self", ".", "fig", "==", "'auto'", ":", "figure_format", "=", "self", ".", "params", "(", "'fig'", ")", ".", "objects", "[", "0", "]", "else", ":", "figure_format", "=", "self", ".", "fig", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer._figure_data
Render matplotlib figure object and return the corresponding data. If as_script is True, the content will be split in an HTML and a JS component. Similar to IPython.core.pylabtools.print_figure but without any IPython dependency.
holoviews/plotting/mpl/renderer.py
def _figure_data(self, plot, fmt='png', bbox_inches='tight', as_script=False, **kwargs): """ Render matplotlib figure object and return the corresponding data. If as_script is True, the content will be split in an HTML and a JS component. Similar to IPython.core.pylabtools.prin...
def _figure_data(self, plot, fmt='png', bbox_inches='tight', as_script=False, **kwargs): """ Render matplotlib figure object and return the corresponding data. If as_script is True, the content will be split in an HTML and a JS component. Similar to IPython.core.pylabtools.prin...
[ "Render", "matplotlib", "figure", "object", "and", "return", "the", "corresponding", "data", ".", "If", "as_script", "is", "True", "the", "content", "will", "be", "split", "in", "an", "HTML", "and", "a", "JS", "component", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L184-L233
[ "def", "_figure_data", "(", "self", ",", "plot", ",", "fmt", "=", "'png'", ",", "bbox_inches", "=", "'tight'", ",", "as_script", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "fmt", "in", "[", "'gif'", ",", "'mp4'", ",", "'webm'", "]", ":"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer._anim_data
Render a matplotlib animation object and return the corresponding data.
holoviews/plotting/mpl/renderer.py
def _anim_data(self, anim, fmt): """ Render a matplotlib animation object and return the corresponding data. """ (writer, _, anim_kwargs, extra_args) = ANIMATION_OPTS[fmt] if extra_args != []: anim_kwargs = dict(anim_kwargs, extra_args=extra_args) if self.fps...
def _anim_data(self, anim, fmt): """ Render a matplotlib animation object and return the corresponding data. """ (writer, _, anim_kwargs, extra_args) = ANIMATION_OPTS[fmt] if extra_args != []: anim_kwargs = dict(anim_kwargs, extra_args=extra_args) if self.fps...
[ "Render", "a", "matplotlib", "animation", "object", "and", "return", "the", "corresponding", "data", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L236-L253
[ "def", "_anim_data", "(", "self", ",", "anim", ",", "fmt", ")", ":", "(", "writer", ",", "_", ",", "anim_kwargs", ",", "extra_args", ")", "=", "ANIMATION_OPTS", "[", "fmt", "]", "if", "extra_args", "!=", "[", "]", ":", "anim_kwargs", "=", "dict", "("...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer._compute_bbox
Compute the tight bounding box for each figure once, reducing number of required canvas draw calls from N*2 to N+1 as a function of the number of frames. Tight bounding box computing code here mirrors: matplotlib.backend_bases.FigureCanvasBase.print_figure as it hasn't been fact...
holoviews/plotting/mpl/renderer.py
def _compute_bbox(self, fig, kw): """ Compute the tight bounding box for each figure once, reducing number of required canvas draw calls from N*2 to N+1 as a function of the number of frames. Tight bounding box computing code here mirrors: matplotlib.backend_bases.Figure...
def _compute_bbox(self, fig, kw): """ Compute the tight bounding box for each figure once, reducing number of required canvas draw calls from N*2 to N+1 as a function of the number of frames. Tight bounding box computing code here mirrors: matplotlib.backend_bases.Figure...
[ "Compute", "the", "tight", "bounding", "box", "for", "each", "figure", "once", "reducing", "number", "of", "required", "canvas", "draw", "calls", "from", "N", "*", "2", "to", "N", "+", "1", "as", "a", "function", "of", "the", "number", "of", "frames", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L256-L278
[ "def", "_compute_bbox", "(", "self", ",", "fig", ",", "kw", ")", ":", "fig_id", "=", "id", "(", "fig", ")", "if", "kw", "[", "'bbox_inches'", "]", "==", "'tight'", ":", "if", "not", "fig_id", "in", "MPLRenderer", ".", "drawn", ":", "fig", ".", "set...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
MPLRenderer.load_nb
Initialize matplotlib backend
holoviews/plotting/mpl/renderer.py
def load_nb(cls, inline=True): """ Initialize matplotlib backend """ import matplotlib.pyplot as plt backend = plt.get_backend() if backend not in ['agg', 'module://ipykernel.pylab.backend_inline']: plt.switch_backend('agg')
def load_nb(cls, inline=True): """ Initialize matplotlib backend """ import matplotlib.pyplot as plt backend = plt.get_backend() if backend not in ['agg', 'module://ipykernel.pylab.backend_inline']: plt.switch_backend('agg')
[ "Initialize", "matplotlib", "backend" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/renderer.py#L296-L303
[ "def", "load_nb", "(", "cls", ",", "inline", "=", "True", ")", ":", "import", "matplotlib", ".", "pyplot", "as", "plt", "backend", "=", "plt", ".", "get_backend", "(", ")", "if", "backend", "not", "in", "[", "'agg'", ",", "'module://ipykernel.pylab.backend...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
cleanup_custom_options
Cleans up unused custom trees if all objects referencing the custom id have been garbage collected or tree is otherwise unreferenced.
holoviews/core/options.py
def cleanup_custom_options(id, weakref=None): """ Cleans up unused custom trees if all objects referencing the custom id have been garbage collected or tree is otherwise unreferenced. """ try: if Store._options_context: return weakrefs = Store._weakrefs.get(id, []) ...
def cleanup_custom_options(id, weakref=None): """ Cleans up unused custom trees if all objects referencing the custom id have been garbage collected or tree is otherwise unreferenced. """ try: if Store._options_context: return weakrefs = Store._weakrefs.get(id, []) ...
[ "Cleans", "up", "unused", "custom", "trees", "if", "all", "objects", "referencing", "the", "custom", "id", "have", "been", "garbage", "collected", "or", "tree", "is", "otherwise", "unreferenced", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L51-L80
[ "def", "cleanup_custom_options", "(", "id", ",", "weakref", "=", "None", ")", ":", "try", ":", "if", "Store", ".", "_options_context", ":", "return", "weakrefs", "=", "Store", ".", "_weakrefs", ".", "get", "(", "id", ",", "[", "]", ")", "if", "weakref"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
options_policy
Context manager to temporarily set the skip_invalid and warn_on_skip class parameters on Options.
holoviews/core/options.py
def options_policy(skip_invalid, warn_on_skip): """ Context manager to temporarily set the skip_invalid and warn_on_skip class parameters on Options. """ settings = (Options.skip_invalid, Options.warn_on_skip) (Options.skip_invalid, Options.warn_on_skip) = (skip_invalid, warn_on_skip) yield ...
def options_policy(skip_invalid, warn_on_skip): """ Context manager to temporarily set the skip_invalid and warn_on_skip class parameters on Options. """ settings = (Options.skip_invalid, Options.warn_on_skip) (Options.skip_invalid, Options.warn_on_skip) = (skip_invalid, warn_on_skip) yield ...
[ "Context", "manager", "to", "temporarily", "set", "the", "skip_invalid", "and", "warn_on_skip", "class", "parameters", "on", "Options", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L204-L212
[ "def", "options_policy", "(", "skip_invalid", ",", "warn_on_skip", ")", ":", "settings", "=", "(", "Options", ".", "skip_invalid", ",", "Options", ".", "warn_on_skip", ")", "(", "Options", ".", "skip_invalid", ",", "Options", ".", "warn_on_skip", ")", "=", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptionError.format_options_error
Return a fuzzy match message based on the OptionError
holoviews/core/options.py
def format_options_error(self): """ Return a fuzzy match message based on the OptionError """ allowed_keywords = self.allowed_keywords target = allowed_keywords.target matches = allowed_keywords.fuzzy_match(self.invalid_keyword) if not matches: matches...
def format_options_error(self): """ Return a fuzzy match message based on the OptionError """ allowed_keywords = self.allowed_keywords target = allowed_keywords.target matches = allowed_keywords.fuzzy_match(self.invalid_keyword) if not matches: matches...
[ "Return", "a", "fuzzy", "match", "message", "based", "on", "the", "OptionError" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L121-L158
[ "def", "format_options_error", "(", "self", ")", ":", "allowed_keywords", "=", "self", ".", "allowed_keywords", "target", "=", "allowed_keywords", ".", "target", "matches", "=", "allowed_keywords", ".", "fuzzy_match", "(", "self", ".", "invalid_keyword", ")", "if"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
AbbreviatedException.print_traceback
Print the traceback of the exception wrapped by the AbbreviatedException.
holoviews/core/options.py
def print_traceback(self): """ Print the traceback of the exception wrapped by the AbbreviatedException. """ traceback.print_exception(self.etype, self.value, self.traceback)
def print_traceback(self): """ Print the traceback of the exception wrapped by the AbbreviatedException. """ traceback.print_exception(self.etype, self.value, self.traceback)
[ "Print", "the", "traceback", "of", "the", "exception", "wrapped", "by", "the", "AbbreviatedException", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L182-L186
[ "def", "print_traceback", "(", "self", ")", ":", "traceback", ".", "print_exception", "(", "self", ".", "etype", ",", "self", ".", "value", ",", "self", ".", "traceback", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Options.filtered
Return a new Options object that is filtered by the specified list of keys. Mutating self.kwargs to filter is unsafe due to the option expansion that occurs on initialization.
holoviews/core/options.py
def filtered(self, allowed): """ Return a new Options object that is filtered by the specified list of keys. Mutating self.kwargs to filter is unsafe due to the option expansion that occurs on initialization. """ kws = {k:v for k,v in self.kwargs.items() if k in allowed} ...
def filtered(self, allowed): """ Return a new Options object that is filtered by the specified list of keys. Mutating self.kwargs to filter is unsafe due to the option expansion that occurs on initialization. """ kws = {k:v for k,v in self.kwargs.items() if k in allowed} ...
[ "Return", "a", "new", "Options", "object", "that", "is", "filtered", "by", "the", "specified", "list", "of", "keys", ".", "Mutating", "self", ".", "kwargs", "to", "filter", "is", "unsafe", "due", "to", "the", "option", "expansion", "that", "occurs", "on", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L477-L486
[ "def", "filtered", "(", "self", ",", "allowed", ")", ":", "kws", "=", "{", "k", ":", "v", "for", "k", ",", "v", "in", "self", ".", "kwargs", ".", "items", "(", ")", "if", "k", "in", "allowed", "}", "return", "self", ".", "__class__", "(", "key"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Options.max_cycles
Truncates all contained Palette objects to a maximum number of samples and returns a new Options object containing the truncated or resampled Palettes.
holoviews/core/options.py
def max_cycles(self, num): """ Truncates all contained Palette objects to a maximum number of samples and returns a new Options object containing the truncated or resampled Palettes. """ kwargs = {kw: (arg[num] if isinstance(arg, Palette) else arg) for k...
def max_cycles(self, num): """ Truncates all contained Palette objects to a maximum number of samples and returns a new Options object containing the truncated or resampled Palettes. """ kwargs = {kw: (arg[num] if isinstance(arg, Palette) else arg) for k...
[ "Truncates", "all", "contained", "Palette", "objects", "to", "a", "maximum", "number", "of", "samples", "and", "returns", "a", "new", "Options", "object", "containing", "the", "truncated", "or", "resampled", "Palettes", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L503-L511
[ "def", "max_cycles", "(", "self", ",", "num", ")", ":", "kwargs", "=", "{", "kw", ":", "(", "arg", "[", "num", "]", "if", "isinstance", "(", "arg", ",", "Palette", ")", "else", "arg", ")", "for", "kw", ",", "arg", "in", "self", ".", "kwargs", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Options.cyclic
Returns True if the options cycle, otherwise False
holoviews/core/options.py
def cyclic(self): "Returns True if the options cycle, otherwise False" return any(isinstance(val, Cycle) for val in self.kwargs.values())
def cyclic(self): "Returns True if the options cycle, otherwise False" return any(isinstance(val, Cycle) for val in self.kwargs.values())
[ "Returns", "True", "if", "the", "options", "cycle", "otherwise", "False" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L515-L517
[ "def", "cyclic", "(", "self", ")", ":", "return", "any", "(", "isinstance", "(", "val", ",", "Cycle", ")", "for", "val", "in", "self", ".", "kwargs", ".", "values", "(", ")", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptionTree._merge_options
Computes a merged Options object for the given group name from the existing Options on the node and the new Options which are passed in.
holoviews/core/options.py
def _merge_options(self, identifier, group_name, options): """ Computes a merged Options object for the given group name from the existing Options on the node and the new Options which are passed in. """ if group_name not in self.groups: raise KeyError("Group ...
def _merge_options(self, identifier, group_name, options): """ Computes a merged Options object for the given group name from the existing Options on the node and the new Options which are passed in. """ if group_name not in self.groups: raise KeyError("Group ...
[ "Computes", "a", "merged", "Options", "object", "for", "the", "given", "group", "name", "from", "the", "existing", "Options", "on", "the", "node", "and", "the", "new", "Options", "which", "are", "passed", "in", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L610-L638
[ "def", "_merge_options", "(", "self", ",", "identifier", ",", "group_name", ",", "options", ")", ":", "if", "group_name", "not", "in", "self", ".", "groups", ":", "raise", "KeyError", "(", "\"Group %s not defined on SettingTree\"", "%", "group_name", ")", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptionTree.find
Find the closest node or path to an the arbitrary path that is supplied down the tree from the given node. The mode argument may be either 'node' or 'path' which determines the return type.
holoviews/core/options.py
def find(self, path, mode='node'): """ Find the closest node or path to an the arbitrary path that is supplied down the tree from the given node. The mode argument may be either 'node' or 'path' which determines the return type. """ path = path.split('.') if isins...
def find(self, path, mode='node'): """ Find the closest node or path to an the arbitrary path that is supplied down the tree from the given node. The mode argument may be either 'node' or 'path' which determines the return type. """ path = path.split('.') if isins...
[ "Find", "the", "closest", "node", "or", "path", "to", "an", "the", "arbitrary", "path", "that", "is", "supplied", "down", "the", "tree", "from", "the", "given", "node", ".", "The", "mode", "argument", "may", "be", "either", "node", "or", "path", "which",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L704-L723
[ "def", "find", "(", "self", ",", "path", ",", "mode", "=", "'node'", ")", ":", "path", "=", "path", ".", "split", "(", "'.'", ")", "if", "isinstance", "(", "path", ",", "str", ")", "else", "list", "(", "path", ")", "item", "=", "self", "for", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptionTree.closest
This method is designed to be called from the root of the tree. Given any LabelledData object, this method will return the most appropriate Options object, including inheritance. In addition, closest supports custom options by checking the object
holoviews/core/options.py
def closest(self, obj, group, defaults=True): """ This method is designed to be called from the root of the tree. Given any LabelledData object, this method will return the most appropriate Options object, including inheritance. In addition, closest supports custom options by ch...
def closest(self, obj, group, defaults=True): """ This method is designed to be called from the root of the tree. Given any LabelledData object, this method will return the most appropriate Options object, including inheritance. In addition, closest supports custom options by ch...
[ "This", "method", "is", "designed", "to", "be", "called", "from", "the", "root", "of", "the", "tree", ".", "Given", "any", "LabelledData", "object", "this", "method", "will", "return", "the", "most", "appropriate", "Options", "object", "including", "inheritanc...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L726-L740
[ "def", "closest", "(", "self", ",", "obj", ",", "group", ",", "defaults", "=", "True", ")", ":", "components", "=", "(", "obj", ".", "__class__", ".", "__name__", ",", "group_sanitizer", "(", "obj", ".", "group", ")", ",", "label_sanitizer", "(", "obj"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptionTree.options
Using inheritance up to the root, get the complete Options object for the given node and the specified group.
holoviews/core/options.py
def options(self, group, target=None, defaults=True): """ Using inheritance up to the root, get the complete Options object for the given node and the specified group. """ if target is None: target = self.path if self.groups.get(group, None) is None: ...
def options(self, group, target=None, defaults=True): """ Using inheritance up to the root, get the complete Options object for the given node and the specified group. """ if target is None: target = self.path if self.groups.get(group, None) is None: ...
[ "Using", "inheritance", "up", "to", "the", "root", "get", "the", "complete", "Options", "object", "for", "the", "given", "node", "and", "the", "specified", "group", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L744-L766
[ "def", "options", "(", "self", ",", "group", ",", "target", "=", "None", ",", "defaults", "=", "True", ")", ":", "if", "target", "is", "None", ":", "target", "=", "self", ".", "path", "if", "self", ".", "groups", ".", "get", "(", "group", ",", "N...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor.strongest_match
Returns the single strongest matching compositor operation given an overlay. If no matches are found, None is returned. The best match is defined as the compositor operation with the highest match value as returned by the match_level method.
holoviews/core/options.py
def strongest_match(cls, overlay, mode, backend=None): """ Returns the single strongest matching compositor operation given an overlay. If no matches are found, None is returned. The best match is defined as the compositor operation with the highest match value as returned by th...
def strongest_match(cls, overlay, mode, backend=None): """ Returns the single strongest matching compositor operation given an overlay. If no matches are found, None is returned. The best match is defined as the compositor operation with the highest match value as returned by th...
[ "Returns", "the", "single", "strongest", "matching", "compositor", "operation", "given", "an", "overlay", ".", "If", "no", "matches", "are", "found", "None", "is", "returned", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L859-L871
[ "def", "strongest_match", "(", "cls", ",", "overlay", ",", "mode", ",", "backend", "=", "None", ")", ":", "match_strength", "=", "[", "(", "op", ".", "match_level", "(", "overlay", ")", ",", "op", ")", "for", "op", "in", "cls", ".", "definitions", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor.collapse_element
Finds any applicable compositor and applies it.
holoviews/core/options.py
def collapse_element(cls, overlay, ranges=None, mode='data', backend=None): """ Finds any applicable compositor and applies it. """ from .element import Element from .overlay import Overlay, CompositeOverlay unpack = False if not isinstance(overlay, CompositeOverl...
def collapse_element(cls, overlay, ranges=None, mode='data', backend=None): """ Finds any applicable compositor and applies it. """ from .element import Element from .overlay import Overlay, CompositeOverlay unpack = False if not isinstance(overlay, CompositeOverl...
[ "Finds", "any", "applicable", "compositor", "and", "applies", "it", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L875-L919
[ "def", "collapse_element", "(", "cls", ",", "overlay", ",", "ranges", "=", "None", ",", "mode", "=", "'data'", ",", "backend", "=", "None", ")", ":", "from", ".", "element", "import", "Element", "from", ".", "overlay", "import", "Overlay", ",", "Composit...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor.collapse
Given a map of Overlays, apply all applicable compositors.
holoviews/core/options.py
def collapse(cls, holomap, ranges=None, mode='data'): """ Given a map of Overlays, apply all applicable compositors. """ # No potential compositors if cls.definitions == []: return holomap # Apply compositors clone = holomap.clone(shared_data=False) ...
def collapse(cls, holomap, ranges=None, mode='data'): """ Given a map of Overlays, apply all applicable compositors. """ # No potential compositors if cls.definitions == []: return holomap # Apply compositors clone = holomap.clone(shared_data=False) ...
[ "Given", "a", "map", "of", "Overlays", "apply", "all", "applicable", "compositors", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L923-L936
[ "def", "collapse", "(", "cls", ",", "holomap", ",", "ranges", "=", "None", ",", "mode", "=", "'data'", ")", ":", "# No potential compositors", "if", "cls", ".", "definitions", "==", "[", "]", ":", "return", "holomap", "# Apply compositors", "clone", "=", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor.map
Applies compositor operations to any HoloViews element or container using the map method.
holoviews/core/options.py
def map(cls, obj, mode='data', backend=None): """ Applies compositor operations to any HoloViews element or container using the map method. """ from .overlay import CompositeOverlay element_compositors = [c for c in cls.definitions if len(c._pattern_spec) == 1] ov...
def map(cls, obj, mode='data', backend=None): """ Applies compositor operations to any HoloViews element or container using the map method. """ from .overlay import CompositeOverlay element_compositors = [c for c in cls.definitions if len(c._pattern_spec) == 1] ov...
[ "Applies", "compositor", "operations", "to", "any", "HoloViews", "element", "or", "container", "using", "the", "map", "method", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L940-L955
[ "def", "map", "(", "cls", ",", "obj", ",", "mode", "=", "'data'", ",", "backend", "=", "None", ")", ":", "from", ".", "overlay", "import", "CompositeOverlay", "element_compositors", "=", "[", "c", "for", "c", "in", "cls", ".", "definitions", "if", "len...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor._slice_match_level
Find the match strength for a list of overlay items that must be exactly the same length as the pattern specification.
holoviews/core/options.py
def _slice_match_level(self, overlay_items): """ Find the match strength for a list of overlay items that must be exactly the same length as the pattern specification. """ level = 0 for spec, el in zip(self._pattern_spec, overlay_items): if spec[0] != type(el)...
def _slice_match_level(self, overlay_items): """ Find the match strength for a list of overlay items that must be exactly the same length as the pattern specification. """ level = 0 for spec, el in zip(self._pattern_spec, overlay_items): if spec[0] != type(el)...
[ "Find", "the", "match", "strength", "for", "a", "list", "of", "overlay", "items", "that", "must", "be", "exactly", "the", "same", "length", "as", "the", "pattern", "specification", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1006-L1028
[ "def", "_slice_match_level", "(", "self", ",", "overlay_items", ")", ":", "level", "=", "0", "for", "spec", ",", "el", "in", "zip", "(", "self", ".", "_pattern_spec", ",", "overlay_items", ")", ":", "if", "spec", "[", "0", "]", "!=", "type", "(", "el...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor.match_level
Given an overlay, return the match level and applicable slice of the overall overlay. The level an integer if there is a match or None if there is no match. The level integer is the number of matching components. Higher values indicate a stronger match.
holoviews/core/options.py
def match_level(self, overlay): """ Given an overlay, return the match level and applicable slice of the overall overlay. The level an integer if there is a match or None if there is no match. The level integer is the number of matching components. Higher values indicate...
def match_level(self, overlay): """ Given an overlay, return the match level and applicable slice of the overall overlay. The level an integer if there is a match or None if there is no match. The level integer is the number of matching components. Higher values indicate...
[ "Given", "an", "overlay", "return", "the", "match", "level", "and", "applicable", "slice", "of", "the", "overall", "overlay", ".", "The", "level", "an", "integer", "if", "there", "is", "a", "match", "or", "None", "if", "there", "is", "no", "match", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1031-L1053
[ "def", "match_level", "(", "self", ",", "overlay", ")", ":", "slice_width", "=", "len", "(", "self", ".", "_pattern_spec", ")", "if", "slice_width", ">", "len", "(", "overlay", ")", ":", "return", "None", "# Check all the possible slices and return the best matchi...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Compositor.apply
Apply the compositor on the input with the given input ranges.
holoviews/core/options.py
def apply(self, value, input_ranges, backend=None): """ Apply the compositor on the input with the given input ranges. """ from .overlay import CompositeOverlay if backend is None: backend = Store.current_backend kwargs = {k: v for k, v in self.kwargs.items() if k != 'out...
def apply(self, value, input_ranges, backend=None): """ Apply the compositor on the input with the given input ranges. """ from .overlay import CompositeOverlay if backend is None: backend = Store.current_backend kwargs = {k: v for k, v in self.kwargs.items() if k != 'out...
[ "Apply", "the", "compositor", "on", "the", "input", "with", "the", "given", "input", "ranges", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1056-L1073
[ "def", "apply", "(", "self", ",", "value", ",", "input_ranges", ",", "backend", "=", "None", ")", ":", "from", ".", "overlay", "import", "CompositeOverlay", "if", "backend", "is", "None", ":", "backend", "=", "Store", ".", "current_backend", "kwargs", "=",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.set_current_backend
Use this method to set the backend to run the switch hooks
holoviews/core/options.py
def set_current_backend(cls, backend): "Use this method to set the backend to run the switch hooks" for hook in cls._backend_switch_hooks: hook(backend) cls.current_backend = backend
def set_current_backend(cls, backend): "Use this method to set the backend to run the switch hooks" for hook in cls._backend_switch_hooks: hook(backend) cls.current_backend = backend
[ "Use", "this", "method", "to", "set", "the", "backend", "to", "run", "the", "switch", "hooks" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1121-L1125
[ "def", "set_current_backend", "(", "cls", ",", "backend", ")", ":", "for", "hook", "in", "cls", ".", "_backend_switch_hooks", ":", "hook", "(", "backend", ")", "cls", ".", "current_backend", "=", "backend" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.load
Equivalent to pickle.load except that the HoloViews trees is restored appropriately.
holoviews/core/options.py
def load(cls, filename): """ Equivalent to pickle.load except that the HoloViews trees is restored appropriately. """ cls.load_counter_offset = StoreOptions.id_offset() val = pickle.load(filename) cls.load_counter_offset = None return val
def load(cls, filename): """ Equivalent to pickle.load except that the HoloViews trees is restored appropriately. """ cls.load_counter_offset = StoreOptions.id_offset() val = pickle.load(filename) cls.load_counter_offset = None return val
[ "Equivalent", "to", "pickle", ".", "load", "except", "that", "the", "HoloViews", "trees", "is", "restored", "appropriately", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1152-L1160
[ "def", "load", "(", "cls", ",", "filename", ")", ":", "cls", ".", "load_counter_offset", "=", "StoreOptions", ".", "id_offset", "(", ")", "val", "=", "pickle", ".", "load", "(", "filename", ")", "cls", ".", "load_counter_offset", "=", "None", "return", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.loads
Equivalent to pickle.loads except that the HoloViews trees is restored appropriately.
holoviews/core/options.py
def loads(cls, pickle_string): """ Equivalent to pickle.loads except that the HoloViews trees is restored appropriately. """ cls.load_counter_offset = StoreOptions.id_offset() val = pickle.loads(pickle_string) cls.load_counter_offset = None return val
def loads(cls, pickle_string): """ Equivalent to pickle.loads except that the HoloViews trees is restored appropriately. """ cls.load_counter_offset = StoreOptions.id_offset() val = pickle.loads(pickle_string) cls.load_counter_offset = None return val
[ "Equivalent", "to", "pickle", ".", "loads", "except", "that", "the", "HoloViews", "trees", "is", "restored", "appropriately", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1163-L1171
[ "def", "loads", "(", "cls", ",", "pickle_string", ")", ":", "cls", ".", "load_counter_offset", "=", "StoreOptions", ".", "id_offset", "(", ")", "val", "=", "pickle", ".", "loads", "(", "pickle_string", ")", "cls", ".", "load_counter_offset", "=", "None", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.dump
Equivalent to pickle.dump except that the HoloViews option tree is saved appropriately.
holoviews/core/options.py
def dump(cls, obj, file, protocol=0): """ Equivalent to pickle.dump except that the HoloViews option tree is saved appropriately. """ cls.save_option_state = True pickle.dump(obj, file, protocol=protocol) cls.save_option_state = False
def dump(cls, obj, file, protocol=0): """ Equivalent to pickle.dump except that the HoloViews option tree is saved appropriately. """ cls.save_option_state = True pickle.dump(obj, file, protocol=protocol) cls.save_option_state = False
[ "Equivalent", "to", "pickle", ".", "dump", "except", "that", "the", "HoloViews", "option", "tree", "is", "saved", "appropriately", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1174-L1181
[ "def", "dump", "(", "cls", ",", "obj", ",", "file", ",", "protocol", "=", "0", ")", ":", "cls", ".", "save_option_state", "=", "True", "pickle", ".", "dump", "(", "obj", ",", "file", ",", "protocol", "=", "protocol", ")", "cls", ".", "save_option_sta...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.dumps
Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately.
holoviews/core/options.py
def dumps(cls, obj, protocol=0): """ Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately. """ cls.save_option_state = True val = pickle.dumps(obj, protocol=protocol) cls.save_option_state = False return val
def dumps(cls, obj, protocol=0): """ Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately. """ cls.save_option_state = True val = pickle.dumps(obj, protocol=protocol) cls.save_option_state = False return val
[ "Equivalent", "to", "pickle", ".", "dumps", "except", "that", "the", "HoloViews", "option", "tree", "is", "saved", "appropriately", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1184-L1192
[ "def", "dumps", "(", "cls", ",", "obj", ",", "protocol", "=", "0", ")", ":", "cls", ".", "save_option_state", "=", "True", "val", "=", "pickle", ".", "dumps", "(", "obj", ",", "protocol", "=", "protocol", ")", "cls", ".", "save_option_state", "=", "F...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.info
Show information about a particular object or component class including the applicable style and plot options. Returns None if the object is not parameterized.
holoviews/core/options.py
def info(cls, obj, ansi=True, backend='matplotlib', visualization=True, recursive=False, pattern=None, elements=[]): """ Show information about a particular object or component class including the applicable style and plot options. Returns None if the object is not parameter...
def info(cls, obj, ansi=True, backend='matplotlib', visualization=True, recursive=False, pattern=None, elements=[]): """ Show information about a particular object or component class including the applicable style and plot options. Returns None if the object is not parameter...
[ "Show", "information", "about", "a", "particular", "object", "or", "component", "class", "including", "the", "applicable", "style", "and", "plot", "options", ".", "Returns", "None", "if", "the", "object", "is", "not", "parameterized", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1195-L1222
[ "def", "info", "(", "cls", ",", "obj", ",", "ansi", "=", "True", ",", "backend", "=", "'matplotlib'", ",", "visualization", "=", "True", ",", "recursive", "=", "False", ",", "pattern", "=", "None", ",", "elements", "=", "[", "]", ")", ":", "parameter...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.lookup
Given an object, lookup the corresponding customized option tree if a single custom tree is applicable.
holoviews/core/options.py
def lookup(cls, backend, obj): """ Given an object, lookup the corresponding customized option tree if a single custom tree is applicable. """ ids = set([el for el in obj.traverse(lambda x: x.id) if el is not None]) if len(ids) == 0: raise Exception("Object do...
def lookup(cls, backend, obj): """ Given an object, lookup the corresponding customized option tree if a single custom tree is applicable. """ ids = set([el for el in obj.traverse(lambda x: x.id) if el is not None]) if len(ids) == 0: raise Exception("Object do...
[ "Given", "an", "object", "lookup", "the", "corresponding", "customized", "option", "tree", "if", "a", "single", "custom", "tree", "is", "applicable", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1236-L1248
[ "def", "lookup", "(", "cls", ",", "backend", ",", "obj", ")", ":", "ids", "=", "set", "(", "[", "el", "for", "el", "in", "obj", ".", "traverse", "(", "lambda", "x", ":", "x", ".", "id", ")", "if", "el", "is", "not", "None", "]", ")", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.transfer_options
Transfers options for all backends from one object to another. Drops any options defined in the supplied drop list.
holoviews/core/options.py
def transfer_options(cls, obj, new_obj, backend=None): """ Transfers options for all backends from one object to another. Drops any options defined in the supplied drop list. """ backend = cls.current_backend if backend is None else backend type_name = type(new_obj).__nam...
def transfer_options(cls, obj, new_obj, backend=None): """ Transfers options for all backends from one object to another. Drops any options defined in the supplied drop list. """ backend = cls.current_backend if backend is None else backend type_name = type(new_obj).__nam...
[ "Transfers", "options", "for", "all", "backends", "from", "one", "object", "to", "another", ".", "Drops", "any", "options", "defined", "in", "the", "supplied", "drop", "list", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1252-L1266
[ "def", "transfer_options", "(", "cls", ",", "obj", ",", "new_obj", ",", "backend", "=", "None", ")", ":", "backend", "=", "cls", ".", "current_backend", "if", "backend", "is", "None", "else", "backend", "type_name", "=", "type", "(", "new_obj", ")", ".",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.add_style_opts
Given a component such as an Element (e.g. Image, Curve) or a container (e.g Layout) specify new style options to be accepted by the corresponding plotting class. Note: This is supplied for advanced users who know which additional style keywords are appropriate for the correspon...
holoviews/core/options.py
def add_style_opts(cls, component, new_options, backend=None): """ Given a component such as an Element (e.g. Image, Curve) or a container (e.g Layout) specify new style options to be accepted by the corresponding plotting class. Note: This is supplied for advanced users who kno...
def add_style_opts(cls, component, new_options, backend=None): """ Given a component such as an Element (e.g. Image, Curve) or a container (e.g Layout) specify new style options to be accepted by the corresponding plotting class. Note: This is supplied for advanced users who kno...
[ "Given", "a", "component", "such", "as", "an", "Element", "(", "e", ".", "g", ".", "Image", "Curve", ")", "or", "a", "container", "(", "e", ".", "g", "Layout", ")", "specify", "new", "style", "options", "to", "be", "accepted", "by", "the", "correspon...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1270-L1292
[ "def", "add_style_opts", "(", "cls", ",", "component", ",", "new_options", ",", "backend", "=", "None", ")", ":", "backend", "=", "cls", ".", "current_backend", "if", "backend", "is", "None", "else", "backend", "if", "component", "not", "in", "cls", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.register
Register the supplied dictionary of associations between elements and plotting classes to the specified backend.
holoviews/core/options.py
def register(cls, associations, backend, style_aliases={}): """ Register the supplied dictionary of associations between elements and plotting classes to the specified backend. """ if backend not in cls.registry: cls.registry[backend] = {} cls.registry[backend...
def register(cls, associations, backend, style_aliases={}): """ Register the supplied dictionary of associations between elements and plotting classes to the specified backend. """ if backend not in cls.registry: cls.registry[backend] = {} cls.registry[backend...
[ "Register", "the", "supplied", "dictionary", "of", "associations", "between", "elements", "and", "plotting", "classes", "to", "the", "specified", "backend", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1296-L1332
[ "def", "register", "(", "cls", ",", "associations", ",", "backend", ",", "style_aliases", "=", "{", "}", ")", ":", "if", "backend", "not", "in", "cls", ".", "registry", ":", "cls", ".", "registry", "[", "backend", "]", "=", "{", "}", "cls", ".", "r...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.set_display_hook
Specify a display hook that will be applied to objects of type objtype. The group specifies the set to which the display hook belongs, allowing the Store to compute the precedence within each group.
holoviews/core/options.py
def set_display_hook(cls, group, objtype, hook): """ Specify a display hook that will be applied to objects of type objtype. The group specifies the set to which the display hook belongs, allowing the Store to compute the precedence within each group. """ cls._dis...
def set_display_hook(cls, group, objtype, hook): """ Specify a display hook that will be applied to objects of type objtype. The group specifies the set to which the display hook belongs, allowing the Store to compute the precedence within each group. """ cls._dis...
[ "Specify", "a", "display", "hook", "that", "will", "be", "applied", "to", "objects", "of", "type", "objtype", ".", "The", "group", "specifies", "the", "set", "to", "which", "the", "display", "hook", "belongs", "allowing", "the", "Store", "to", "compute", "...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1336-L1343
[ "def", "set_display_hook", "(", "cls", ",", "group", ",", "objtype", ",", "hook", ")", ":", "cls", ".", "_display_hooks", "[", "group", "]", "[", "objtype", "]", "=", "hook" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Store.render
Using any display hooks that have been registered, render the object to a dictionary of MIME types and metadata information.
holoviews/core/options.py
def render(cls, obj): """ Using any display hooks that have been registered, render the object to a dictionary of MIME types and metadata information. """ class_hierarchy = inspect.getmro(type(obj)) hooks = [] for _, type_hooks in cls._display_hooks.items(): ...
def render(cls, obj): """ Using any display hooks that have been registered, render the object to a dictionary of MIME types and metadata information. """ class_hierarchy = inspect.getmro(type(obj)) hooks = [] for _, type_hooks in cls._display_hooks.items(): ...
[ "Using", "any", "display", "hooks", "that", "have", "been", "registered", "render", "the", "object", "to", "a", "dictionary", "of", "MIME", "types", "and", "metadata", "information", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1347-L1368
[ "def", "render", "(", "cls", ",", "obj", ")", ":", "class_hierarchy", "=", "inspect", ".", "getmro", "(", "type", "(", "obj", ")", ")", "hooks", "=", "[", "]", "for", "_", ",", "type_hooks", "in", "cls", ".", "_display_hooks", ".", "items", "(", ")...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.stop_recording_skipped
Stop collecting OptionErrors recorded with the record_skipped_option method and return them
holoviews/core/options.py
def stop_recording_skipped(cls): """ Stop collecting OptionErrors recorded with the record_skipped_option method and return them """ if cls._errors_recorded is None: raise Exception('Cannot stop recording before it is started') recorded = cls._errors_recorded[...
def stop_recording_skipped(cls): """ Stop collecting OptionErrors recorded with the record_skipped_option method and return them """ if cls._errors_recorded is None: raise Exception('Cannot stop recording before it is started') recorded = cls._errors_recorded[...
[ "Stop", "collecting", "OptionErrors", "recorded", "with", "the", "record_skipped_option", "method", "and", "return", "them" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1405-L1414
[ "def", "stop_recording_skipped", "(", "cls", ")", ":", "if", "cls", ".", "_errors_recorded", "is", "None", ":", "raise", "Exception", "(", "'Cannot stop recording before it is started'", ")", "recorded", "=", "cls", ".", "_errors_recorded", "[", ":", "]", "cls", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.tree_to_dict
Given an OptionTree, convert it into the equivalent dictionary format.
holoviews/core/options.py
def tree_to_dict(cls, tree): """ Given an OptionTree, convert it into the equivalent dictionary format. """ specs = {} for k in tree.keys(): spec_key = '.'.join(k) specs[spec_key] = {} for grp in tree[k].groups: kwargs = tree[k]...
def tree_to_dict(cls, tree): """ Given an OptionTree, convert it into the equivalent dictionary format. """ specs = {} for k in tree.keys(): spec_key = '.'.join(k) specs[spec_key] = {} for grp in tree[k].groups: kwargs = tree[k]...
[ "Given", "an", "OptionTree", "convert", "it", "into", "the", "equivalent", "dictionary", "format", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1436-L1448
[ "def", "tree_to_dict", "(", "cls", ",", "tree", ")", ":", "specs", "=", "{", "}", "for", "k", "in", "tree", ".", "keys", "(", ")", ":", "spec_key", "=", "'.'", ".", "join", "(", "k", ")", "specs", "[", "spec_key", "]", "=", "{", "}", "for", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.propagate_ids
Recursively propagate an id through an object for components matching the applied_keys. This method can only be called if there is a tree with a matching id in Store.custom_options
holoviews/core/options.py
def propagate_ids(cls, obj, match_id, new_id, applied_keys, backend=None): """ Recursively propagate an id through an object for components matching the applied_keys. This method can only be called if there is a tree with a matching id in Store.custom_options """ applied ...
def propagate_ids(cls, obj, match_id, new_id, applied_keys, backend=None): """ Recursively propagate an id through an object for components matching the applied_keys. This method can only be called if there is a tree with a matching id in Store.custom_options """ applied ...
[ "Recursively", "propagate", "an", "id", "through", "an", "object", "for", "components", "matching", "the", "applied_keys", ".", "This", "method", "can", "only", "be", "called", "if", "there", "is", "a", "tree", "with", "a", "matching", "id", "in", "Store", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1451-L1469
[ "def", "propagate_ids", "(", "cls", ",", "obj", ",", "match_id", ",", "new_id", ",", "applied_keys", ",", "backend", "=", "None", ")", ":", "applied", "=", "[", "]", "def", "propagate", "(", "o", ")", ":", "if", "o", ".", "id", "==", "match_id", "o...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.restore_ids
Given an list of ids as captured with capture_ids, restore the ids. Note the structure of an object must not change between the calls to capture_ids and restore_ids.
holoviews/core/options.py
def restore_ids(cls, obj, ids): """ Given an list of ids as captured with capture_ids, restore the ids. Note the structure of an object must not change between the calls to capture_ids and restore_ids. """ ids = iter(ids) obj.traverse(lambda o: setattr(o, 'id', ne...
def restore_ids(cls, obj, ids): """ Given an list of ids as captured with capture_ids, restore the ids. Note the structure of an object must not change between the calls to capture_ids and restore_ids. """ ids = iter(ids) obj.traverse(lambda o: setattr(o, 'id', ne...
[ "Given", "an", "list", "of", "ids", "as", "captured", "with", "capture_ids", "restore", "the", "ids", ".", "Note", "the", "structure", "of", "an", "object", "must", "not", "change", "between", "the", "calls", "to", "capture_ids", "and", "restore_ids", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1480-L1487
[ "def", "restore_ids", "(", "cls", ",", "obj", ",", "ids", ")", ":", "ids", "=", "iter", "(", "ids", ")", "obj", ".", "traverse", "(", "lambda", "o", ":", "setattr", "(", "o", ",", "'id'", ",", "next", "(", "ids", ")", ")", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.apply_customizations
Apply the given option specs to the supplied options tree.
holoviews/core/options.py
def apply_customizations(cls, spec, options): """ Apply the given option specs to the supplied options tree. """ for key in sorted(spec.keys()): if isinstance(spec[key], (list, tuple)): customization = {v.key:v for v in spec[key]} else: ...
def apply_customizations(cls, spec, options): """ Apply the given option specs to the supplied options tree. """ for key in sorted(spec.keys()): if isinstance(spec[key], (list, tuple)): customization = {v.key:v for v in spec[key]} else: ...
[ "Apply", "the", "given", "option", "specs", "to", "the", "supplied", "options", "tree", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1491-L1506
[ "def", "apply_customizations", "(", "cls", ",", "spec", ",", "options", ")", ":", "for", "key", "in", "sorted", "(", "spec", ".", "keys", "(", ")", ")", ":", "if", "isinstance", "(", "spec", "[", "key", "]", ",", "(", "list", ",", "tuple", ")", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.validate_spec
Given a specification, validated it against the options tree for the specified backends by raising OptionError for invalid options. If backends is None, validates against all the currently loaded backend. Only useful when invalid keywords generate exceptions instead of skipping ...
holoviews/core/options.py
def validate_spec(cls, spec, backends=None): """ Given a specification, validated it against the options tree for the specified backends by raising OptionError for invalid options. If backends is None, validates against all the currently loaded backend. Only useful when ...
def validate_spec(cls, spec, backends=None): """ Given a specification, validated it against the options tree for the specified backends by raising OptionError for invalid options. If backends is None, validates against all the currently loaded backend. Only useful when ...
[ "Given", "a", "specification", "validated", "it", "against", "the", "options", "tree", "for", "the", "specified", "backends", "by", "raising", "OptionError", "for", "invalid", "options", ".", "If", "backends", "is", "None", "validates", "against", "all", "the", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1509-L1544
[ "def", "validate_spec", "(", "cls", ",", "spec", ",", "backends", "=", "None", ")", ":", "loaded_backends", "=", "Store", ".", "loaded_backends", "(", ")", "if", "backends", "is", "None", "else", "backends", "error_info", "=", "{", "}", "backend_errors", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.validation_error_message
Returns an options validation error message if there are any invalid keywords. Otherwise returns None.
holoviews/core/options.py
def validation_error_message(cls, spec, backends=None): """ Returns an options validation error message if there are any invalid keywords. Otherwise returns None. """ try: cls.validate_spec(spec, backends=backends) except OptionError as e: return e...
def validation_error_message(cls, spec, backends=None): """ Returns an options validation error message if there are any invalid keywords. Otherwise returns None. """ try: cls.validate_spec(spec, backends=backends) except OptionError as e: return e...
[ "Returns", "an", "options", "validation", "error", "message", "if", "there", "are", "any", "invalid", "keywords", ".", "Otherwise", "returns", "None", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1548-L1556
[ "def", "validation_error_message", "(", "cls", ",", "spec", ",", "backends", "=", "None", ")", ":", "try", ":", "cls", ".", "validate_spec", "(", "spec", ",", "backends", "=", "backends", ")", "except", "OptionError", "as", "e", ":", "return", "e", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.expand_compositor_keys
Expands compositor definition keys into {type}.{group} keys. For instance a compositor operation returning a group string 'Image' of element type RGB expands to 'RGB.Image'.
holoviews/core/options.py
def expand_compositor_keys(cls, spec): """ Expands compositor definition keys into {type}.{group} keys. For instance a compositor operation returning a group string 'Image' of element type RGB expands to 'RGB.Image'. """ expanded_spec={} applied_keys = [] ...
def expand_compositor_keys(cls, spec): """ Expands compositor definition keys into {type}.{group} keys. For instance a compositor operation returning a group string 'Image' of element type RGB expands to 'RGB.Image'. """ expanded_spec={} applied_keys = [] ...
[ "Expands", "compositor", "definition", "keys", "into", "{", "type", "}", ".", "{", "group", "}", "keys", ".", "For", "instance", "a", "compositor", "operation", "returning", "a", "group", "string", "Image", "of", "element", "type", "RGB", "expands", "to", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1559-L1577
[ "def", "expand_compositor_keys", "(", "cls", ",", "spec", ")", ":", "expanded_spec", "=", "{", "}", "applied_keys", "=", "[", "]", "compositor_defs", "=", "{", "el", ".", "group", ":", "el", ".", "output_type", ".", "__name__", "for", "el", "in", "Compos...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.create_custom_trees
Returns the appropriate set of customized subtree clones for an object, suitable for merging with Store.custom_options (i.e with the ids appropriately offset). Note if an object has no integer ids a new OptionTree is built. The id_mapping return value is a list mapping the ids that ...
holoviews/core/options.py
def create_custom_trees(cls, obj, options=None): """ Returns the appropriate set of customized subtree clones for an object, suitable for merging with Store.custom_options (i.e with the ids appropriately offset). Note if an object has no integer ids a new OptionTree is built. ...
def create_custom_trees(cls, obj, options=None): """ Returns the appropriate set of customized subtree clones for an object, suitable for merging with Store.custom_options (i.e with the ids appropriately offset). Note if an object has no integer ids a new OptionTree is built. ...
[ "Returns", "the", "appropriate", "set", "of", "customized", "subtree", "clones", "for", "an", "object", "suitable", "for", "merging", "with", "Store", ".", "custom_options", "(", "i", ".", "e", "with", "the", "ids", "appropriately", "offset", ")", ".", "Note...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1581-L1617
[ "def", "create_custom_trees", "(", "cls", ",", "obj", ",", "options", "=", "None", ")", ":", "clones", ",", "id_mapping", "=", "{", "}", ",", "[", "]", "obj_ids", "=", "cls", ".", "get_object_ids", "(", "obj", ")", "offset", "=", "cls", ".", "id_offs...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.merge_options
Given a full options dictionary and options groups specified as a keywords, return the full set of merged options: >>> options={'Curve':{'style':dict(color='b')}} >>> style={'Curve':{'linewidth':10 }} >>> merged = StoreOptions.merge_options(['style'], options, style=style) >>> s...
holoviews/core/options.py
def merge_options(cls, groups, options=None,**kwargs): """ Given a full options dictionary and options groups specified as a keywords, return the full set of merged options: >>> options={'Curve':{'style':dict(color='b')}} >>> style={'Curve':{'linewidth':10 }} >>> merged ...
def merge_options(cls, groups, options=None,**kwargs): """ Given a full options dictionary and options groups specified as a keywords, return the full set of merged options: >>> options={'Curve':{'style':dict(color='b')}} >>> style={'Curve':{'linewidth':10 }} >>> merged ...
[ "Given", "a", "full", "options", "dictionary", "and", "options", "groups", "specified", "as", "a", "keywords", "return", "the", "full", "set", "of", "merged", "options", ":" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1621-L1654
[ "def", "merge_options", "(", "cls", ",", "groups", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "groups", "=", "set", "(", "groups", ")", "if", "(", "options", "is", "not", "None", "and", "set", "(", "options", ".", "keys", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.state
Method to capture and restore option state. When called without any state supplied, the current state is returned. Then if this state is supplied back in a later call using the same object, the original state is restored.
holoviews/core/options.py
def state(cls, obj, state=None): """ Method to capture and restore option state. When called without any state supplied, the current state is returned. Then if this state is supplied back in a later call using the same object, the original state is restored. """ i...
def state(cls, obj, state=None): """ Method to capture and restore option state. When called without any state supplied, the current state is returned. Then if this state is supplied back in a later call using the same object, the original state is restored. """ i...
[ "Method", "to", "capture", "and", "restore", "option", "state", ".", "When", "called", "without", "any", "state", "supplied", "the", "current", "state", "is", "returned", ".", "Then", "if", "this", "state", "is", "supplied", "back", "in", "a", "later", "ca...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1658-L1674
[ "def", "state", "(", "cls", ",", "obj", ",", "state", "=", "None", ")", ":", "if", "state", "is", "None", ":", "ids", "=", "cls", ".", "capture_ids", "(", "obj", ")", "original_custom_keys", "=", "set", "(", "Store", ".", "custom_options", "(", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.options
Context-manager for temporarily setting options on an object (if options is None, no options will be set) . Once the context manager exits, both the object and the Store will be left in exactly the same state they were in before the context manager was used. See holoviews.core.o...
holoviews/core/options.py
def options(cls, obj, options=None, **kwargs): """ Context-manager for temporarily setting options on an object (if options is None, no options will be set) . Once the context manager exits, both the object and the Store will be left in exactly the same state they were in before ...
def options(cls, obj, options=None, **kwargs): """ Context-manager for temporarily setting options on an object (if options is None, no options will be set) . Once the context manager exits, both the object and the Store will be left in exactly the same state they were in before ...
[ "Context", "-", "manager", "for", "temporarily", "setting", "options", "on", "an", "object", "(", "if", "options", "is", "None", "no", "options", "will", "be", "set", ")", ".", "Once", "the", "context", "manager", "exits", "both", "the", "object", "and", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1678-L1699
[ "def", "options", "(", "cls", ",", "obj", ",", "options", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "(", "options", "is", "None", ")", "and", "kwargs", "==", "{", "}", ":", "yield", "else", ":", "Store", ".", "_options_context", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.id_offset
Compute an appropriate offset for future id values given the set of ids currently defined across backends.
holoviews/core/options.py
def id_offset(cls): """ Compute an appropriate offset for future id values given the set of ids currently defined across backends. """ max_ids = [] for backend in Store.renderers.keys(): store_ids = Store.custom_options(backend=backend).keys() max_...
def id_offset(cls): """ Compute an appropriate offset for future id values given the set of ids currently defined across backends. """ max_ids = [] for backend in Store.renderers.keys(): store_ids = Store.custom_options(backend=backend).keys() max_...
[ "Compute", "an", "appropriate", "offset", "for", "future", "id", "values", "given", "the", "set", "of", "ids", "currently", "defined", "across", "backends", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1703-L1714
[ "def", "id_offset", "(", "cls", ")", ":", "max_ids", "=", "[", "]", "for", "backend", "in", "Store", ".", "renderers", ".", "keys", "(", ")", ":", "store_ids", "=", "Store", ".", "custom_options", "(", "backend", "=", "backend", ")", ".", "keys", "("...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.update_backends
Given the id_mapping from previous ids to new ids and the new custom tree dictionary, update the current backend with the supplied trees and update the keys in the remaining backends to stay linked with the current object.
holoviews/core/options.py
def update_backends(cls, id_mapping, custom_trees, backend=None): """ Given the id_mapping from previous ids to new ids and the new custom tree dictionary, update the current backend with the supplied trees and update the keys in the remaining backends to stay linked with the cur...
def update_backends(cls, id_mapping, custom_trees, backend=None): """ Given the id_mapping from previous ids to new ids and the new custom tree dictionary, update the current backend with the supplied trees and update the keys in the remaining backends to stay linked with the cur...
[ "Given", "the", "id_mapping", "from", "previous", "ids", "to", "new", "ids", "and", "the", "new", "custom", "tree", "dictionary", "update", "the", "current", "backend", "with", "the", "supplied", "trees", "and", "update", "the", "keys", "in", "the", "remaini...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1718-L1737
[ "def", "update_backends", "(", "cls", ",", "id_mapping", ",", "custom_trees", ",", "backend", "=", "None", ")", ":", "backend", "=", "Store", ".", "current_backend", "if", "backend", "is", "None", "else", "backend", "# Update the custom option entries for the curren...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
StoreOptions.set_options
Pure Python function for customize HoloViews objects in terms of their style, plot and normalization options. The options specification is a dictionary containing the target for customization as a {type}.{group}.{label} keys. An example of such a key is 'Image' which would customize all...
holoviews/core/options.py
def set_options(cls, obj, options=None, backend=None, **kwargs): """ Pure Python function for customize HoloViews objects in terms of their style, plot and normalization options. The options specification is a dictionary containing the target for customization as a {type}.{group...
def set_options(cls, obj, options=None, backend=None, **kwargs): """ Pure Python function for customize HoloViews objects in terms of their style, plot and normalization options. The options specification is a dictionary containing the target for customization as a {type}.{group...
[ "Pure", "Python", "function", "for", "customize", "HoloViews", "objects", "in", "terms", "of", "their", "style", "plot", "and", "normalization", "options", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/options.py#L1741-L1800
[ "def", "set_options", "(", "cls", ",", "obj", ",", "options", "=", "None", ",", "backend", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# Note that an alternate, more verbose and less recommended", "# syntax can also be used:", "# {'Image.Channel:{'plot': Options(siz...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
is_color
Checks if supplied object is a valid color spec.
holoviews/plotting/mpl/util.py
def is_color(color): """ Checks if supplied object is a valid color spec. """ if not isinstance(color, basestring): return False elif RGB_HEX_REGEX.match(color): return True elif color in COLOR_ALIASES: return True elif color in cnames: return True return ...
def is_color(color): """ Checks if supplied object is a valid color spec. """ if not isinstance(color, basestring): return False elif RGB_HEX_REGEX.match(color): return True elif color in COLOR_ALIASES: return True elif color in cnames: return True return ...
[ "Checks", "if", "supplied", "object", "is", "a", "valid", "color", "spec", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L35-L47
[ "def", "is_color", "(", "color", ")", ":", "if", "not", "isinstance", "(", "color", ",", "basestring", ")", ":", "return", "False", "elif", "RGB_HEX_REGEX", ".", "match", "(", "color", ")", ":", "return", "True", "elif", "color", "in", "COLOR_ALIASES", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
validate
Validates a style and associated value. Arguments --------- style: str The style to validate (e.g. 'color', 'size' or 'marker') value: The style value to validate vectorized: bool Whether validator should allow vectorized setting Returns ------- valid: boolean or N...
holoviews/plotting/mpl/util.py
def validate(style, value, vectorized=True): """ Validates a style and associated value. Arguments --------- style: str The style to validate (e.g. 'color', 'size' or 'marker') value: The style value to validate vectorized: bool Whether validator should allow vectorized...
def validate(style, value, vectorized=True): """ Validates a style and associated value. Arguments --------- style: str The style to validate (e.g. 'color', 'size' or 'marker') value: The style value to validate vectorized: bool Whether validator should allow vectorized...
[ "Validates", "a", "style", "and", "associated", "value", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L71-L98
[ "def", "validate", "(", "style", ",", "value", ",", "vectorized", "=", "True", ")", ":", "validator", "=", "get_validator", "(", "style", ")", "if", "validator", "is", "None", ":", "return", "None", "if", "isinstance", "(", "value", ",", "(", "np", "."...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
filter_styles
Filters styles which are specific to a particular artist, e.g. for a GraphPlot this will filter options specific to the nodes and edges. Arguments --------- style: dict Dictionary of styles and values group: str Group within the styles to filter for other_groups: list ...
holoviews/plotting/mpl/util.py
def filter_styles(style, group, other_groups, blacklist=[]): """ Filters styles which are specific to a particular artist, e.g. for a GraphPlot this will filter options specific to the nodes and edges. Arguments --------- style: dict Dictionary of styles and values group: str ...
def filter_styles(style, group, other_groups, blacklist=[]): """ Filters styles which are specific to a particular artist, e.g. for a GraphPlot this will filter options specific to the nodes and edges. Arguments --------- style: dict Dictionary of styles and values group: str ...
[ "Filters", "styles", "which", "are", "specific", "to", "a", "particular", "artist", "e", ".", "g", ".", "for", "a", "GraphPlot", "this", "will", "filter", "options", "specific", "to", "the", "nodes", "and", "edges", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L101-L134
[ "def", "filter_styles", "(", "style", ",", "group", ",", "other_groups", ",", "blacklist", "=", "[", "]", ")", ":", "group", "=", "group", "+", "'_'", "filtered", "=", "{", "}", "for", "k", ",", "v", "in", "style", ".", "items", "(", ")", ":", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
wrap_formatter
Wraps formatting function or string in appropriate matplotlib formatter type.
holoviews/plotting/mpl/util.py
def wrap_formatter(formatter): """ Wraps formatting function or string in appropriate matplotlib formatter type. """ if isinstance(formatter, ticker.Formatter): return formatter elif callable(formatter): args = [arg for arg in _getargspec(formatter).args if arg !=...
def wrap_formatter(formatter): """ Wraps formatting function or string in appropriate matplotlib formatter type. """ if isinstance(formatter, ticker.Formatter): return formatter elif callable(formatter): args = [arg for arg in _getargspec(formatter).args if arg !=...
[ "Wraps", "formatting", "function", "or", "string", "in", "appropriate", "matplotlib", "formatter", "type", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L137-L156
[ "def", "wrap_formatter", "(", "formatter", ")", ":", "if", "isinstance", "(", "formatter", ",", "ticker", ".", "Formatter", ")", ":", "return", "formatter", "elif", "callable", "(", "formatter", ")", ":", "args", "=", "[", "arg", "for", "arg", "in", "_ge...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
axis_overlap
Tests whether two axes overlap vertically
holoviews/plotting/mpl/util.py
def axis_overlap(ax1, ax2): """ Tests whether two axes overlap vertically """ b1, t1 = ax1.get_position().intervaly b2, t2 = ax2.get_position().intervaly return t1 > b2 and b1 < t2
def axis_overlap(ax1, ax2): """ Tests whether two axes overlap vertically """ b1, t1 = ax1.get_position().intervaly b2, t2 = ax2.get_position().intervaly return t1 > b2 and b1 < t2
[ "Tests", "whether", "two", "axes", "overlap", "vertically" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L189-L195
[ "def", "axis_overlap", "(", "ax1", ",", "ax2", ")", ":", "b1", ",", "t1", "=", "ax1", ".", "get_position", "(", ")", ".", "intervaly", "b2", ",", "t2", "=", "ax2", ".", "get_position", "(", ")", ".", "intervaly", "return", "t1", ">", "b2", "and", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
resolve_rows
Recursively iterate over lists of axes merging them by their vertical overlap leaving a list of rows.
holoviews/plotting/mpl/util.py
def resolve_rows(rows): """ Recursively iterate over lists of axes merging them by their vertical overlap leaving a list of rows. """ merged_rows = [] for row in rows: overlap = False for mrow in merged_rows: if any(axis_overlap(ax1, ax2) for ax1 in row ...
def resolve_rows(rows): """ Recursively iterate over lists of axes merging them by their vertical overlap leaving a list of rows. """ merged_rows = [] for row in rows: overlap = False for mrow in merged_rows: if any(axis_overlap(ax1, ax2) for ax1 in row ...
[ "Recursively", "iterate", "over", "lists", "of", "axes", "merging", "them", "by", "their", "vertical", "overlap", "leaving", "a", "list", "of", "rows", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L198-L218
[ "def", "resolve_rows", "(", "rows", ")", ":", "merged_rows", "=", "[", "]", "for", "row", "in", "rows", ":", "overlap", "=", "False", "for", "mrow", "in", "merged_rows", ":", "if", "any", "(", "axis_overlap", "(", "ax1", ",", "ax2", ")", "for", "ax1"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
fix_aspect
Calculate heights and widths of axes and adjust the size of the figure to match the aspect.
holoviews/plotting/mpl/util.py
def fix_aspect(fig, nrows, ncols, title=None, extra_artists=[], vspace=0.2, hspace=0.2): """ Calculate heights and widths of axes and adjust the size of the figure to match the aspect. """ fig.canvas.draw() w, h = fig.get_size_inches() # Compute maximum height and width of ea...
def fix_aspect(fig, nrows, ncols, title=None, extra_artists=[], vspace=0.2, hspace=0.2): """ Calculate heights and widths of axes and adjust the size of the figure to match the aspect. """ fig.canvas.draw() w, h = fig.get_size_inches() # Compute maximum height and width of ea...
[ "Calculate", "heights", "and", "widths", "of", "axes", "and", "adjust", "the", "size", "of", "the", "figure", "to", "match", "the", "aspect", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L221-L258
[ "def", "fix_aspect", "(", "fig", ",", "nrows", ",", "ncols", ",", "title", "=", "None", ",", "extra_artists", "=", "[", "]", ",", "vspace", "=", "0.2", ",", "hspace", "=", "0.2", ")", ":", "fig", ".", "canvas", ".", "draw", "(", ")", "w", ",", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_tight_bbox
Compute a tight bounding box around all the artists in the figure.
holoviews/plotting/mpl/util.py
def get_tight_bbox(fig, bbox_extra_artists=[], pad=None): """ Compute a tight bounding box around all the artists in the figure. """ renderer = fig.canvas.get_renderer() bbox_inches = fig.get_tightbbox(renderer) bbox_artists = bbox_extra_artists[:] bbox_artists += fig.get_default_bbox_extra_...
def get_tight_bbox(fig, bbox_extra_artists=[], pad=None): """ Compute a tight bounding box around all the artists in the figure. """ renderer = fig.canvas.get_renderer() bbox_inches = fig.get_tightbbox(renderer) bbox_artists = bbox_extra_artists[:] bbox_artists += fig.get_default_bbox_extra_...
[ "Compute", "a", "tight", "bounding", "box", "around", "all", "the", "artists", "in", "the", "figure", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L261-L291
[ "def", "get_tight_bbox", "(", "fig", ",", "bbox_extra_artists", "=", "[", "]", ",", "pad", "=", "None", ")", ":", "renderer", "=", "fig", ".", "canvas", ".", "get_renderer", "(", ")", "bbox_inches", "=", "fig", ".", "get_tightbbox", "(", "renderer", ")",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_raster_array
Return the array data from any Raster or Image type
holoviews/plotting/mpl/util.py
def get_raster_array(image): """ Return the array data from any Raster or Image type """ if isinstance(image, RGB): rgb = image.rgb data = np.dstack([np.flipud(rgb.dimension_values(d, flat=False)) for d in rgb.vdims]) else: data = image.dimension_val...
def get_raster_array(image): """ Return the array data from any Raster or Image type """ if isinstance(image, RGB): rgb = image.rgb data = np.dstack([np.flipud(rgb.dimension_values(d, flat=False)) for d in rgb.vdims]) else: data = image.dimension_val...
[ "Return", "the", "array", "data", "from", "any", "Raster", "or", "Image", "type" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L294-L308
[ "def", "get_raster_array", "(", "image", ")", ":", "if", "isinstance", "(", "image", ",", "RGB", ")", ":", "rgb", "=", "image", ".", "rgb", "data", "=", "np", ".", "dstack", "(", "[", "np", ".", "flipud", "(", "rgb", ".", "dimension_values", "(", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ring_coding
Produces matplotlib Path codes for exterior and interior rings of a polygon geometry.
holoviews/plotting/mpl/util.py
def ring_coding(array): """ Produces matplotlib Path codes for exterior and interior rings of a polygon geometry. """ # The codes will be all "LINETO" commands, except for "MOVETO"s at the # beginning of each subpath n = len(array) codes = np.ones(n, dtype=Path.code_type) * Path.LINETO ...
def ring_coding(array): """ Produces matplotlib Path codes for exterior and interior rings of a polygon geometry. """ # The codes will be all "LINETO" commands, except for "MOVETO"s at the # beginning of each subpath n = len(array) codes = np.ones(n, dtype=Path.code_type) * Path.LINETO ...
[ "Produces", "matplotlib", "Path", "codes", "for", "exterior", "and", "interior", "rings", "of", "a", "polygon", "geometry", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L311-L322
[ "def", "ring_coding", "(", "array", ")", ":", "# The codes will be all \"LINETO\" commands, except for \"MOVETO\"s at the", "# beginning of each subpath", "n", "=", "len", "(", "array", ")", "codes", "=", "np", ".", "ones", "(", "n", ",", "dtype", "=", "Path", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
polygons_to_path_patches
Converts Polygons into list of lists of matplotlib.patches.PathPatch objects including any specified holes. Each list represents one (multi-)polygon.
holoviews/plotting/mpl/util.py
def polygons_to_path_patches(element): """ Converts Polygons into list of lists of matplotlib.patches.PathPatch objects including any specified holes. Each list represents one (multi-)polygon. """ paths = element.split(datatype='array', dimensions=element.kdims) has_holes = isinstance(elemen...
def polygons_to_path_patches(element): """ Converts Polygons into list of lists of matplotlib.patches.PathPatch objects including any specified holes. Each list represents one (multi-)polygon. """ paths = element.split(datatype='array', dimensions=element.kdims) has_holes = isinstance(elemen...
[ "Converts", "Polygons", "into", "list", "of", "lists", "of", "matplotlib", ".", "patches", ".", "PathPatch", "objects", "including", "any", "specified", "holes", ".", "Each", "list", "represents", "one", "(", "multi", "-", ")", "polygon", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/util.py#L325-L354
[ "def", "polygons_to_path_patches", "(", "element", ")", ":", "paths", "=", "element", ".", "split", "(", "datatype", "=", "'array'", ",", "dimensions", "=", "element", ".", "kdims", ")", "has_holes", "=", "isinstance", "(", "element", ",", "Polygons", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot.link_sources
Returns potential Link or Stream sources.
holoviews/plotting/bokeh/plot.py
def link_sources(self): "Returns potential Link or Stream sources." if isinstance(self, GenericOverlayPlot): zorders = [] elif self.batched: zorders = list(range(self.zorder, self.zorder+len(self.hmap.last))) else: zorders = [self.zorder] if i...
def link_sources(self): "Returns potential Link or Stream sources." if isinstance(self, GenericOverlayPlot): zorders = [] elif self.batched: zorders = list(range(self.zorder, self.zorder+len(self.hmap.last))) else: zorders = [self.zorder] if i...
[ "Returns", "potential", "Link", "or", "Stream", "sources", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L137-L153
[ "def", "link_sources", "(", "self", ")", ":", "if", "isinstance", "(", "self", ",", "GenericOverlayPlot", ")", ":", "zorders", "=", "[", "]", "elif", "self", ".", "batched", ":", "zorders", "=", "list", "(", "range", "(", "self", ".", "zorder", ",", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot._construct_callbacks
Initializes any callbacks for streams which have defined the plotted object as a source.
holoviews/plotting/bokeh/plot.py
def _construct_callbacks(self): """ Initializes any callbacks for streams which have defined the plotted object as a source. """ cb_classes = set() registry = list(Stream.registry.items()) callbacks = Stream._callbacks['bokeh'] for source in self.link_sour...
def _construct_callbacks(self): """ Initializes any callbacks for streams which have defined the plotted object as a source. """ cb_classes = set() registry = list(Stream.registry.items()) callbacks = Stream._callbacks['bokeh'] for source in self.link_sour...
[ "Initializes", "any", "callbacks", "for", "streams", "which", "have", "defined", "the", "plotted", "object", "as", "a", "source", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L156-L177
[ "def", "_construct_callbacks", "(", "self", ")", ":", "cb_classes", "=", "set", "(", ")", "registry", "=", "list", "(", "Stream", ".", "registry", ".", "items", "(", ")", ")", "callbacks", "=", "Stream", ".", "_callbacks", "[", "'bokeh'", "]", "for", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot.push
Pushes updated plot data via the Comm.
holoviews/plotting/bokeh/plot.py
def push(self): """ Pushes updated plot data via the Comm. """ if self.renderer.mode == 'server': return if self.comm is None: raise Exception('Renderer does not have a comm.') if self._root and 'embedded' in self._root.tags: # Allows ...
def push(self): """ Pushes updated plot data via the Comm. """ if self.renderer.mode == 'server': return if self.comm is None: raise Exception('Renderer does not have a comm.') if self._root and 'embedded' in self._root.tags: # Allows ...
[ "Pushes", "updated", "plot", "data", "via", "the", "Comm", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L186-L207
[ "def", "push", "(", "self", ")", ":", "if", "self", ".", "renderer", ".", "mode", "==", "'server'", ":", "return", "if", "self", ".", "comm", "is", "None", ":", "raise", "Exception", "(", "'Renderer does not have a comm.'", ")", "if", "self", ".", "_root...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot.set_root
Sets the root model on all subplots.
holoviews/plotting/bokeh/plot.py
def set_root(self, root): """ Sets the root model on all subplots. """ if root is None: return for plot in self.traverse(lambda x: x): plot._root = root
def set_root(self, root): """ Sets the root model on all subplots. """ if root is None: return for plot in self.traverse(lambda x: x): plot._root = root
[ "Sets", "the", "root", "model", "on", "all", "subplots", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L210-L217
[ "def", "set_root", "(", "self", ",", "root", ")", ":", "if", "root", "is", "None", ":", "return", "for", "plot", "in", "self", ".", "traverse", "(", "lambda", "x", ":", "x", ")", ":", "plot", ".", "_root", "=", "root" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot._init_datasource
Initializes a data source to be passed into the bokeh glyph.
holoviews/plotting/bokeh/plot.py
def _init_datasource(self, data): """ Initializes a data source to be passed into the bokeh glyph. """ data = self._postprocess_data(data) return ColumnDataSource(data=data)
def _init_datasource(self, data): """ Initializes a data source to be passed into the bokeh glyph. """ data = self._postprocess_data(data) return ColumnDataSource(data=data)
[ "Initializes", "a", "data", "source", "to", "be", "passed", "into", "the", "bokeh", "glyph", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L220-L225
[ "def", "_init_datasource", "(", "self", ",", "data", ")", ":", "data", "=", "self", ".", "_postprocess_data", "(", "data", ")", "return", "ColumnDataSource", "(", "data", "=", "data", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot._postprocess_data
Applies necessary type transformation to the data before it is set on a ColumnDataSource.
holoviews/plotting/bokeh/plot.py
def _postprocess_data(self, data): """ Applies necessary type transformation to the data before it is set on a ColumnDataSource. """ new_data = {} for k, values in data.items(): values = decode_bytes(values) # Bytes need decoding to strings # Cert...
def _postprocess_data(self, data): """ Applies necessary type transformation to the data before it is set on a ColumnDataSource. """ new_data = {} for k, values in data.items(): values = decode_bytes(values) # Bytes need decoding to strings # Cert...
[ "Applies", "necessary", "type", "transformation", "to", "the", "data", "before", "it", "is", "set", "on", "a", "ColumnDataSource", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L228-L248
[ "def", "_postprocess_data", "(", "self", ",", "data", ")", ":", "new_data", "=", "{", "}", "for", "k", ",", "values", "in", "data", ".", "items", "(", ")", ":", "values", "=", "decode_bytes", "(", "values", ")", "# Bytes need decoding to strings", "# Certa...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot._update_datasource
Update datasource with data for a new frame.
holoviews/plotting/bokeh/plot.py
def _update_datasource(self, source, data): """ Update datasource with data for a new frame. """ if not self.document: return data = self._postprocess_data(data) empty = all(len(v) == 0 for v in data.values()) if (self.streaming and self.streaming[0]....
def _update_datasource(self, source, data): """ Update datasource with data for a new frame. """ if not self.document: return data = self._postprocess_data(data) empty = all(len(v) == 0 for v in data.values()) if (self.streaming and self.streaming[0]....
[ "Update", "datasource", "with", "data", "for", "a", "new", "frame", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L251-L271
[ "def", "_update_datasource", "(", "self", ",", "source", ",", "data", ")", ":", "if", "not", "self", ".", "document", ":", "return", "data", "=", "self", ".", "_postprocess_data", "(", "data", ")", "empty", "=", "all", "(", "len", "(", "v", ")", "=="...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot._update_callbacks
Iterates over all subplots and updates existing CustomJS callbacks with models that were replaced when compositing subplots into a CompositePlot and sets the plot id to match the root level bokeh model.
holoviews/plotting/bokeh/plot.py
def _update_callbacks(self, plot): """ Iterates over all subplots and updates existing CustomJS callbacks with models that were replaced when compositing subplots into a CompositePlot and sets the plot id to match the root level bokeh model. """ subplots = self.tr...
def _update_callbacks(self, plot): """ Iterates over all subplots and updates existing CustomJS callbacks with models that were replaced when compositing subplots into a CompositePlot and sets the plot id to match the root level bokeh model. """ subplots = self.tr...
[ "Iterates", "over", "all", "subplots", "and", "updates", "existing", "CustomJS", "callbacks", "with", "models", "that", "were", "replaced", "when", "compositing", "subplots", "into", "a", "CompositePlot", "and", "sets", "the", "plot", "id", "to", "match", "the",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L273-L290
[ "def", "_update_callbacks", "(", "self", ",", "plot", ")", ":", "subplots", "=", "self", ".", "traverse", "(", "lambda", "x", ":", "x", ",", "[", "GenericElementPlot", "]", ")", "merged_tools", "=", "{", "t", ":", "list", "(", "plot", ".", "select", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot.cleanup
Cleans up references to the plot after the plot has been deleted. Traverses through all plots cleaning up Callbacks and Stream subscribers.
holoviews/plotting/bokeh/plot.py
def cleanup(self): """ Cleans up references to the plot after the plot has been deleted. Traverses through all plots cleaning up Callbacks and Stream subscribers. """ plots = self.traverse(lambda x: x, [BokehPlot]) for plot in plots: if not isinstance(...
def cleanup(self): """ Cleans up references to the plot after the plot has been deleted. Traverses through all plots cleaning up Callbacks and Stream subscribers. """ plots = self.traverse(lambda x: x, [BokehPlot]) for plot in plots: if not isinstance(...
[ "Cleans", "up", "references", "to", "the", "plot", "after", "the", "plot", "has", "been", "deleted", ".", "Traverses", "through", "all", "plots", "cleaning", "up", "Callbacks", "and", "Stream", "subscribers", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L310-L339
[ "def", "cleanup", "(", "self", ")", ":", "plots", "=", "self", ".", "traverse", "(", "lambda", "x", ":", "x", ",", "[", "BokehPlot", "]", ")", "for", "plot", "in", "plots", ":", "if", "not", "isinstance", "(", "plot", ",", "(", "GenericCompositePlot"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot._fontsize
Converts integer fontsizes to a string specifying fontsize in pt.
holoviews/plotting/bokeh/plot.py
def _fontsize(self, key, label='fontsize', common=True): """ Converts integer fontsizes to a string specifying fontsize in pt. """ size = super(BokehPlot, self)._fontsize(key, label, common) return {k: v if isinstance(v, basestring) else '%spt' % v for k, ...
def _fontsize(self, key, label='fontsize', common=True): """ Converts integer fontsizes to a string specifying fontsize in pt. """ size = super(BokehPlot, self)._fontsize(key, label, common) return {k: v if isinstance(v, basestring) else '%spt' % v for k, ...
[ "Converts", "integer", "fontsizes", "to", "a", "string", "specifying", "fontsize", "in", "pt", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L342-L349
[ "def", "_fontsize", "(", "self", ",", "key", ",", "label", "=", "'fontsize'", ",", "common", "=", "True", ")", ":", "size", "=", "super", "(", "BokehPlot", ",", "self", ")", ".", "_fontsize", "(", "key", ",", "label", ",", "common", ")", "return", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BokehPlot.sync_sources
Syncs data sources between Elements, which draw data from the same object.
holoviews/plotting/bokeh/plot.py
def sync_sources(self): """ Syncs data sources between Elements, which draw data from the same object. """ get_sources = lambda x: (id(x.current_frame.data), x) filter_fn = lambda x: (x.shared_datasource and x.current_frame is not None and n...
def sync_sources(self): """ Syncs data sources between Elements, which draw data from the same object. """ get_sources = lambda x: (id(x.current_frame.data), x) filter_fn = lambda x: (x.shared_datasource and x.current_frame is not None and n...
[ "Syncs", "data", "sources", "between", "Elements", "which", "draw", "data", "from", "the", "same", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L383-L431
[ "def", "sync_sources", "(", "self", ")", ":", "get_sources", "=", "lambda", "x", ":", "(", "id", "(", "x", ".", "current_frame", ".", "data", ")", ",", "x", ")", "filter_fn", "=", "lambda", "x", ":", "(", "x", ".", "shared_datasource", "and", "x", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
CompositePlot._link_dimensioned_streams
Should perform any linking required to update titles when dimensioned streams change.
holoviews/plotting/bokeh/plot.py
def _link_dimensioned_streams(self): """ Should perform any linking required to update titles when dimensioned streams change. """ streams = [s for s in self.streams if any(k in self.dimensions for k in s.contents)] for s in streams: s.add_subscriber(self._str...
def _link_dimensioned_streams(self): """ Should perform any linking required to update titles when dimensioned streams change. """ streams = [s for s in self.streams if any(k in self.dimensions for k in s.contents)] for s in streams: s.add_subscriber(self._str...
[ "Should", "perform", "any", "linking", "required", "to", "update", "titles", "when", "dimensioned", "streams", "change", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L499-L506
[ "def", "_link_dimensioned_streams", "(", "self", ")", ":", "streams", "=", "[", "s", "for", "s", "in", "self", ".", "streams", "if", "any", "(", "k", "in", "self", ".", "dimensions", "for", "k", "in", "s", ".", "contents", ")", "]", "for", "s", "in...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridPlot.update_frame
Update the internal state of the Plot to represent the given key tuple (where integers represent frames). Returns this state.
holoviews/plotting/bokeh/plot.py
def update_frame(self, key, ranges=None): """ Update the internal state of the Plot to represent the given key tuple (where integers represent frames). Returns this state. """ ranges = self.compute_ranges(self.layout, key, ranges) for coord in self.layout.keys(ful...
def update_frame(self, key, ranges=None): """ Update the internal state of the Plot to represent the given key tuple (where integers represent frames). Returns this state. """ ranges = self.compute_ranges(self.layout, key, ranges) for coord in self.layout.keys(ful...
[ "Update", "the", "internal", "state", "of", "the", "Plot", "to", "represent", "the", "given", "key", "tuple", "(", "where", "integers", "represent", "frames", ")", ".", "Returns", "this", "state", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/plot.py#L760-L773
[ "def", "update_frame", "(", "self", ",", "key", ",", "ranges", "=", "None", ")", ":", "ranges", "=", "self", ".", "compute_ranges", "(", "self", ".", "layout", ",", "key", ",", "ranges", ")", "for", "coord", "in", "self", ".", "layout", ".", "keys", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655