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
Buffer.verify
Verify consistency of dataframes that pass through this stream
holoviews/streams.py
def verify(self, x): """ Verify consistency of dataframes that pass through this stream """ if type(x) != type(self.data): raise TypeError("Input expected to be of type %s, got %s." % (type(self.data).__name__, type(x).__name__)) elif isinstance(x, np.ndar...
def verify(self, x): """ Verify consistency of dataframes that pass through this stream """ if type(x) != type(self.data): raise TypeError("Input expected to be of type %s, got %s." % (type(self.data).__name__, type(x).__name__)) elif isinstance(x, np.ndar...
[ "Verify", "consistency", "of", "dataframes", "that", "pass", "through", "this", "stream" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/streams.py#L528-L548
[ "def", "verify", "(", "self", ",", "x", ")", ":", "if", "type", "(", "x", ")", "!=", "type", "(", "self", ".", "data", ")", ":", "raise", "TypeError", "(", "\"Input expected to be of type %s, got %s.\"", "%", "(", "type", "(", "self", ".", "data", ")",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Buffer.clear
Clears the data in the stream
holoviews/streams.py
def clear(self): "Clears the data in the stream" if isinstance(self.data, np.ndarray): data = self.data[:, :0] elif util.pd and isinstance(self.data, util.pd.DataFrame): data = self.data.iloc[:0] elif isinstance(self.data, dict): data = {k: v[:0] for k...
def clear(self): "Clears the data in the stream" if isinstance(self.data, np.ndarray): data = self.data[:, :0] elif util.pd and isinstance(self.data, util.pd.DataFrame): data = self.data.iloc[:0] elif isinstance(self.data, dict): data = {k: v[:0] for k...
[ "Clears", "the", "data", "in", "the", "stream" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/streams.py#L551-L561
[ "def", "clear", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "data", ",", "np", ".", "ndarray", ")", ":", "data", "=", "self", ".", "data", "[", ":", ",", ":", "0", "]", "elif", "util", ".", "pd", "and", "isinstance", "(", "self...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Buffer._concat
Concatenate and slice the accepted data types to the defined length.
holoviews/streams.py
def _concat(self, data): """ Concatenate and slice the accepted data types to the defined length. """ if isinstance(data, np.ndarray): data_length = len(data) if data_length < self.length: prev_chunk = self.data[-(self.length-data_length):]...
def _concat(self, data): """ Concatenate and slice the accepted data types to the defined length. """ if isinstance(data, np.ndarray): data_length = len(data) if data_length < self.length: prev_chunk = self.data[-(self.length-data_length):]...
[ "Concatenate", "and", "slice", "the", "accepted", "data", "types", "to", "the", "defined", "length", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/streams.py#L564-L596
[ "def", "_concat", "(", "self", ",", "data", ")", ":", "if", "isinstance", "(", "data", ",", "np", ".", "ndarray", ")", ":", "data_length", "=", "len", "(", "data", ")", "if", "data_length", "<", "self", ".", "length", ":", "prev_chunk", "=", "self", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Buffer.update
Overrides update to concatenate streamed data up to defined length.
holoviews/streams.py
def update(self, **kwargs): """ Overrides update to concatenate streamed data up to defined length. """ data = kwargs.get('data') if data is not None: if (util.pd and isinstance(data, util.pd.DataFrame) and list(data.columns) != list(self.data.columns)...
def update(self, **kwargs): """ Overrides update to concatenate streamed data up to defined length. """ data = kwargs.get('data') if data is not None: if (util.pd and isinstance(data, util.pd.DataFrame) and list(data.columns) != list(self.data.columns)...
[ "Overrides", "update", "to", "concatenate", "streamed", "data", "up", "to", "defined", "length", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/streams.py#L599-L611
[ "def", "update", "(", "self", ",", "*", "*", "kwargs", ")", ":", "data", "=", "kwargs", ".", "get", "(", "'data'", ")", "if", "data", "is", "not", "None", ":", "if", "(", "util", ".", "pd", "and", "isinstance", "(", "data", ",", "util", ".", "p...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Params.from_params
Returns Params streams given a dictionary of parameters Args: params (dict): Dictionary of parameters Returns: List of Params streams
holoviews/streams.py
def from_params(cls, params): """Returns Params streams given a dictionary of parameters Args: params (dict): Dictionary of parameters Returns: List of Params streams """ key_fn = lambda x: id(x[1].owner) streams = [] for _, group in grou...
def from_params(cls, params): """Returns Params streams given a dictionary of parameters Args: params (dict): Dictionary of parameters Returns: List of Params streams """ key_fn = lambda x: id(x[1].owner) streams = [] for _, group in grou...
[ "Returns", "Params", "streams", "given", "a", "dictionary", "of", "parameters" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/streams.py#L647-L666
[ "def", "from_params", "(", "cls", ",", "params", ")", ":", "key_fn", "=", "lambda", "x", ":", "id", "(", "x", "[", "1", "]", ".", "owner", ")", "streams", "=", "[", "]", "for", "_", ",", "group", "in", "groupby", "(", "sorted", "(", "params", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Path.select
Bypasses selection on data and sets extents based on selection.
holoviews/element/path.py
def select(self, selection_specs=None, **kwargs): """ Bypasses selection on data and sets extents based on selection. """ return super(Element2D, self).select(selection_specs, **kwargs)
def select(self, selection_specs=None, **kwargs): """ Bypasses selection on data and sets extents based on selection. """ return super(Element2D, self).select(selection_specs, **kwargs)
[ "Bypasses", "selection", "on", "data", "and", "sets", "extents", "based", "on", "selection", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/path.py#L109-L113
[ "def", "select", "(", "self", ",", "selection_specs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "super", "(", "Element2D", ",", "self", ")", ".", "select", "(", "selection_specs", ",", "*", "*", "kwargs", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Path.split
The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths.
holoviews/element/path.py
def split(self, start=None, end=None, datatype=None, **kwargs): """ The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths. """ if not self.interface.multi: if data...
def split(self, start=None, end=None, datatype=None, **kwargs): """ The split method allows splitting a Path type into a list of subpaths of the same type. A start and/or end may be supplied to select a subset of paths. """ if not self.interface.multi: if data...
[ "The", "split", "method", "allows", "splitting", "a", "Path", "type", "into", "a", "list", "of", "subpaths", "of", "the", "same", "type", ".", "A", "start", "and", "/", "or", "end", "may", "be", "supplied", "to", "select", "a", "subset", "of", "paths",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/path.py#L116-L134
[ "def", "split", "(", "self", ",", "start", "=", "None", ",", "end", "=", "None", ",", "datatype", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "not", "self", ".", "interface", ".", "multi", ":", "if", "datatype", "==", "'array'", ":", "o...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BaseShape.clone
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
holoviews/element/path.py
def clone(self, *args, **overrides): """ Returns a clone of the object with matching parameter values containing the specified args and kwargs. """ link = overrides.pop('link', True) settings = dict(self.get_param_values(), **overrides) if 'id' not in settings: ...
def clone(self, *args, **overrides): """ Returns a clone of the object with matching parameter values containing the specified args and kwargs. """ link = overrides.pop('link', True) settings = dict(self.get_param_values(), **overrides) if 'id' not in settings: ...
[ "Returns", "a", "clone", "of", "the", "object", "with", "matching", "parameter", "values", "containing", "the", "specified", "args", "and", "kwargs", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/path.py#L329-L344
[ "def", "clone", "(", "self", ",", "*", "args", ",", "*", "*", "overrides", ")", ":", "link", "=", "overrides", ".", "pop", "(", "'link'", ",", "True", ")", "settings", "=", "dict", "(", "self", ".", "get_param_values", "(", ")", ",", "*", "*", "o...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
convert_timestamp
Converts bokehJS timestamp to datetime64.
holoviews/plotting/bokeh/util.py
def convert_timestamp(timestamp): """ Converts bokehJS timestamp to datetime64. """ datetime = dt.datetime.utcfromtimestamp(timestamp/1000.) return np.datetime64(datetime.replace(tzinfo=None))
def convert_timestamp(timestamp): """ Converts bokehJS timestamp to datetime64. """ datetime = dt.datetime.utcfromtimestamp(timestamp/1000.) return np.datetime64(datetime.replace(tzinfo=None))
[ "Converts", "bokehJS", "timestamp", "to", "datetime64", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L87-L92
[ "def", "convert_timestamp", "(", "timestamp", ")", ":", "datetime", "=", "dt", ".", "datetime", ".", "utcfromtimestamp", "(", "timestamp", "/", "1000.", ")", "return", "np", ".", "datetime64", "(", "datetime", ".", "replace", "(", "tzinfo", "=", "None", ")...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
decode_bytes
Decodes an array, list or tuple of bytestrings to avoid python 3 bokeh serialization errors
holoviews/plotting/bokeh/util.py
def decode_bytes(array): """ Decodes an array, list or tuple of bytestrings to avoid python 3 bokeh serialization errors """ if (sys.version_info.major == 2 or not len(array) or (isinstance(array, np.ndarray) and array.dtype.kind != 'O')): return array decoded = [v.decode('utf-8'...
def decode_bytes(array): """ Decodes an array, list or tuple of bytestrings to avoid python 3 bokeh serialization errors """ if (sys.version_info.major == 2 or not len(array) or (isinstance(array, np.ndarray) and array.dtype.kind != 'O')): return array decoded = [v.decode('utf-8'...
[ "Decodes", "an", "array", "list", "or", "tuple", "of", "bytestrings", "to", "avoid", "python", "3", "bokeh", "serialization", "errors" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L95-L108
[ "def", "decode_bytes", "(", "array", ")", ":", "if", "(", "sys", ".", "version_info", ".", "major", "==", "2", "or", "not", "len", "(", "array", ")", "or", "(", "isinstance", "(", "array", ",", "np", ".", "ndarray", ")", "and", "array", ".", "dtype...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
layout_padding
Pads Nones in a list of lists of plots with empty plots.
holoviews/plotting/bokeh/util.py
def layout_padding(plots, renderer): """ Pads Nones in a list of lists of plots with empty plots. """ widths, heights = defaultdict(int), defaultdict(int) for r, row in enumerate(plots): for c, p in enumerate(row): if p is not None: width, height = renderer.get_si...
def layout_padding(plots, renderer): """ Pads Nones in a list of lists of plots with empty plots. """ widths, heights = defaultdict(int), defaultdict(int) for r, row in enumerate(plots): for c, p in enumerate(row): if p is not None: width, height = renderer.get_si...
[ "Pads", "Nones", "in", "a", "list", "of", "lists", "of", "plots", "with", "empty", "plots", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L111-L133
[ "def", "layout_padding", "(", "plots", ",", "renderer", ")", ":", "widths", ",", "heights", "=", "defaultdict", "(", "int", ")", ",", "defaultdict", "(", "int", ")", "for", "r", ",", "row", "in", "enumerate", "(", "plots", ")", ":", "for", "c", ",", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
compute_plot_size
Computes the size of bokeh models that make up a layout such as figures, rows, columns, widgetboxes and Plot.
holoviews/plotting/bokeh/util.py
def compute_plot_size(plot): """ Computes the size of bokeh models that make up a layout such as figures, rows, columns, widgetboxes and Plot. """ if isinstance(plot, GridBox): ndmapping = NdMapping({(x, y): fig for fig, y, x in plot.children}, kdims=['x', 'y']) cols = ndmapping.grou...
def compute_plot_size(plot): """ Computes the size of bokeh models that make up a layout such as figures, rows, columns, widgetboxes and Plot. """ if isinstance(plot, GridBox): ndmapping = NdMapping({(x, y): fig for fig, y, x in plot.children}, kdims=['x', 'y']) cols = ndmapping.grou...
[ "Computes", "the", "size", "of", "bokeh", "models", "that", "make", "up", "a", "layout", "such", "as", "figures", "rows", "columns", "widgetboxes", "and", "Plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L136-L174
[ "def", "compute_plot_size", "(", "plot", ")", ":", "if", "isinstance", "(", "plot", ",", "GridBox", ")", ":", "ndmapping", "=", "NdMapping", "(", "{", "(", "x", ",", "y", ")", ":", "fig", "for", "fig", ",", "y", ",", "x", "in", "plot", ".", "chil...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
compute_layout_properties
Utility to compute the aspect, plot width/height and sizing_mode behavior. Args: width (int): Plot width height (int): Plot height frame_width (int): Plot frame width frame_height (int): Plot frame height explicit_width (list): List of user supplied widths explicit_height (l...
holoviews/plotting/bokeh/util.py
def compute_layout_properties( width, height, frame_width, frame_height, explicit_width, explicit_height, aspect, data_aspect, responsive, size_multiplier, logger=None): """ Utility to compute the aspect, plot width/height and sizing_mode behavior. Args: width (int): Plot ...
def compute_layout_properties( width, height, frame_width, frame_height, explicit_width, explicit_height, aspect, data_aspect, responsive, size_multiplier, logger=None): """ Utility to compute the aspect, plot width/height and sizing_mode behavior. Args: width (int): Plot ...
[ "Utility", "to", "compute", "the", "aspect", "plot", "width", "/", "height", "and", "sizing_mode", "behavior", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L177-L334
[ "def", "compute_layout_properties", "(", "width", ",", "height", ",", "frame_width", ",", "frame_height", ",", "explicit_width", ",", "explicit_height", ",", "aspect", ",", "data_aspect", ",", "responsive", ",", "size_multiplier", ",", "logger", "=", "None", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
silence_warnings
Context manager for silencing bokeh validation warnings.
holoviews/plotting/bokeh/util.py
def silence_warnings(*warnings): """ Context manager for silencing bokeh validation warnings. """ for warning in warnings: silence(warning) try: yield finally: for warning in warnings: silence(warning, False)
def silence_warnings(*warnings): """ Context manager for silencing bokeh validation warnings. """ for warning in warnings: silence(warning) try: yield finally: for warning in warnings: silence(warning, False)
[ "Context", "manager", "for", "silencing", "bokeh", "validation", "warnings", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L338-L348
[ "def", "silence_warnings", "(", "*", "warnings", ")", ":", "for", "warning", "in", "warnings", ":", "silence", "(", "warning", ")", "try", ":", "yield", "finally", ":", "for", "warning", "in", "warnings", ":", "silence", "(", "warning", ",", "False", ")"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
font_size_to_pixels
Convert a fontsize to a pixel value
holoviews/plotting/bokeh/util.py
def font_size_to_pixels(size): """ Convert a fontsize to a pixel value """ if size is None or not isinstance(size, basestring): return conversions = {'em': 16, 'pt': 16/12.} val = re.findall('\d+', size) unit = re.findall('[a-z]+', size) if (val and not unit) or (val and unit[0] ...
def font_size_to_pixels(size): """ Convert a fontsize to a pixel value """ if size is None or not isinstance(size, basestring): return conversions = {'em': 16, 'pt': 16/12.} val = re.findall('\d+', size) unit = re.findall('[a-z]+', size) if (val and not unit) or (val and unit[0] ...
[ "Convert", "a", "fontsize", "to", "a", "pixel", "value" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L358-L370
[ "def", "font_size_to_pixels", "(", "size", ")", ":", "if", "size", "is", "None", "or", "not", "isinstance", "(", "size", ",", "basestring", ")", ":", "return", "conversions", "=", "{", "'em'", ":", "16", ",", "'pt'", ":", "16", "/", "12.", "}", "val"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
hsv_to_rgb
Vectorized HSV to RGB conversion, adapted from: http://stackoverflow.com/questions/24852345/hsv-to-rgb-color-conversion
holoviews/plotting/bokeh/util.py
def hsv_to_rgb(hsv): """ Vectorized HSV to RGB conversion, adapted from: http://stackoverflow.com/questions/24852345/hsv-to-rgb-color-conversion """ h, s, v = (hsv[..., i] for i in range(3)) shape = h.shape i = np.int_(h*6.) f = h*6.-i q = f t = 1.-f i = np.ravel(i) f = ...
def hsv_to_rgb(hsv): """ Vectorized HSV to RGB conversion, adapted from: http://stackoverflow.com/questions/24852345/hsv-to-rgb-color-conversion """ h, s, v = (hsv[..., i] for i in range(3)) shape = h.shape i = np.int_(h*6.) f = h*6.-i q = f t = 1.-f i = np.ravel(i) f = ...
[ "Vectorized", "HSV", "to", "RGB", "conversion", "adapted", "from", ":", "http", ":", "//", "stackoverflow", ".", "com", "/", "questions", "/", "24852345", "/", "hsv", "-", "to", "-", "rgb", "-", "color", "-", "conversion" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L438-L465
[ "def", "hsv_to_rgb", "(", "hsv", ")", ":", "h", ",", "s", ",", "v", "=", "(", "hsv", "[", "...", ",", "i", "]", "for", "i", "in", "range", "(", "3", ")", ")", "shape", "=", "h", ".", "shape", "i", "=", "np", ".", "int_", "(", "h", "*", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
pad_width
Computes the width of a model and sets up appropriate padding for Tabs and DataTable types.
holoviews/plotting/bokeh/util.py
def pad_width(model, table_padding=0.85, tabs_padding=1.2): """ Computes the width of a model and sets up appropriate padding for Tabs and DataTable types. """ if isinstance(model, Row): vals = [pad_width(child) for child in model.children] width = np.max([v for v in vals if v is not...
def pad_width(model, table_padding=0.85, tabs_padding=1.2): """ Computes the width of a model and sets up appropriate padding for Tabs and DataTable types. """ if isinstance(model, Row): vals = [pad_width(child) for child in model.children] width = np.max([v for v in vals if v is not...
[ "Computes", "the", "width", "of", "a", "model", "and", "sets", "up", "appropriate", "padding", "for", "Tabs", "and", "DataTable", "types", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L468-L494
[ "def", "pad_width", "(", "model", ",", "table_padding", "=", "0.85", ",", "tabs_padding", "=", "1.2", ")", ":", "if", "isinstance", "(", "model", ",", "Row", ")", ":", "vals", "=", "[", "pad_width", "(", "child", ")", "for", "child", "in", "model", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
pad_plots
Accepts a grid of bokeh plots in form of a list of lists and wraps any DataTable or Tabs in a WidgetBox with appropriate padding. Required to avoid overlap in gridplot.
holoviews/plotting/bokeh/util.py
def pad_plots(plots): """ Accepts a grid of bokeh plots in form of a list of lists and wraps any DataTable or Tabs in a WidgetBox with appropriate padding. Required to avoid overlap in gridplot. """ widths = [] for row in plots: row_widths = [] for p in row: width...
def pad_plots(plots): """ Accepts a grid of bokeh plots in form of a list of lists and wraps any DataTable or Tabs in a WidgetBox with appropriate padding. Required to avoid overlap in gridplot. """ widths = [] for row in plots: row_widths = [] for p in row: width...
[ "Accepts", "a", "grid", "of", "bokeh", "plots", "in", "form", "of", "a", "list", "of", "lists", "and", "wraps", "any", "DataTable", "or", "Tabs", "in", "a", "WidgetBox", "with", "appropriate", "padding", ".", "Required", "to", "avoid", "overlap", "in", "...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L497-L512
[ "def", "pad_plots", "(", "plots", ")", ":", "widths", "=", "[", "]", "for", "row", "in", "plots", ":", "row_widths", "=", "[", "]", "for", "p", "in", "row", ":", "width", "=", "pad_width", "(", "p", ")", "row_widths", ".", "append", "(", "width", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
filter_toolboxes
Filters out toolboxes out of a list of plots to be able to compose them into a larger plot.
holoviews/plotting/bokeh/util.py
def filter_toolboxes(plots): """ Filters out toolboxes out of a list of plots to be able to compose them into a larger plot. """ if isinstance(plots, list): plots = [filter_toolboxes(plot) for plot in plots] elif hasattr(plots, 'children'): plots.children = [filter_toolboxes(chil...
def filter_toolboxes(plots): """ Filters out toolboxes out of a list of plots to be able to compose them into a larger plot. """ if isinstance(plots, list): plots = [filter_toolboxes(plot) for plot in plots] elif hasattr(plots, 'children'): plots.children = [filter_toolboxes(chil...
[ "Filters", "out", "toolboxes", "out", "of", "a", "list", "of", "plots", "to", "be", "able", "to", "compose", "them", "into", "a", "larger", "plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L515-L525
[ "def", "filter_toolboxes", "(", "plots", ")", ":", "if", "isinstance", "(", "plots", ",", "list", ")", ":", "plots", "=", "[", "filter_toolboxes", "(", "plot", ")", "for", "plot", "in", "plots", "]", "elif", "hasattr", "(", "plots", ",", "'children'", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
py2js_tickformatter
Uses flexx.pyscript to compile a python tick formatter to JS code
holoviews/plotting/bokeh/util.py
def py2js_tickformatter(formatter, msg=''): """ Uses flexx.pyscript to compile a python tick formatter to JS code """ try: from flexx.pyscript import py2js except ImportError: param.main.param.warning( msg+'Ensure Flexx is installed ("conda install -c bokeh flexx" ' ...
def py2js_tickformatter(formatter, msg=''): """ Uses flexx.pyscript to compile a python tick formatter to JS code """ try: from flexx.pyscript import py2js except ImportError: param.main.param.warning( msg+'Ensure Flexx is installed ("conda install -c bokeh flexx" ' ...
[ "Uses", "flexx", ".", "pyscript", "to", "compile", "a", "python", "tick", "formatter", "to", "JS", "code" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L528-L552
[ "def", "py2js_tickformatter", "(", "formatter", ",", "msg", "=", "''", ")", ":", "try", ":", "from", "flexx", ".", "pyscript", "import", "py2js", "except", "ImportError", ":", "param", ".", "main", ".", "param", ".", "warning", "(", "msg", "+", "'Ensure ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
get_tab_title
Computes a title for bokeh tabs from the key in the overlay, the element and the containing (Nd)Overlay.
holoviews/plotting/bokeh/util.py
def get_tab_title(key, frame, overlay): """ Computes a title for bokeh tabs from the key in the overlay, the element and the containing (Nd)Overlay. """ if isinstance(overlay, Overlay): if frame is not None: title = [] if frame.label: title.append(fram...
def get_tab_title(key, frame, overlay): """ Computes a title for bokeh tabs from the key in the overlay, the element and the containing (Nd)Overlay. """ if isinstance(overlay, Overlay): if frame is not None: title = [] if frame.label: title.append(fram...
[ "Computes", "a", "title", "for", "bokeh", "tabs", "from", "the", "key", "in", "the", "overlay", "the", "element", "and", "the", "containing", "(", "Nd", ")", "Overlay", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L555-L575
[ "def", "get_tab_title", "(", "key", ",", "frame", ",", "overlay", ")", ":", "if", "isinstance", "(", "overlay", ",", "Overlay", ")", ":", "if", "frame", "is", "not", "None", ":", "title", "=", "[", "]", "if", "frame", ".", "label", ":", "title", "....
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
filter_batched_data
Iterates over the data and mapping for a ColumnDataSource and replaces columns with repeating values with a scalar. This is purely and optimization for scalar types.
holoviews/plotting/bokeh/util.py
def filter_batched_data(data, mapping): """ Iterates over the data and mapping for a ColumnDataSource and replaces columns with repeating values with a scalar. This is purely and optimization for scalar types. """ for k, v in list(mapping.items()): if isinstance(v, dict) and 'field' in v...
def filter_batched_data(data, mapping): """ Iterates over the data and mapping for a ColumnDataSource and replaces columns with repeating values with a scalar. This is purely and optimization for scalar types. """ for k, v in list(mapping.items()): if isinstance(v, dict) and 'field' in v...
[ "Iterates", "over", "the", "data", "and", "mapping", "for", "a", "ColumnDataSource", "and", "replaces", "columns", "with", "repeating", "values", "with", "a", "scalar", ".", "This", "is", "purely", "and", "optimization", "for", "scalar", "types", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L579-L598
[ "def", "filter_batched_data", "(", "data", ",", "mapping", ")", ":", "for", "k", ",", "v", "in", "list", "(", "mapping", ".", "items", "(", ")", ")", ":", "if", "isinstance", "(", "v", ",", "dict", ")", "and", "'field'", "in", "v", ":", "if", "'t...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
cds_column_replace
Determine if the CDS.data requires a full replacement or simply needs to be updated. A replacement is required if untouched columns are not the same length as the columns being updated.
holoviews/plotting/bokeh/util.py
def cds_column_replace(source, data): """ Determine if the CDS.data requires a full replacement or simply needs to be updated. A replacement is required if untouched columns are not the same length as the columns being updated. """ current_length = [len(v) for v in source.data.values() if isinst...
def cds_column_replace(source, data): """ Determine if the CDS.data requires a full replacement or simply needs to be updated. A replacement is required if untouched columns are not the same length as the columns being updated. """ current_length = [len(v) for v in source.data.values() if isinst...
[ "Determine", "if", "the", "CDS", ".", "data", "requires", "a", "full", "replacement", "or", "simply", "needs", "to", "be", "updated", ".", "A", "replacement", "is", "required", "if", "untouched", "columns", "are", "not", "the", "same", "length", "as", "the...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L600-L609
[ "def", "cds_column_replace", "(", "source", ",", "data", ")", ":", "current_length", "=", "[", "len", "(", "v", ")", "for", "v", "in", "source", ".", "data", ".", "values", "(", ")", "if", "isinstance", "(", "v", ",", "(", "list", ",", "np", ".", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
hold_policy
Context manager to temporary override the hold policy.
holoviews/plotting/bokeh/util.py
def hold_policy(document, policy, server=False): """ Context manager to temporary override the hold policy. """ old_policy = document._hold document._hold = policy try: yield finally: if server and not old_policy: document.unhold() else: docume...
def hold_policy(document, policy, server=False): """ Context manager to temporary override the hold policy. """ old_policy = document._hold document._hold = policy try: yield finally: if server and not old_policy: document.unhold() else: docume...
[ "Context", "manager", "to", "temporary", "override", "the", "hold", "policy", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L613-L625
[ "def", "hold_policy", "(", "document", ",", "policy", ",", "server", "=", "False", ")", ":", "old_policy", "=", "document", ".", "_hold", "document", ".", "_hold", "=", "policy", "try", ":", "yield", "finally", ":", "if", "server", "and", "not", "old_pol...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
recursive_model_update
Recursively updates attributes on a model including other models. If the type of the new model matches the old model properties are simply updated, otherwise the model is replaced.
holoviews/plotting/bokeh/util.py
def recursive_model_update(model, props): """ Recursively updates attributes on a model including other models. If the type of the new model matches the old model properties are simply updated, otherwise the model is replaced. """ updates = {} valid_properties = model.properties_with_values(...
def recursive_model_update(model, props): """ Recursively updates attributes on a model including other models. If the type of the new model matches the old model properties are simply updated, otherwise the model is replaced. """ updates = {} valid_properties = model.properties_with_values(...
[ "Recursively", "updates", "attributes", "on", "a", "model", "including", "other", "models", ".", "If", "the", "type", "of", "the", "new", "model", "matches", "the", "old", "model", "properties", "are", "simply", "updated", "otherwise", "the", "model", "is", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L628-L646
[ "def", "recursive_model_update", "(", "model", ",", "props", ")", ":", "updates", "=", "{", "}", "valid_properties", "=", "model", ".", "properties_with_values", "(", ")", "for", "k", ",", "v", "in", "props", ".", "items", "(", ")", ":", "if", "isinstanc...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
update_shared_sources
Context manager to ensures data sources shared between multiple plots are cleared and updated appropriately avoiding warnings and allowing empty frames on subplots. Expects a list of shared_sources and a mapping of the columns expected columns for each source in the plots handles.
holoviews/plotting/bokeh/util.py
def update_shared_sources(f): """ Context manager to ensures data sources shared between multiple plots are cleared and updated appropriately avoiding warnings and allowing empty frames on subplots. Expects a list of shared_sources and a mapping of the columns expected columns for each source in...
def update_shared_sources(f): """ Context manager to ensures data sources shared between multiple plots are cleared and updated appropriately avoiding warnings and allowing empty frames on subplots. Expects a list of shared_sources and a mapping of the columns expected columns for each source in...
[ "Context", "manager", "to", "ensures", "data", "sources", "shared", "between", "multiple", "plots", "are", "cleared", "and", "updated", "appropriately", "avoiding", "warnings", "and", "allowing", "empty", "frames", "on", "subplots", ".", "Expects", "a", "list", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L649-L674
[ "def", "update_shared_sources", "(", "f", ")", ":", "def", "wrapper", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "source_cols", "=", "self", ".", "handles", ".", "get", "(", "'source_cols'", ",", "{", "}", ")", "shared_sources", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
categorize_array
Uses a Dimension instance to convert an array of values to categorical (i.e. string) values and applies escaping for colons, which bokeh treats as a categorical suffix.
holoviews/plotting/bokeh/util.py
def categorize_array(array, dim): """ Uses a Dimension instance to convert an array of values to categorical (i.e. string) values and applies escaping for colons, which bokeh treats as a categorical suffix. """ return np.array([dim.pprint_value(x) for x in array])
def categorize_array(array, dim): """ Uses a Dimension instance to convert an array of values to categorical (i.e. string) values and applies escaping for colons, which bokeh treats as a categorical suffix. """ return np.array([dim.pprint_value(x) for x in array])
[ "Uses", "a", "Dimension", "instance", "to", "convert", "an", "array", "of", "values", "to", "categorical", "(", "i", ".", "e", ".", "string", ")", "values", "and", "applies", "escaping", "for", "colons", "which", "bokeh", "treats", "as", "a", "categorical"...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L677-L683
[ "def", "categorize_array", "(", "array", ",", "dim", ")", ":", "return", "np", ".", "array", "(", "[", "dim", ".", "pprint_value", "(", "x", ")", "for", "x", "in", "array", "]", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
attach_periodic
Attaches plot refresh to all streams on the object.
holoviews/plotting/bokeh/util.py
def attach_periodic(plot): """ Attaches plot refresh to all streams on the object. """ def append_refresh(dmap): for dmap in get_nested_dmaps(dmap): dmap.periodic._periodic_util = periodic(plot.document) return plot.hmap.traverse(append_refresh, [DynamicMap])
def attach_periodic(plot): """ Attaches plot refresh to all streams on the object. """ def append_refresh(dmap): for dmap in get_nested_dmaps(dmap): dmap.periodic._periodic_util = periodic(plot.document) return plot.hmap.traverse(append_refresh, [DynamicMap])
[ "Attaches", "plot", "refresh", "to", "all", "streams", "on", "the", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L754-L761
[ "def", "attach_periodic", "(", "plot", ")", ":", "def", "append_refresh", "(", "dmap", ")", ":", "for", "dmap", "in", "get_nested_dmaps", "(", "dmap", ")", ":", "dmap", ".", "periodic", ".", "_periodic_util", "=", "periodic", "(", "plot", ".", "document", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
date_to_integer
Converts support date types to milliseconds since epoch Attempts highest precision conversion of different datetime formats to milliseconds since the epoch (1970-01-01 00:00:00). If datetime is a cftime with a non-standard calendar the caveats described in hv.core.util.cftime_to_timestamp apply. A...
holoviews/plotting/bokeh/util.py
def date_to_integer(date): """Converts support date types to milliseconds since epoch Attempts highest precision conversion of different datetime formats to milliseconds since the epoch (1970-01-01 00:00:00). If datetime is a cftime with a non-standard calendar the caveats described in hv.core.util...
def date_to_integer(date): """Converts support date types to milliseconds since epoch Attempts highest precision conversion of different datetime formats to milliseconds since the epoch (1970-01-01 00:00:00). If datetime is a cftime with a non-standard calendar the caveats described in hv.core.util...
[ "Converts", "support", "date", "types", "to", "milliseconds", "since", "epoch" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L764-L793
[ "def", "date_to_integer", "(", "date", ")", ":", "if", "pd", "and", "isinstance", "(", "date", ",", "pd", ".", "Timestamp", ")", ":", "try", ":", "date", "=", "date", ".", "to_datetime64", "(", ")", "except", ":", "date", "=", "date", ".", "to_dateti...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
glyph_order
Orders a set of glyph handles using regular sort and an explicit sort order. The explicit draw order must take the form of a list of glyph names while the keys should be glyph names with a custom suffix. The draw order may only match subset of the keys and any matched items will take precedence over oth...
holoviews/plotting/bokeh/util.py
def glyph_order(keys, draw_order=[]): """ Orders a set of glyph handles using regular sort and an explicit sort order. The explicit draw order must take the form of a list of glyph names while the keys should be glyph names with a custom suffix. The draw order may only match subset of the keys and a...
def glyph_order(keys, draw_order=[]): """ Orders a set of glyph handles using regular sort and an explicit sort order. The explicit draw order must take the form of a list of glyph names while the keys should be glyph names with a custom suffix. The draw order may only match subset of the keys and a...
[ "Orders", "a", "set", "of", "glyph", "handles", "using", "regular", "sort", "and", "an", "explicit", "sort", "order", ".", "The", "explicit", "draw", "order", "must", "take", "the", "form", "of", "a", "list", "of", "glyph", "names", "while", "the", "keys...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L796-L809
[ "def", "glyph_order", "(", "keys", ",", "draw_order", "=", "[", "]", ")", ":", "keys", "=", "sorted", "(", "keys", ")", "def", "order_fn", "(", "glyph", ")", ":", "matches", "=", "[", "item", "for", "item", "in", "draw_order", "if", "glyph", ".", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
colormesh
Generates line paths for a quadmesh given 2D arrays of X and Y coordinates.
holoviews/plotting/bokeh/util.py
def colormesh(X, Y): """ Generates line paths for a quadmesh given 2D arrays of X and Y coordinates. """ X1 = X[0:-1, 0:-1].ravel() Y1 = Y[0:-1, 0:-1].ravel() X2 = X[1:, 0:-1].ravel() Y2 = Y[1:, 0:-1].ravel() X3 = X[1:, 1:].ravel() Y3 = Y[1:, 1:].ravel() X4 = X[0:-1, 1:].rave...
def colormesh(X, Y): """ Generates line paths for a quadmesh given 2D arrays of X and Y coordinates. """ X1 = X[0:-1, 0:-1].ravel() Y1 = Y[0:-1, 0:-1].ravel() X2 = X[1:, 0:-1].ravel() Y2 = Y[1:, 0:-1].ravel() X3 = X[1:, 1:].ravel() Y3 = Y[1:, 1:].ravel() X4 = X[0:-1, 1:].rave...
[ "Generates", "line", "paths", "for", "a", "quadmesh", "given", "2D", "arrays", "of", "X", "and", "Y", "coordinates", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L812-L828
[ "def", "colormesh", "(", "X", ",", "Y", ")", ":", "X1", "=", "X", "[", "0", ":", "-", "1", ",", "0", ":", "-", "1", "]", ".", "ravel", "(", ")", "Y1", "=", "Y", "[", "0", ":", "-", "1", ",", "0", ":", "-", "1", "]", ".", "ravel", "(...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
multi_polygons_data
Expands polygon data which contains holes to a bokeh multi_polygons representation. Multi-polygons split by nans are expanded and the correct list of holes is assigned to each sub-polygon.
holoviews/plotting/bokeh/util.py
def multi_polygons_data(element): """ Expands polygon data which contains holes to a bokeh multi_polygons representation. Multi-polygons split by nans are expanded and the correct list of holes is assigned to each sub-polygon. """ paths = element.split(datatype='array', dimensions=element.kdims)...
def multi_polygons_data(element): """ Expands polygon data which contains holes to a bokeh multi_polygons representation. Multi-polygons split by nans are expanded and the correct list of holes is assigned to each sub-polygon. """ paths = element.split(datatype='array', dimensions=element.kdims)...
[ "Expands", "polygon", "data", "which", "contains", "holes", "to", "a", "bokeh", "multi_polygons", "representation", ".", "Multi", "-", "polygons", "split", "by", "nans", "are", "expanded", "and", "the", "correct", "list", "of", "holes", "is", "assigned", "to",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L840-L864
[ "def", "multi_polygons_data", "(", "element", ")", ":", "paths", "=", "element", ".", "split", "(", "datatype", "=", "'array'", ",", "dimensions", "=", "element", ".", "kdims", ")", "xs", ",", "ys", "=", "(", "[", "path", "[", ":", ",", "idx", "]", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
match_dim_specs
Matches dimension specs used to link axes. Axis dimension specs consists of a list of tuples corresponding to each dimension, each tuple spec has the form (name, label, unit). The name and label must match exactly while the unit only has to match if both specs define one.
holoviews/plotting/bokeh/util.py
def match_dim_specs(specs1, specs2): """Matches dimension specs used to link axes. Axis dimension specs consists of a list of tuples corresponding to each dimension, each tuple spec has the form (name, label, unit). The name and label must match exactly while the unit only has to match if both spec...
def match_dim_specs(specs1, specs2): """Matches dimension specs used to link axes. Axis dimension specs consists of a list of tuples corresponding to each dimension, each tuple spec has the form (name, label, unit). The name and label must match exactly while the unit only has to match if both spec...
[ "Matches", "dimension", "specs", "used", "to", "link", "axes", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/util.py#L867-L883
[ "def", "match_dim_specs", "(", "specs1", ",", "specs2", ")", ":", "if", "(", "specs1", "is", "None", "or", "specs2", "is", "None", ")", "or", "(", "len", "(", "specs1", ")", "!=", "len", "(", "specs2", ")", ")", ":", "return", "False", "for", "spec...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SideHistogramPlot._init_glyph
Returns a Bokeh glyph object.
holoviews/plotting/bokeh/chart.py
def _init_glyph(self, plot, mapping, properties): """ Returns a Bokeh glyph object. """ ret = super(SideHistogramPlot, self)._init_glyph(plot, mapping, properties) if not 'field' in mapping.get('fill_color', {}): return ret dim = mapping['fill_color']['field']...
def _init_glyph(self, plot, mapping, properties): """ Returns a Bokeh glyph object. """ ret = super(SideHistogramPlot, self)._init_glyph(plot, mapping, properties) if not 'field' in mapping.get('fill_color', {}): return ret dim = mapping['fill_color']['field']...
[ "Returns", "a", "Bokeh", "glyph", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/chart.py#L450-L477
[ "def", "_init_glyph", "(", "self", ",", "plot", ",", "mapping", ",", "properties", ")", ":", "ret", "=", "super", "(", "SideHistogramPlot", ",", "self", ")", ".", "_init_glyph", "(", "plot", ",", "mapping", ",", "properties", ")", "if", "not", "'field'",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ErrorPlot._init_glyph
Returns a Bokeh glyph object.
holoviews/plotting/bokeh/chart.py
def _init_glyph(self, plot, mapping, properties): """ Returns a Bokeh glyph object. """ properties.pop('legend', None) for prop in ['color', 'alpha']: if prop not in properties: continue pval = properties.pop(prop) line_prop = '...
def _init_glyph(self, plot, mapping, properties): """ Returns a Bokeh glyph object. """ properties.pop('legend', None) for prop in ['color', 'alpha']: if prop not in properties: continue pval = properties.pop(prop) line_prop = '...
[ "Returns", "a", "Bokeh", "glyph", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/chart.py#L514-L533
[ "def", "_init_glyph", "(", "self", ",", "plot", ",", "mapping", ",", "properties", ")", ":", "properties", ".", "pop", "(", "'legend'", ",", "None", ")", "for", "prop", "in", "[", "'color'", ",", "'alpha'", "]", ":", "if", "prop", "not", "in", "prope...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SpreadPlot._split_area
Splits area plots at nans and returns x- and y-coordinates for each area separated by nans.
holoviews/plotting/bokeh/chart.py
def _split_area(self, xs, lower, upper): """ Splits area plots at nans and returns x- and y-coordinates for each area separated by nans. """ xnan = np.array([np.datetime64('nat') if xs.dtype.kind == 'M' else np.nan]) ynan = np.array([np.datetime64('nat') if lower.dtype.ki...
def _split_area(self, xs, lower, upper): """ Splits area plots at nans and returns x- and y-coordinates for each area separated by nans. """ xnan = np.array([np.datetime64('nat') if xs.dtype.kind == 'M' else np.nan]) ynan = np.array([np.datetime64('nat') if lower.dtype.ki...
[ "Splits", "area", "plots", "at", "nans", "and", "returns", "x", "-", "and", "y", "-", "coordinates", "for", "each", "area", "separated", "by", "nans", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/chart.py#L546-L569
[ "def", "_split_area", "(", "self", ",", "xs", ",", "lower", ",", "upper", ")", ":", "xnan", "=", "np", ".", "array", "(", "[", "np", ".", "datetime64", "(", "'nat'", ")", "if", "xs", ".", "dtype", ".", "kind", "==", "'M'", "else", "np", ".", "n...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BarPlot.get_extents
Make adjustments to plot extents by computing stacked bar heights, adjusting the bar baseline and forcing the x-axis to be categorical.
holoviews/plotting/bokeh/chart.py
def get_extents(self, element, ranges, range_type='combined'): """ Make adjustments to plot extents by computing stacked bar heights, adjusting the bar baseline and forcing the x-axis to be categorical. """ if self.batched: overlay = self.current_frame ...
def get_extents(self, element, ranges, range_type='combined'): """ Make adjustments to plot extents by computing stacked bar heights, adjusting the bar baseline and forcing the x-axis to be categorical. """ if self.batched: overlay = self.current_frame ...
[ "Make", "adjustments", "to", "plot", "extents", "by", "computing", "stacked", "bar", "heights", "adjusting", "the", "bar", "baseline", "and", "forcing", "the", "x", "-", "axis", "to", "be", "categorical", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/chart.py#L762-L803
[ "def", "get_extents", "(", "self", ",", "element", ",", "ranges", ",", "range_type", "=", "'combined'", ")", ":", "if", "self", ".", "batched", ":", "overlay", "=", "self", ".", "current_frame", "element", "=", "Bars", "(", "overlay", ".", "table", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BarPlot._get_factors
Get factors for categorical axes.
holoviews/plotting/bokeh/chart.py
def _get_factors(self, element): """ Get factors for categorical axes. """ gdim = None sdim = None if element.ndims == 1: pass elif not (self.stacked or self.stack_index): gdim = element.get_dimension(1) else: sdim = ele...
def _get_factors(self, element): """ Get factors for categorical axes. """ gdim = None sdim = None if element.ndims == 1: pass elif not (self.stacked or self.stack_index): gdim = element.get_dimension(1) else: sdim = ele...
[ "Get", "factors", "for", "categorical", "axes", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/chart.py#L806-L830
[ "def", "_get_factors", "(", "self", ",", "element", ")", ":", "gdim", "=", "None", "sdim", "=", "None", "if", "element", ".", "ndims", "==", "1", ":", "pass", "elif", "not", "(", "self", ".", "stacked", "or", "self", ".", "stack_index", ")", ":", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
BarPlot.get_stack
Iterates over a x- and y-values in a stack layer and appropriately offsets the layer on top of the previous layer.
holoviews/plotting/bokeh/chart.py
def get_stack(self, xvals, yvals, baselines, sign='positive'): """ Iterates over a x- and y-values in a stack layer and appropriately offsets the layer on top of the previous layer. """ bottoms, tops = [], [] for x, y in zip(xvals, yvals): baseline = b...
def get_stack(self, xvals, yvals, baselines, sign='positive'): """ Iterates over a x- and y-values in a stack layer and appropriately offsets the layer on top of the previous layer. """ bottoms, tops = [], [] for x, y in zip(xvals, yvals): baseline = b...
[ "Iterates", "over", "a", "x", "-", "and", "y", "-", "values", "in", "a", "stack", "layer", "and", "appropriately", "offsets", "the", "layer", "on", "top", "of", "the", "previous", "layer", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/chart.py#L841-L861
[ "def", "get_stack", "(", "self", ",", "xvals", ",", "yvals", ",", "baselines", ",", "sign", "=", "'positive'", ")", ":", "bottoms", ",", "tops", "=", "[", "]", ",", "[", "]", "for", "x", ",", "y", "in", "zip", "(", "xvals", ",", "yvals", ")", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
param_aliases
Called from __setstate__ in LabelledData in order to load old pickles with outdated parameter names. Warning: We want to keep pickle hacking to a minimum!
holoviews/core/dimension.py
def param_aliases(d): """ Called from __setstate__ in LabelledData in order to load old pickles with outdated parameter names. Warning: We want to keep pickle hacking to a minimum! """ for old, new in ALIASES.items(): old_param = '_%s_param_value' % old new_param = '_%s_param_va...
def param_aliases(d): """ Called from __setstate__ in LabelledData in order to load old pickles with outdated parameter names. Warning: We want to keep pickle hacking to a minimum! """ for old, new in ALIASES.items(): old_param = '_%s_param_value' % old new_param = '_%s_param_va...
[ "Called", "from", "__setstate__", "in", "LabelledData", "in", "order", "to", "load", "old", "pickles", "with", "outdated", "parameter", "names", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L36-L48
[ "def", "param_aliases", "(", "d", ")", ":", "for", "old", ",", "new", "in", "ALIASES", ".", "items", "(", ")", ":", "old_param", "=", "'_%s_param_value'", "%", "old", "new_param", "=", "'_%s_param_value'", "%", "new", "if", "old_param", "in", "d", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
asdim
Convert the input to a Dimension. Args: dimension: tuple, dict or string type to convert to Dimension Returns: A Dimension object constructed from the dimension spec. No copy is performed if the input is already a Dimension.
holoviews/core/dimension.py
def asdim(dimension): """Convert the input to a Dimension. Args: dimension: tuple, dict or string type to convert to Dimension Returns: A Dimension object constructed from the dimension spec. No copy is performed if the input is already a Dimension. """ if isinstance(dimens...
def asdim(dimension): """Convert the input to a Dimension. Args: dimension: tuple, dict or string type to convert to Dimension Returns: A Dimension object constructed from the dimension spec. No copy is performed if the input is already a Dimension. """ if isinstance(dimens...
[ "Convert", "the", "input", "to", "a", "Dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L51-L68
[ "def", "asdim", "(", "dimension", ")", ":", "if", "isinstance", "(", "dimension", ",", "Dimension", ")", ":", "return", "dimension", "elif", "isinstance", "(", "dimension", ",", "(", "tuple", ",", "dict", ",", "basestring", ")", ")", ":", "return", "Dime...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dimension_name
Return the Dimension.name for a dimension-like object. Args: dimension: Dimension or dimension string, tuple or dict Returns: The name of the Dimension or what would be the name if the input as converted to a Dimension.
holoviews/core/dimension.py
def dimension_name(dimension): """Return the Dimension.name for a dimension-like object. Args: dimension: Dimension or dimension string, tuple or dict Returns: The name of the Dimension or what would be the name if the input as converted to a Dimension. """ if isinstance(di...
def dimension_name(dimension): """Return the Dimension.name for a dimension-like object. Args: dimension: Dimension or dimension string, tuple or dict Returns: The name of the Dimension or what would be the name if the input as converted to a Dimension. """ if isinstance(di...
[ "Return", "the", "Dimension", ".", "name", "for", "a", "dimension", "-", "like", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L70-L94
[ "def", "dimension_name", "(", "dimension", ")", ":", "if", "isinstance", "(", "dimension", ",", "Dimension", ")", ":", "return", "dimension", ".", "name", "elif", "isinstance", "(", "dimension", ",", "basestring", ")", ":", "return", "dimension", "elif", "is...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
process_dimensions
Converts kdims and vdims to Dimension objects. Args: kdims: List or single key dimension(s) specified as strings, tuples dicts or Dimension objects. vdims: List or single value dimension(s) specified as strings, tuples dicts or Dimension objects. Returns: Dictio...
holoviews/core/dimension.py
def process_dimensions(kdims, vdims): """Converts kdims and vdims to Dimension objects. Args: kdims: List or single key dimension(s) specified as strings, tuples dicts or Dimension objects. vdims: List or single value dimension(s) specified as strings, tuples dicts or Di...
def process_dimensions(kdims, vdims): """Converts kdims and vdims to Dimension objects. Args: kdims: List or single key dimension(s) specified as strings, tuples dicts or Dimension objects. vdims: List or single value dimension(s) specified as strings, tuples dicts or Di...
[ "Converts", "kdims", "and", "vdims", "to", "Dimension", "objects", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L97-L129
[ "def", "process_dimensions", "(", "kdims", ",", "vdims", ")", ":", "dimensions", "=", "{", "}", "for", "group", ",", "dims", "in", "[", "(", "'kdims'", ",", "kdims", ")", ",", "(", "'vdims'", ",", "vdims", ")", "]", ":", "if", "dims", "is", "None",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimension.clone
Clones the Dimension with new parameters Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides Args: spec (tuple, optional): Dimension tuple specification **overrides: Dimension parameter overrides Returns: ...
holoviews/core/dimension.py
def clone(self, spec=None, **overrides): """Clones the Dimension with new parameters Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides Args: spec (tuple, optional): Dimension tuple specification **overrides: Dim...
def clone(self, spec=None, **overrides): """Clones the Dimension with new parameters Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides Args: spec (tuple, optional): Dimension tuple specification **overrides: Dim...
[ "Clones", "the", "Dimension", "with", "new", "parameters" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L315-L341
[ "def", "clone", "(", "self", ",", "spec", "=", "None", ",", "*", "*", "overrides", ")", ":", "settings", "=", "dict", "(", "self", ".", "get_param_values", "(", ")", ",", "*", "*", "overrides", ")", "if", "spec", "is", "None", ":", "spec", "=", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimension.pprint_label
The pretty-printed label string for the Dimension
holoviews/core/dimension.py
def pprint_label(self): "The pretty-printed label string for the Dimension" unit = ('' if self.unit is None else type(self.unit)(self.unit_format).format(unit=self.unit)) return bytes_to_unicode(self.label) + bytes_to_unicode(unit)
def pprint_label(self): "The pretty-printed label string for the Dimension" unit = ('' if self.unit is None else type(self.unit)(self.unit_format).format(unit=self.unit)) return bytes_to_unicode(self.label) + bytes_to_unicode(unit)
[ "The", "pretty", "-", "printed", "label", "string", "for", "the", "Dimension" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L379-L383
[ "def", "pprint_label", "(", "self", ")", ":", "unit", "=", "(", "''", "if", "self", ".", "unit", "is", "None", "else", "type", "(", "self", ".", "unit", ")", "(", "self", ".", "unit_format", ")", ".", "format", "(", "unit", "=", "self", ".", "uni...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimension.pprint_value
Applies the applicable formatter to the value. Args: value: Dimension value to format Returns: Formatted dimension value
holoviews/core/dimension.py
def pprint_value(self, value): """Applies the applicable formatter to the value. Args: value: Dimension value to format Returns: Formatted dimension value """ own_type = type(value) if self.type is None else self.type formatter = (self.value_form...
def pprint_value(self, value): """Applies the applicable formatter to the value. Args: value: Dimension value to format Returns: Formatted dimension value """ own_type = type(value) if self.type is None else self.type formatter = (self.value_form...
[ "Applies", "the", "applicable", "formatter", "to", "the", "value", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L398-L422
[ "def", "pprint_value", "(", "self", ",", "value", ")", ":", "own_type", "=", "type", "(", "value", ")", "if", "self", ".", "type", "is", "None", "else", "self", ".", "type", "formatter", "=", "(", "self", ".", "value_format", "if", "self", ".", "valu...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimension.pprint_value_string
Pretty print the dimension value and unit. Args: value: Dimension value to format Returns: Formatted dimension value string with unit
holoviews/core/dimension.py
def pprint_value_string(self, value): """Pretty print the dimension value and unit. Args: value: Dimension value to format Returns: Formatted dimension value string with unit """ unit = '' if self.unit is None else ' ' + bytes_to_unicode(self.unit) ...
def pprint_value_string(self, value): """Pretty print the dimension value and unit. Args: value: Dimension value to format Returns: Formatted dimension value string with unit """ unit = '' if self.unit is None else ' ' + bytes_to_unicode(self.unit) ...
[ "Pretty", "print", "the", "dimension", "value", "and", "unit", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L424-L435
[ "def", "pprint_value_string", "(", "self", ",", "value", ")", ":", "unit", "=", "''", "if", "self", ".", "unit", "is", "None", "else", "' '", "+", "bytes_to_unicode", "(", "self", ".", "unit", ")", "value", "=", "self", ".", "pprint_value", "(", "value...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
LabelledData.id
Handles tracking and cleanup of custom ids.
holoviews/core/dimension.py
def id(self, opts_id): """Handles tracking and cleanup of custom ids.""" old_id = self._id self._id = opts_id if old_id is not None: cleanup_custom_options(old_id) if opts_id is not None and opts_id != old_id: if opts_id not in Store._weakrefs: ...
def id(self, opts_id): """Handles tracking and cleanup of custom ids.""" old_id = self._id self._id = opts_id if old_id is not None: cleanup_custom_options(old_id) if opts_id is not None and opts_id != old_id: if opts_id not in Store._weakrefs: ...
[ "Handles", "tracking", "and", "cleanup", "of", "custom", "ids", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L515-L525
[ "def", "id", "(", "self", ",", "opts_id", ")", ":", "old_id", "=", "self", ".", "_id", "self", ".", "_id", "=", "opts_id", "if", "old_id", "is", "not", "None", ":", "cleanup_custom_options", "(", "old_id", ")", "if", "opts_id", "is", "not", "None", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
LabelledData.clone
Clones the object, overriding data and parameters. Args: data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked ...
holoviews/core/dimension.py
def clone(self, data=None, shared_data=True, new_type=None, link=True, *args, **overrides): """Clones the object, overriding data and parameters. Args: data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data ...
def clone(self, data=None, shared_data=True, new_type=None, link=True, *args, **overrides): """Clones the object, overriding data and parameters. Args: data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data ...
[ "Clones", "the", "object", "overriding", "data", "and", "parameters", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L528-L566
[ "def", "clone", "(", "self", ",", "data", "=", "None", ",", "shared_data", "=", "True", ",", "new_type", "=", "None", ",", "link", "=", "True", ",", "*", "args", ",", "*", "*", "overrides", ")", ":", "params", "=", "dict", "(", "self", ".", "get_...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
LabelledData.relabel
Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to wh...
holoviews/core/dimension.py
def relabel(self, label=None, group=None, depth=0): """Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to...
def relabel(self, label=None, group=None, depth=0): """Clone object and apply new group and/or label. Applies relabeling to children up to the supplied depth. Args: label (str, optional): New label to apply to returned object group (str, optional): New group to apply to...
[ "Clone", "object", "and", "apply", "new", "group", "and", "/", "or", "label", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L569-L592
[ "def", "relabel", "(", "self", ",", "label", "=", "None", ",", "group", "=", "None", ",", "depth", "=", "0", ")", ":", "new_data", "=", "self", ".", "data", "if", "(", "depth", ">", "0", ")", "and", "getattr", "(", "self", ",", "'_deep_indexable'",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
LabelledData.matches
Whether the spec applies to this object. Args: spec: A function, spec or type to check for a match * A 'type[[.group].label]' string which is compared against the type, group and label of this object * A function which is given the object and return...
holoviews/core/dimension.py
def matches(self, spec): """Whether the spec applies to this object. Args: spec: A function, spec or type to check for a match * A 'type[[.group].label]' string which is compared against the type, group and label of this object * A function ...
def matches(self, spec): """Whether the spec applies to this object. Args: spec: A function, spec or type to check for a match * A 'type[[.group].label]' string which is compared against the type, group and label of this object * A function ...
[ "Whether", "the", "spec", "applies", "to", "this", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L595-L624
[ "def", "matches", "(", "self", ",", "spec", ")", ":", "if", "callable", "(", "spec", ")", "and", "not", "isinstance", "(", "spec", ",", "type", ")", ":", "return", "spec", "(", "self", ")", "elif", "isinstance", "(", "spec", ",", "type", ")", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
LabelledData.traverse
Traverses object returning matching items Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function. Args: fn (function, optional): Function applied to matched objects ...
holoviews/core/dimension.py
def traverse(self, fn=None, specs=None, full_breadth=True): """Traverses object returning matching items Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function. Args: ...
def traverse(self, fn=None, specs=None, full_breadth=True): """Traverses object returning matching items Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function. Args: ...
[ "Traverses", "object", "returning", "matching", "items" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L627-L667
[ "def", "traverse", "(", "self", ",", "fn", "=", "None", ",", "specs", "=", "None", ",", "full_breadth", "=", "True", ")", ":", "if", "fn", "is", "None", ":", "fn", "=", "lambda", "x", ":", "x", "if", "specs", "is", "not", "None", "and", "not", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
LabelledData.map
Map a function to all objects matching the specs Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects: dmap.map(fn, hv.Curve) Args: map_fn: Function...
holoviews/core/dimension.py
def map(self, map_fn, specs=None, clone=True): """Map a function to all objects matching the specs Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects: dmap.map...
def map(self, map_fn, specs=None, clone=True): """Map a function to all objects matching the specs Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects: dmap.map...
[ "Map", "a", "function", "to", "all", "objects", "matching", "the", "specs" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L670-L703
[ "def", "map", "(", "self", ",", "map_fn", ",", "specs", "=", "None", ",", "clone", "=", "True", ")", ":", "if", "specs", "is", "not", "None", "and", "not", "isinstance", "(", "specs", ",", "(", "list", ",", "set", ",", "tuple", ")", ")", ":", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned._valid_dimensions
Validates key dimension input Returns kdims if no dimensions are specified
holoviews/core/dimension.py
def _valid_dimensions(self, dimensions): """Validates key dimension input Returns kdims if no dimensions are specified""" if dimensions is None: dimensions = self.kdims elif not isinstance(dimensions, list): dimensions = [dimensions] valid_dimensions = [...
def _valid_dimensions(self, dimensions): """Validates key dimension input Returns kdims if no dimensions are specified""" if dimensions is None: dimensions = self.kdims elif not isinstance(dimensions, list): dimensions = [dimensions] valid_dimensions = [...
[ "Validates", "key", "dimension", "input" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L859-L874
[ "def", "_valid_dimensions", "(", "self", ",", "dimensions", ")", ":", "if", "dimensions", "is", "None", ":", "dimensions", "=", "self", ".", "kdims", "elif", "not", "isinstance", "(", "dimensions", ",", "list", ")", ":", "dimensions", "=", "[", "dimensions...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.dimensions
Lists the available dimensions on the object Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. 'key' or 'value' dimensions. By default 'all' dimensions are returned. Args: selection: Type of dimens...
holoviews/core/dimension.py
def dimensions(self, selection='all', label=False): """Lists the available dimensions on the object Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. 'key' or 'value' dimensions. By default 'all' dimensions are ...
def dimensions(self, selection='all', label=False): """Lists the available dimensions on the object Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. 'key' or 'value' dimensions. By default 'all' dimensions are ...
[ "Lists", "the", "available", "dimensions", "on", "the", "object" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L886-L932
[ "def", "dimensions", "(", "self", ",", "selection", "=", "'all'", ",", "label", "=", "False", ")", ":", "if", "label", "in", "[", "'name'", ",", "True", "]", ":", "label", "=", "'short'", "elif", "label", "==", "'label'", ":", "label", "=", "'long'",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.get_dimension
Get a Dimension object by name or index. Args: dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found Returns: Dimension object for the req...
holoviews/core/dimension.py
def get_dimension(self, dimension, default=None, strict=False): """Get a Dimension object by name or index. Args: dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyEr...
def get_dimension(self, dimension, default=None, strict=False): """Get a Dimension object by name or index. Args: dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyEr...
[ "Get", "a", "Dimension", "object", "by", "name", "or", "index", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L935-L965
[ "def", "get_dimension", "(", "self", ",", "dimension", ",", "default", "=", "None", ",", "strict", "=", "False", ")", ":", "if", "dimension", "is", "not", "None", "and", "not", "isinstance", "(", "dimension", ",", "(", "int", ",", "basestring", ",", "D...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.get_dimension_index
Get the index of the requested dimension. Args: dimension: Dimension to look up by name or by index Returns: Integer index of the requested dimension
holoviews/core/dimension.py
def get_dimension_index(self, dimension): """Get the index of the requested dimension. Args: dimension: Dimension to look up by name or by index Returns: Integer index of the requested dimension """ if isinstance(dimension, int): if (dimensio...
def get_dimension_index(self, dimension): """Get the index of the requested dimension. Args: dimension: Dimension to look up by name or by index Returns: Integer index of the requested dimension """ if isinstance(dimension, int): if (dimensio...
[ "Get", "the", "index", "of", "the", "requested", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L968-L989
[ "def", "get_dimension_index", "(", "self", ",", "dimension", ")", ":", "if", "isinstance", "(", "dimension", ",", "int", ")", ":", "if", "(", "dimension", "<", "(", "self", ".", "ndims", "+", "len", "(", "self", ".", "vdims", ")", ")", "or", "dimensi...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.get_dimension_type
Get the type of the requested dimension. Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None. Args: dimension: Dimension to look up by name or by index Returns: Declared type of values along the dimension
holoviews/core/dimension.py
def get_dimension_type(self, dim): """Get the type of the requested dimension. Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None. Args: dimension: Dimension to look up by name or by index Returns: Decl...
def get_dimension_type(self, dim): """Get the type of the requested dimension. Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None. Args: dimension: Dimension to look up by name or by index Returns: Decl...
[ "Get", "the", "type", "of", "the", "requested", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L992-L1011
[ "def", "get_dimension_type", "(", "self", ",", "dim", ")", ":", "dim_obj", "=", "self", ".", "get_dimension", "(", "dim", ")", "if", "dim_obj", "and", "dim_obj", ".", "type", "is", "not", "None", ":", "return", "dim_obj", ".", "type", "dim_vals", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.select
Applies selection by dimension name Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well. Selections ma...
holoviews/core/dimension.py
def select(self, selection_specs=None, **kwargs): """Applies selection by dimension name Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection wi...
def select(self, selection_specs=None, **kwargs): """Applies selection by dimension name Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection wi...
[ "Applies", "selection", "by", "dimension", "name" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1028-L1122
[ "def", "select", "(", "self", ",", "selection_specs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "selection_specs", "is", "not", "None", "and", "not", "isinstance", "(", "selection_specs", ",", "(", "list", ",", "tuple", ")", ")", ":", "sele...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.dimension_values
Return the values along the requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, behavior depends on the type of data: * Colum...
holoviews/core/dimension.py
def dimension_values(self, dimension, expanded=True, flat=True): """Return the values along the requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, beh...
def dimension_values(self, dimension, expanded=True, flat=True): """Return the values along the requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, beh...
[ "Return", "the", "values", "along", "the", "requested", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1125-L1146
[ "def", "dimension_values", "(", "self", ",", "dimension", ",", "expanded", "=", "True", ",", "flat", "=", "True", ")", ":", "val", "=", "self", ".", "_cached_constants", ".", "get", "(", "dimension", ",", "None", ")", "if", "val", ":", "return", "np", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.range
Return the lower and upper bounds of values along dimension. Args: dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges Whether to include Dimension range and soft...
holoviews/core/dimension.py
def range(self, dimension, data_range=True, dimension_range=True): """Return the lower and upper bounds of values along dimension. Args: dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Includ...
def range(self, dimension, data_range=True, dimension_range=True): """Return the lower and upper bounds of values along dimension. Args: dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Includ...
[ "Return", "the", "lower", "and", "upper", "bounds", "of", "values", "along", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1149-L1181
[ "def", "range", "(", "self", ",", "dimension", ",", "data_range", "=", "True", ",", "dimension_range", "=", "True", ")", ":", "dimension", "=", "self", ".", "get_dimension", "(", "dimension", ")", "if", "dimension", "is", "None", "or", "(", "not", "data_...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dimensioned.options
Applies simplified option definition returning a new object. Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.: obj....
holoviews/core/dimension.py
def options(self, *args, **kwargs): """Applies simplified option definition returning a new object. Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a sim...
def options(self, *args, **kwargs): """Applies simplified option definition returning a new object. Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a sim...
[ "Applies", "simplified", "option", "definition", "returning", "a", "new", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1206-L1284
[ "def", "options", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "backend", "=", "kwargs", ".", "get", "(", "'backend'", ",", "None", ")", "clone", "=", "kwargs", ".", "pop", "(", "'clone'", ",", "True", ")", "if", "len", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ViewableTree.from_values
Deprecated method to construct tree from list of objects
holoviews/core/dimension.py
def from_values(cls, vals): "Deprecated method to construct tree from list of objects" if util.config.future_deprecations: param.main.param.warning("%s.from_values is deprecated, the %s " "constructor may now be used directly.") return cls(items=c...
def from_values(cls, vals): "Deprecated method to construct tree from list of objects" if util.config.future_deprecations: param.main.param.warning("%s.from_values is deprecated, the %s " "constructor may now be used directly.") return cls(items=c...
[ "Deprecated", "method", "to", "construct", "tree", "from", "list", "of", "objects" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1336-L1341
[ "def", "from_values", "(", "cls", ",", "vals", ")", ":", "if", "util", ".", "config", ".", "future_deprecations", ":", "param", ".", "main", ".", "param", ".", "warning", "(", "\"%s.from_values is deprecated, the %s \"", "\"constructor may now be used directly.\"", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ViewableTree._process_items
Processes list of items assigning unique paths to each.
holoviews/core/dimension.py
def _process_items(cls, vals): "Processes list of items assigning unique paths to each." if type(vals) is cls: return vals.data elif not isinstance(vals, (list, tuple)): vals = [vals] items = [] counts = defaultdict(lambda: 1) cls._unpack_paths(val...
def _process_items(cls, vals): "Processes list of items assigning unique paths to each." if type(vals) is cls: return vals.data elif not isinstance(vals, (list, tuple)): vals = [vals] items = [] counts = defaultdict(lambda: 1) cls._unpack_paths(val...
[ "Processes", "list", "of", "items", "assigning", "unique", "paths", "to", "each", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1345-L1355
[ "def", "_process_items", "(", "cls", ",", "vals", ")", ":", "if", "type", "(", "vals", ")", "is", "cls", ":", "return", "vals", ".", "data", "elif", "not", "isinstance", "(", "vals", ",", "(", "list", ",", "tuple", ")", ")", ":", "vals", "=", "["...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ViewableTree._deduplicate_items
Deduplicates assigned paths by incrementing numbering
holoviews/core/dimension.py
def _deduplicate_items(cls, items): "Deduplicates assigned paths by incrementing numbering" counter = Counter([path[:i] for path, _ in items for i in range(1, len(path)+1)]) if sum(counter.values()) == len(counter): return items new_items = [] counts = defaultdict(la...
def _deduplicate_items(cls, items): "Deduplicates assigned paths by incrementing numbering" counter = Counter([path[:i] for path, _ in items for i in range(1, len(path)+1)]) if sum(counter.values()) == len(counter): return items new_items = [] counts = defaultdict(la...
[ "Deduplicates", "assigned", "paths", "by", "incrementing", "numbering" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1370-L1385
[ "def", "_deduplicate_items", "(", "cls", ",", "items", ")", ":", "counter", "=", "Counter", "(", "[", "path", "[", ":", "i", "]", "for", "path", ",", "_", "in", "items", "for", "i", "in", "range", "(", "1", ",", "len", "(", "path", ")", "+", "1...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ViewableTree._unpack_paths
Recursively unpacks lists and ViewableTree-like objects, accumulating into the supplied list of items.
holoviews/core/dimension.py
def _unpack_paths(cls, objs, items, counts): """ Recursively unpacks lists and ViewableTree-like objects, accumulating into the supplied list of items. """ if type(objs) is cls: objs = objs.items() for item in objs: path, obj = item if isinstance(i...
def _unpack_paths(cls, objs, items, counts): """ Recursively unpacks lists and ViewableTree-like objects, accumulating into the supplied list of items. """ if type(objs) is cls: objs = objs.items() for item in objs: path, obj = item if isinstance(i...
[ "Recursively", "unpacks", "lists", "and", "ViewableTree", "-", "like", "objects", "accumulating", "into", "the", "supplied", "list", "of", "items", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1389-L1404
[ "def", "_unpack_paths", "(", "cls", ",", "objs", ",", "items", ",", "counts", ")", ":", "if", "type", "(", "objs", ")", "is", "cls", ":", "objs", "=", "objs", ".", "items", "(", ")", "for", "item", "in", "objs", ":", "path", ",", "obj", "=", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ViewableTree.dimension_values
Return the values along the requested dimension. Concatenates values on all nodes with requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expand values Whether to return the expanded values, behavior de...
holoviews/core/dimension.py
def dimension_values(self, dimension, expanded=True, flat=True): """Return the values along the requested dimension. Concatenates values on all nodes with requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expa...
def dimension_values(self, dimension, expanded=True, flat=True): """Return the values along the requested dimension. Concatenates values on all nodes with requested dimension. Args: dimension: The dimension to return values for expanded (bool, optional): Whether to expa...
[ "Return", "the", "values", "along", "the", "requested", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1414-L1441
[ "def", "dimension_values", "(", "self", ",", "dimension", ",", "expanded", "=", "True", ",", "flat", "=", "True", ")", ":", "dimension", "=", "self", ".", "get_dimension", "(", "dimension", ",", "strict", "=", "True", ")", ".", "name", "all_dims", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ViewableTree.regroup
Deprecated method to apply new group to items. Equivalent functionality possible using: ViewableTree(tree.relabel(group='Group').values())
holoviews/core/dimension.py
def regroup(self, group): """Deprecated method to apply new group to items. Equivalent functionality possible using: ViewableTree(tree.relabel(group='Group').values()) """ if util.config.future_deprecations: self.param.warning('%s.regroup is deprecated, use rela...
def regroup(self, group): """Deprecated method to apply new group to items. Equivalent functionality possible using: ViewableTree(tree.relabel(group='Group').values()) """ if util.config.future_deprecations: self.param.warning('%s.regroup is deprecated, use rela...
[ "Deprecated", "method", "to", "apply", "new", "group", "to", "items", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/dimension.py#L1444-L1456
[ "def", "regroup", "(", "self", ",", "group", ")", ":", "if", "util", ".", "config", ".", "future_deprecations", ":", "self", ".", "param", ".", "warning", "(", "'%s.regroup is deprecated, use relabel '", "'method with a group argument instead.'", "%", "type", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._finalize_axis
Applies all the axis settings before the axis or figure is returned. Only plots with zorder 0 get to apply their settings. When the number of the frame is supplied as n, this method looks up and computes the appropriate title, axis labels and axis bounds.
holoviews/plotting/mpl/element.py
def _finalize_axis(self, key, element=None, title=None, dimensions=None, ranges=None, xticks=None, yticks=None, zticks=None, xlabel=None, ylabel=None, zlabel=None): """ Applies all the axis settings before the axis or figure is returned. Only plots with zorder 0 get to app...
def _finalize_axis(self, key, element=None, title=None, dimensions=None, ranges=None, xticks=None, yticks=None, zticks=None, xlabel=None, ylabel=None, zlabel=None): """ Applies all the axis settings before the axis or figure is returned. Only plots with zorder 0 get to app...
[ "Applies", "all", "the", "axis", "settings", "before", "the", "axis", "or", "figure", "is", "returned", ".", "Only", "plots", "with", "zorder", "0", "get", "to", "apply", "their", "settings", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L108-L193
[ "def", "_finalize_axis", "(", "self", ",", "key", ",", "element", "=", "None", ",", "title", "=", "None", ",", "dimensions", "=", "None", ",", "ranges", "=", "None", ",", "xticks", "=", "None", ",", "yticks", "=", "None", ",", "zticks", "=", "None", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._finalize_ticks
Finalizes the ticks on the axes based on the supplied ticks and Elements. Sets the axes position as well as tick positions, labels and fontsize.
holoviews/plotting/mpl/element.py
def _finalize_ticks(self, axis, dimensions, xticks, yticks, zticks): """ Finalizes the ticks on the axes based on the supplied ticks and Elements. Sets the axes position as well as tick positions, labels and fontsize. """ ndims = len(dimensions) if dimensions else 0 ...
def _finalize_ticks(self, axis, dimensions, xticks, yticks, zticks): """ Finalizes the ticks on the axes based on the supplied ticks and Elements. Sets the axes position as well as tick positions, labels and fontsize. """ ndims = len(dimensions) if dimensions else 0 ...
[ "Finalizes", "the", "ticks", "on", "the", "axes", "based", "on", "the", "supplied", "ticks", "and", "Elements", ".", "Sets", "the", "axes", "position", "as", "well", "as", "tick", "positions", "labels", "and", "fontsize", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L196-L238
[ "def", "_finalize_ticks", "(", "self", ",", "axis", ",", "dimensions", ",", "xticks", ",", "yticks", ",", "zticks", ")", ":", "ndims", "=", "len", "(", "dimensions", ")", "if", "dimensions", "else", "0", "xdim", "=", "dimensions", "[", "0", "]", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._set_labels
Sets the labels of the axes using the supplied list of dimensions. Optionally explicit labels may be supplied to override the dimension label.
holoviews/plotting/mpl/element.py
def _set_labels(self, axes, dimensions, xlabel=None, ylabel=None, zlabel=None): """ Sets the labels of the axes using the supplied list of dimensions. Optionally explicit labels may be supplied to override the dimension label. """ xlabel, ylabel, zlabel = self._get_axis_l...
def _set_labels(self, axes, dimensions, xlabel=None, ylabel=None, zlabel=None): """ Sets the labels of the axes using the supplied list of dimensions. Optionally explicit labels may be supplied to override the dimension label. """ xlabel, ylabel, zlabel = self._get_axis_l...
[ "Sets", "the", "labels", "of", "the", "axes", "using", "the", "supplied", "list", "of", "dimensions", ".", "Optionally", "explicit", "labels", "may", "be", "supplied", "to", "override", "the", "dimension", "label", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L249-L263
[ "def", "_set_labels", "(", "self", ",", "axes", ",", "dimensions", ",", "xlabel", "=", "None", ",", "ylabel", "=", "None", ",", "zlabel", "=", "None", ")", ":", "xlabel", ",", "ylabel", ",", "zlabel", "=", "self", ".", "_get_axis_labels", "(", "dimensi...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._set_axis_formatter
Set axis formatter based on dimension formatter.
holoviews/plotting/mpl/element.py
def _set_axis_formatter(self, axis, dim, formatter): """ Set axis formatter based on dimension formatter. """ if isinstance(dim, list): dim = dim[0] if formatter is not None: pass elif dim.value_format: formatter = dim.value_format elif dim...
def _set_axis_formatter(self, axis, dim, formatter): """ Set axis formatter based on dimension formatter. """ if isinstance(dim, list): dim = dim[0] if formatter is not None: pass elif dim.value_format: formatter = dim.value_format elif dim...
[ "Set", "axis", "formatter", "based", "on", "dimension", "formatter", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L266-L278
[ "def", "_set_axis_formatter", "(", "self", ",", "axis", ",", "dim", ",", "formatter", ")", ":", "if", "isinstance", "(", "dim", ",", "list", ")", ":", "dim", "=", "dim", "[", "0", "]", "if", "formatter", "is", "not", "None", ":", "pass", "elif", "d...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot.get_aspect
Computes the aspect ratio of the plot
holoviews/plotting/mpl/element.py
def get_aspect(self, xspan, yspan): """ Computes the aspect ratio of the plot """ if isinstance(self.aspect, (int, float)): return self.aspect elif self.aspect == 'square': return 1 elif self.aspect == 'equal': return xspan/yspan ...
def get_aspect(self, xspan, yspan): """ Computes the aspect ratio of the plot """ if isinstance(self.aspect, (int, float)): return self.aspect elif self.aspect == 'square': return 1 elif self.aspect == 'equal': return xspan/yspan ...
[ "Computes", "the", "aspect", "ratio", "of", "the", "plot" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L281-L291
[ "def", "get_aspect", "(", "self", ",", "xspan", ",", "yspan", ")", ":", "if", "isinstance", "(", "self", ".", "aspect", ",", "(", "int", ",", "float", ")", ")", ":", "return", "self", ".", "aspect", "elif", "self", ".", "aspect", "==", "'square'", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._set_aspect
Set the aspect on the axes based on the aspect setting.
holoviews/plotting/mpl/element.py
def _set_aspect(self, axes, aspect): """ Set the aspect on the axes based on the aspect setting. """ if ((isinstance(aspect, util.basestring) and aspect != 'square') or self.data_aspect): data_ratio = self.data_aspect or aspect else: (x0, x1), ...
def _set_aspect(self, axes, aspect): """ Set the aspect on the axes based on the aspect setting. """ if ((isinstance(aspect, util.basestring) and aspect != 'square') or self.data_aspect): data_ratio = self.data_aspect or aspect else: (x0, x1), ...
[ "Set", "the", "aspect", "on", "the", "axes", "based", "on", "the", "aspect", "setting", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L294-L310
[ "def", "_set_aspect", "(", "self", ",", "axes", ",", "aspect", ")", ":", "if", "(", "(", "isinstance", "(", "aspect", ",", "util", ".", "basestring", ")", "and", "aspect", "!=", "'square'", ")", "or", "self", ".", "data_aspect", ")", ":", "data_ratio",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._set_axis_limits
Compute extents for current view and apply as axis limits
holoviews/plotting/mpl/element.py
def _set_axis_limits(self, axis, view, subplots, ranges): """ Compute extents for current view and apply as axis limits """ # Extents extents = self.get_extents(view, ranges) if not extents or self.overlaid: axis.autoscale_view(scalex=True, scaley=True) ...
def _set_axis_limits(self, axis, view, subplots, ranges): """ Compute extents for current view and apply as axis limits """ # Extents extents = self.get_extents(view, ranges) if not extents or self.overlaid: axis.autoscale_view(scalex=True, scaley=True) ...
[ "Compute", "extents", "for", "current", "view", "and", "apply", "as", "axis", "limits" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L313-L350
[ "def", "_set_axis_limits", "(", "self", ",", "axis", ",", "view", ",", "subplots", ",", "ranges", ")", ":", "# Extents", "extents", "=", "self", ".", "get_extents", "(", "view", ",", "ranges", ")", "if", "not", "extents", "or", "self", ".", "overlaid", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._set_axis_position
Set the position and visibility of the xaxis or yaxis by supplying the axes object, the axis to set, i.e. 'x' or 'y' and an option to specify the position and visibility of the axis. The option may be None, 'bare' or positional, i.e. 'left' and 'right' for the yaxis and 'top' and 'bottom...
holoviews/plotting/mpl/element.py
def _set_axis_position(self, axes, axis, option): """ Set the position and visibility of the xaxis or yaxis by supplying the axes object, the axis to set, i.e. 'x' or 'y' and an option to specify the position and visibility of the axis. The option may be None, 'bare' or positiona...
def _set_axis_position(self, axes, axis, option): """ Set the position and visibility of the xaxis or yaxis by supplying the axes object, the axis to set, i.e. 'x' or 'y' and an option to specify the position and visibility of the axis. The option may be None, 'bare' or positiona...
[ "Set", "the", "position", "and", "visibility", "of", "the", "xaxis", "or", "yaxis", "by", "supplying", "the", "axes", "object", "the", "axis", "to", "set", "i", ".", "e", ".", "x", "or", "y", "and", "an", "option", "to", "specify", "the", "position", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L375-L403
[ "def", "_set_axis_position", "(", "self", ",", "axes", ",", "axis", ",", "option", ")", ":", "positions", "=", "{", "'x'", ":", "[", "'bottom'", ",", "'top'", "]", ",", "'y'", ":", "[", "'left'", ",", "'right'", "]", "}", "[", "axis", "]", "axis", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot._set_axis_ticks
Allows setting the ticks for a particular axis either with a tuple of ticks, a tick locator object, an integer number of ticks, a list of tuples containing positions and labels or a list of positions. Also supports enabling log ticking if an integer number of ticks is supplied and settin...
holoviews/plotting/mpl/element.py
def _set_axis_ticks(self, axis, ticks, log=False, rotation=0): """ Allows setting the ticks for a particular axis either with a tuple of ticks, a tick locator object, an integer number of ticks, a list of tuples containing positions and labels or a list of positions. Also support...
def _set_axis_ticks(self, axis, ticks, log=False, rotation=0): """ Allows setting the ticks for a particular axis either with a tuple of ticks, a tick locator object, an integer number of ticks, a list of tuples containing positions and labels or a list of positions. Also support...
[ "Allows", "setting", "the", "ticks", "for", "a", "particular", "axis", "either", "with", "a", "tuple", "of", "ticks", "a", "tick", "locator", "object", "an", "integer", "number", "of", "ticks", "a", "list", "of", "tuples", "containing", "positions", "and", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L406-L437
[ "def", "_set_axis_ticks", "(", "self", ",", "axis", ",", "ticks", ",", "log", "=", "False", ",", "rotation", "=", "0", ")", ":", "if", "isinstance", "(", "ticks", ",", "(", "list", ",", "tuple", ")", ")", "and", "all", "(", "isinstance", "(", "l", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot.update_frame
Set the plot(s) to the given frame number. Operates by manipulating the matplotlib objects held in the self._handles dictionary. If n is greater than the number of available frames, update using the last available frame.
holoviews/plotting/mpl/element.py
def update_frame(self, key, ranges=None, element=None): """ Set the plot(s) to the given frame number. Operates by manipulating the matplotlib objects held in the self._handles dictionary. If n is greater than the number of available frames, update using the last availa...
def update_frame(self, key, ranges=None, element=None): """ Set the plot(s) to the given frame number. Operates by manipulating the matplotlib objects held in the self._handles dictionary. If n is greater than the number of available frames, update using the last availa...
[ "Set", "the", "plot", "(", "s", ")", "to", "the", "given", "frame", "number", ".", "Operates", "by", "manipulating", "the", "matplotlib", "objects", "held", "in", "the", "self", ".", "_handles", "dictionary", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L441-L484
[ "def", "update_frame", "(", "self", ",", "key", ",", "ranges", "=", "None", ",", "element", "=", "None", ")", ":", "reused", "=", "isinstance", "(", "self", ".", "hmap", ",", "DynamicMap", ")", "and", "self", ".", "overlaid", "if", "not", "reused", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot.init_artists
Initializes the artist based on the plot method declared on the plot.
holoviews/plotting/mpl/element.py
def init_artists(self, ax, plot_args, plot_kwargs): """ Initializes the artist based on the plot method declared on the plot. """ plot_method = self._plot_methods.get('batched' if self.batched else 'single') plot_fn = getattr(ax, plot_method) artist = plot_fn(*plo...
def init_artists(self, ax, plot_args, plot_kwargs): """ Initializes the artist based on the plot method declared on the plot. """ plot_method = self._plot_methods.get('batched' if self.batched else 'single') plot_fn = getattr(ax, plot_method) artist = plot_fn(*plo...
[ "Initializes", "the", "artist", "based", "on", "the", "plot", "method", "declared", "on", "the", "plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L515-L524
[ "def", "init_artists", "(", "self", ",", "ax", ",", "plot_args", ",", "plot_kwargs", ")", ":", "plot_method", "=", "self", ".", "_plot_methods", ".", "get", "(", "'batched'", "if", "self", ".", "batched", "else", "'single'", ")", "plot_fn", "=", "getattr",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ElementPlot.update_handles
Update the elements of the plot.
holoviews/plotting/mpl/element.py
def update_handles(self, key, axis, element, ranges, style): """ Update the elements of the plot. """ self.teardown_handles() plot_data, plot_kwargs, axis_kwargs = self.get_data(element, ranges, style) with abbreviated_exception(): handles = self.init_artists...
def update_handles(self, key, axis, element, ranges, style): """ Update the elements of the plot. """ self.teardown_handles() plot_data, plot_kwargs, axis_kwargs = self.get_data(element, ranges, style) with abbreviated_exception(): handles = self.init_artists...
[ "Update", "the", "elements", "of", "the", "plot", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L527-L537
[ "def", "update_handles", "(", "self", ",", "key", ",", "axis", ",", "element", ",", "ranges", ",", "style", ")", ":", "self", ".", "teardown_handles", "(", ")", "plot_data", ",", "plot_kwargs", ",", "axis_kwargs", "=", "self", ".", "get_data", "(", "elem...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ColorbarPlot._norm_kwargs
Returns valid color normalization kwargs to be passed to matplotlib plot function.
holoviews/plotting/mpl/element.py
def _norm_kwargs(self, element, ranges, opts, vdim, values=None, prefix=''): """ Returns valid color normalization kwargs to be passed to matplotlib plot function. """ dim_name = dim_range_key(vdim) if values is None: if isinstance(vdim, dim): ...
def _norm_kwargs(self, element, ranges, opts, vdim, values=None, prefix=''): """ Returns valid color normalization kwargs to be passed to matplotlib plot function. """ dim_name = dim_range_key(vdim) if values is None: if isinstance(vdim, dim): ...
[ "Returns", "valid", "color", "normalization", "kwargs", "to", "be", "passed", "to", "matplotlib", "plot", "function", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L785-L921
[ "def", "_norm_kwargs", "(", "self", ",", "element", ",", "ranges", ",", "opts", ",", "vdim", ",", "values", "=", "None", ",", "prefix", "=", "''", ")", ":", "dim_name", "=", "dim_range_key", "(", "vdim", ")", "if", "values", "is", "None", ":", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OverlayPlot._adjust_legend
Accumulate the legend handles and labels for all subplots and set up the legend
holoviews/plotting/mpl/element.py
def _adjust_legend(self, overlay, axis): """ Accumulate the legend handles and labels for all subplots and set up the legend """ legend_data = [] dimensions = overlay.kdims title = ', '.join([d.name for d in dimensions]) for key, subplot in self.subplots.i...
def _adjust_legend(self, overlay, axis): """ Accumulate the legend handles and labels for all subplots and set up the legend """ legend_data = [] dimensions = overlay.kdims title = ', '.join([d.name for d in dimensions]) for key, subplot in self.subplots.i...
[ "Accumulate", "the", "legend", "handles", "and", "labels", "for", "all", "subplots", "and", "set", "up", "the", "legend" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/element.py#L989-L1043
[ "def", "_adjust_legend", "(", "self", ",", "overlay", ",", "axis", ")", ":", "legend_data", "=", "[", "]", "dimensions", "=", "overlay", ".", "kdims", "title", "=", "', '", ".", "join", "(", "[", "d", ".", "name", "for", "d", "in", "dimensions", "]",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Operation.search
Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}. The input may be a Layout, an Overlay type or a single Element.
holoviews/core/operation.py
def search(cls, element, pattern): """ Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}. The input may be a Layout, an Overlay type or a single Element. """ if isinstance(element, Layout): ...
def search(cls, element, pattern): """ Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}. The input may be a Layout, an Overlay type or a single Element. """ if isinstance(element, Layout): ...
[ "Helper", "method", "that", "returns", "a", "list", "of", "elements", "that", "match", "the", "given", "path", "pattern", "of", "form", "{", "type", "}", ".", "{", "group", "}", ".", "{", "label", "}", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/operation.py#L73-L86
[ "def", "search", "(", "cls", ",", "element", ",", "pattern", ")", ":", "if", "isinstance", "(", "element", ",", "Layout", ")", ":", "return", "[", "el", "for", "cell", "in", "element", "for", "el", "in", "cls", ".", "search", "(", "cell", ",", "pat...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Operation.get_overlay_label
Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.
holoviews/core/operation.py
def get_overlay_label(cls, overlay, default_label=''): """ Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label. """ if all(el.label==overlay.get(0).label for el in overlay): return overlay.get(0).label ...
def get_overlay_label(cls, overlay, default_label=''): """ Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label. """ if all(el.label==overlay.get(0).label for el in overlay): return overlay.get(0).label ...
[ "Returns", "a", "label", "if", "all", "the", "elements", "of", "an", "overlay", "agree", "on", "a", "consistent", "label", "otherwise", "returns", "the", "default", "label", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/operation.py#L90-L98
[ "def", "get_overlay_label", "(", "cls", ",", "overlay", ",", "default_label", "=", "''", ")", ":", "if", "all", "(", "el", ".", "label", "==", "overlay", ".", "get", "(", "0", ")", ".", "label", "for", "el", "in", "overlay", ")", ":", "return", "ov...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Operation.get_overlay_bounds
Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.
holoviews/core/operation.py
def get_overlay_bounds(cls, overlay): """ Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception. """ if all(el.bounds==overlay.get(0).bounds for el in overlay): return overlay.get(0).bounds else: ...
def get_overlay_bounds(cls, overlay): """ Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception. """ if all(el.bounds==overlay.get(0).bounds for el in overlay): return overlay.get(0).bounds else: ...
[ "Returns", "the", "extents", "if", "all", "the", "elements", "of", "an", "overlay", "agree", "on", "a", "consistent", "extents", "otherwise", "raises", "an", "exception", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/operation.py#L102-L110
[ "def", "get_overlay_bounds", "(", "cls", ",", "overlay", ")", ":", "if", "all", "(", "el", ".", "bounds", "==", "overlay", ".", "get", "(", "0", ")", ".", "bounds", "for", "el", "in", "overlay", ")", ":", "return", "overlay", ".", "get", "(", "0", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Operation._apply
Applies the operation to the element, executing any pre- and post-processor hooks if defined.
holoviews/core/operation.py
def _apply(self, element, key=None): """ Applies the operation to the element, executing any pre- and post-processor hooks if defined. """ kwargs = {} for hook in self._preprocess_hooks: kwargs.update(hook(self, element)) ret = self._process(element, k...
def _apply(self, element, key=None): """ Applies the operation to the element, executing any pre- and post-processor hooks if defined. """ kwargs = {} for hook in self._preprocess_hooks: kwargs.update(hook(self, element)) ret = self._process(element, k...
[ "Applies", "the", "operation", "to", "the", "element", "executing", "any", "pre", "-", "and", "post", "-", "processor", "hooks", "if", "defined", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/operation.py#L113-L124
[ "def", "_apply", "(", "self", ",", "element", ",", "key", "=", "None", ")", ":", "kwargs", "=", "{", "}", "for", "hook", "in", "self", ".", "_preprocess_hooks", ":", "kwargs", ".", "update", "(", "hook", "(", "self", ",", "element", ")", ")", "ret"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Operation.process_element
The process_element method allows a single element to be operated on given an externally supplied key.
holoviews/core/operation.py
def process_element(self, element, key, **params): """ The process_element method allows a single element to be operated on given an externally supplied key. """ self.p = param.ParamOverrides(self, params) return self._apply(element, key)
def process_element(self, element, key, **params): """ The process_element method allows a single element to be operated on given an externally supplied key. """ self.p = param.ParamOverrides(self, params) return self._apply(element, key)
[ "The", "process_element", "method", "allows", "a", "single", "element", "to", "be", "operated", "on", "given", "an", "externally", "supplied", "key", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/operation.py#L137-L143
[ "def", "process_element", "(", "self", ",", "element", ",", "key", ",", "*", "*", "params", ")", ":", "self", ".", "p", "=", "param", ".", "ParamOverrides", "(", "self", ",", "params", ")", "return", "self", ".", "_apply", "(", "element", ",", "key",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
uniform
Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned.
holoviews/core/traversal.py
def uniform(obj): """ Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned. """ from .spaces import HoloMap dim_groups = obj.traverse(lambda x: tuple(x.kdims), (HoloMap,))...
def uniform(obj): """ Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned. """ from .spaces import HoloMap dim_groups = obj.traverse(lambda x: tuple(x.kdims), (HoloMap,))...
[ "Finds", "all", "common", "dimension", "keys", "in", "the", "object", "including", "subsets", "of", "dimensions", ".", "If", "there", "are", "is", "no", "common", "subset", "of", "dimensions", "None", "is", "returned", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/traversal.py#L25-L37
[ "def", "uniform", "(", "obj", ")", ":", "from", ".", "spaces", "import", "HoloMap", "dim_groups", "=", "obj", ".", "traverse", "(", "lambda", "x", ":", "tuple", "(", "x", ".", "kdims", ")", ",", "(", "HoloMap", ",", ")", ")", "if", "dim_groups", ":...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
unique_dimkeys
Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned. Returns the list of dimensions followed by the list of unique keys.
holoviews/core/traversal.py
def unique_dimkeys(obj, default_dim='Frame'): """ Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned. Returns the list of dimensions followed by the list of unique keys. """ from .ndmapping impo...
def unique_dimkeys(obj, default_dim='Frame'): """ Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned. Returns the list of dimensions followed by the list of unique keys. """ from .ndmapping impo...
[ "Finds", "all", "common", "dimension", "keys", "in", "the", "object", "including", "subsets", "of", "dimensions", ".", "If", "there", "are", "is", "no", "common", "subset", "of", "dimensions", "None", "is", "returned", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/traversal.py#L40-L95
[ "def", "unique_dimkeys", "(", "obj", ",", "default_dim", "=", "'Frame'", ")", ":", "from", ".", "ndmapping", "import", "NdMapping", ",", "item_check", "from", ".", "spaces", "import", "HoloMap", "key_dims", "=", "obj", ".", "traverse", "(", "lambda", "x", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
hierarchical
Iterates over dimension values in keys, taking two sets of dimension values at a time to determine whether two consecutive dimensions have a one-to-many relationship. If they do a mapping between the first and second dimension values is returned. Returns a list of n-1 mappings, between consecutive d...
holoviews/core/traversal.py
def hierarchical(keys): """ Iterates over dimension values in keys, taking two sets of dimension values at a time to determine whether two consecutive dimensions have a one-to-many relationship. If they do a mapping between the first and second dimension values is returned. Returns a list of n-1...
def hierarchical(keys): """ Iterates over dimension values in keys, taking two sets of dimension values at a time to determine whether two consecutive dimensions have a one-to-many relationship. If they do a mapping between the first and second dimension values is returned. Returns a list of n-1...
[ "Iterates", "over", "dimension", "values", "in", "keys", "taking", "two", "sets", "of", "dimension", "values", "at", "a", "time", "to", "determine", "whether", "two", "consecutive", "dimensions", "have", "a", "one", "-", "to", "-", "many", "relationship", "....
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/traversal.py#L113-L143
[ "def", "hierarchical", "(", "keys", ")", ":", "ndims", "=", "len", "(", "keys", "[", "0", "]", ")", "if", "ndims", "<=", "1", ":", "return", "True", "dim_vals", "=", "list", "(", "zip", "(", "*", "keys", ")", ")", "combinations", "=", "(", "zip",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridInterface._infer_interval_breaks
>>> GridInterface._infer_interval_breaks(np.arange(5)) array([-0.5, 0.5, 1.5, 2.5, 3.5, 4.5]) >>> GridInterface._infer_interval_breaks([[0, 1], [3, 4]], axis=1) array([[-0.5, 0.5, 1.5], [ 2.5, 3.5, 4.5]])
holoviews/core/data/grid.py
def _infer_interval_breaks(cls, coord, axis=0): """ >>> GridInterface._infer_interval_breaks(np.arange(5)) array([-0.5, 0.5, 1.5, 2.5, 3.5, 4.5]) >>> GridInterface._infer_interval_breaks([[0, 1], [3, 4]], axis=1) array([[-0.5, 0.5, 1.5], [ 2.5, 3.5, 4.5]])...
def _infer_interval_breaks(cls, coord, axis=0): """ >>> GridInterface._infer_interval_breaks(np.arange(5)) array([-0.5, 0.5, 1.5, 2.5, 3.5, 4.5]) >>> GridInterface._infer_interval_breaks([[0, 1], [3, 4]], axis=1) array([[-0.5, 0.5, 1.5], [ 2.5, 3.5, 4.5]])...
[ ">>>", "GridInterface", ".", "_infer_interval_breaks", "(", "np", ".", "arange", "(", "5", "))", "array", "(", "[", "-", "0", ".", "5", "0", ".", "5", "1", ".", "5", "2", ".", "5", "3", ".", "5", "4", ".", "5", "]", ")", ">>>", "GridInterface",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/grid.py#L184-L203
[ "def", "_infer_interval_breaks", "(", "cls", ",", "coord", ",", "axis", "=", "0", ")", ":", "coord", "=", "np", ".", "asarray", "(", "coord", ")", "if", "sys", ".", "version_info", ".", "major", "==", "2", "and", "len", "(", "coord", ")", "and", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridInterface.coords
Returns the coordinates along a dimension. Ordered ensures coordinates are in ascending order and expanded creates ND-array matching the dimensionality of the dataset.
holoviews/core/data/grid.py
def coords(cls, dataset, dim, ordered=False, expanded=False, edges=False): """ Returns the coordinates along a dimension. Ordered ensures coordinates are in ascending order and expanded creates ND-array matching the dimensionality of the dataset. """ dim = dataset.get_di...
def coords(cls, dataset, dim, ordered=False, expanded=False, edges=False): """ Returns the coordinates along a dimension. Ordered ensures coordinates are in ascending order and expanded creates ND-array matching the dimensionality of the dataset. """ dim = dataset.get_di...
[ "Returns", "the", "coordinates", "along", "a", "dimension", ".", "Ordered", "ensures", "coordinates", "are", "in", "ascending", "order", "and", "expanded", "creates", "ND", "-", "array", "matching", "the", "dimensionality", "of", "the", "dataset", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/grid.py#L207-L239
[ "def", "coords", "(", "cls", ",", "dataset", ",", "dim", ",", "ordered", "=", "False", ",", "expanded", "=", "False", ",", "edges", "=", "False", ")", ":", "dim", "=", "dataset", ".", "get_dimension", "(", "dim", ",", "strict", "=", "True", ")", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridInterface.canonicalize
Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In certain cases the dimensions defined via the kdims of an Element may not match the dimensions of the underlying data. A set of data_coords may b...
holoviews/core/data/grid.py
def canonicalize(cls, dataset, data, data_coords=None, virtual_coords=[]): """ Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In certain cases the dimensions defined via the kdims of an ...
def canonicalize(cls, dataset, data, data_coords=None, virtual_coords=[]): """ Canonicalize takes an array of values as input and reorients and transposes it to match the canonical format expected by plotting functions. In certain cases the dimensions defined via the kdims of an ...
[ "Canonicalize", "takes", "an", "array", "of", "values", "as", "input", "and", "reorients", "and", "transposes", "it", "to", "match", "the", "canonical", "format", "expected", "by", "plotting", "functions", ".", "In", "certain", "cases", "the", "dimensions", "d...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/grid.py#L243-L290
[ "def", "canonicalize", "(", "cls", ",", "dataset", ",", "data", ",", "data_coords", "=", "None", ",", "virtual_coords", "=", "[", "]", ")", ":", "if", "data_coords", "is", "None", ":", "data_coords", "=", "dataset", ".", "dimensions", "(", "'key'", ",", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GridInterface.sample
Samples the gridded data into dataset of samples.
holoviews/core/data/grid.py
def sample(cls, dataset, samples=[]): """ Samples the gridded data into dataset of samples. """ ndims = dataset.ndims dimensions = dataset.dimensions(label='name') arrays = [dataset.data[vdim.name] for vdim in dataset.vdims] data = defaultdict(list) for s...
def sample(cls, dataset, samples=[]): """ Samples the gridded data into dataset of samples. """ ndims = dataset.ndims dimensions = dataset.dimensions(label='name') arrays = [dataset.data[vdim.name] for vdim in dataset.vdims] data = defaultdict(list) for s...
[ "Samples", "the", "gridded", "data", "into", "dataset", "of", "samples", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/grid.py#L539-L570
[ "def", "sample", "(", "cls", ",", "dataset", ",", "samples", "=", "[", "]", ")", ":", "ndims", "=", "dataset", ".", "ndims", "dimensions", "=", "dataset", ".", "dimensions", "(", "label", "=", "'name'", ")", "arrays", "=", "[", "dataset", ".", "data"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GraphPlot._update_datasource
Update datasource with data for a new frame.
holoviews/plotting/bokeh/graphs.py
def _update_datasource(self, source, data): """ Update datasource with data for a new frame. """ if isinstance(source, ColumnDataSource): if self.handles['static_source']: source.trigger('data', source.data, data) else: source.data....
def _update_datasource(self, source, data): """ Update datasource with data for a new frame. """ if isinstance(source, ColumnDataSource): if self.handles['static_source']: source.trigger('data', source.data, data) else: source.data....
[ "Update", "datasource", "with", "data", "for", "a", "new", "frame", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/graphs.py#L249-L259
[ "def", "_update_datasource", "(", "self", ",", "source", ",", "data", ")", ":", "if", "isinstance", "(", "source", ",", "ColumnDataSource", ")", ":", "if", "self", ".", "handles", "[", "'static_source'", "]", ":", "source", ".", "trigger", "(", "'data'", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GraphPlot._init_filled_edges
Replace edge renderer with filled renderer
holoviews/plotting/bokeh/graphs.py
def _init_filled_edges(self, renderer, properties, edge_mapping): "Replace edge renderer with filled renderer" glyph_model = Patches if self.filled else Bezier allowed_properties = glyph_model.properties() for glyph_type in ('', 'selection_', 'nonselection_', 'hover_', 'muted_'): ...
def _init_filled_edges(self, renderer, properties, edge_mapping): "Replace edge renderer with filled renderer" glyph_model = Patches if self.filled else Bezier allowed_properties = glyph_model.properties() for glyph_type in ('', 'selection_', 'nonselection_', 'hover_', 'muted_'): ...
[ "Replace", "edge", "renderer", "with", "filled", "renderer" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/graphs.py#L261-L273
[ "def", "_init_filled_edges", "(", "self", ",", "renderer", ",", "properties", ",", "edge_mapping", ")", ":", "glyph_model", "=", "Patches", "if", "self", ".", "filled", "else", "Bezier", "allowed_properties", "=", "glyph_model", ".", "properties", "(", ")", "f...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GraphPlot._get_graph_properties
Computes the args and kwargs for the GraphRenderer
holoviews/plotting/bokeh/graphs.py
def _get_graph_properties(self, plot, element, data, mapping, ranges, style): "Computes the args and kwargs for the GraphRenderer" sources = [] properties, mappings = {}, {} for key in ('scatter_1', self.edge_glyph): gdata = data.pop(key, {}) group_style = dict(s...
def _get_graph_properties(self, plot, element, data, mapping, ranges, style): "Computes the args and kwargs for the GraphRenderer" sources = [] properties, mappings = {}, {} for key in ('scatter_1', self.edge_glyph): gdata = data.pop(key, {}) group_style = dict(s...
[ "Computes", "the", "args", "and", "kwargs", "for", "the", "GraphRenderer" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/graphs.py#L276-L311
[ "def", "_get_graph_properties", "(", "self", ",", "plot", ",", "element", ",", "data", ",", "mapping", ",", "ranges", ",", "style", ")", ":", "sources", "=", "[", "]", "properties", ",", "mappings", "=", "{", "}", ",", "{", "}", "for", "key", "in", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
GraphPlot._reorder_renderers
Reorders renderers based on the defined draw order
holoviews/plotting/bokeh/graphs.py
def _reorder_renderers(self, plot, renderer, mapping): "Reorders renderers based on the defined draw order" renderers = dict({r: self.handles[r+'_glyph_renderer'] for r in mapping}, graph=renderer) other = [r for r in plot.renderers if r not in renderers.values()] ...
def _reorder_renderers(self, plot, renderer, mapping): "Reorders renderers based on the defined draw order" renderers = dict({r: self.handles[r+'_glyph_renderer'] for r in mapping}, graph=renderer) other = [r for r in plot.renderers if r not in renderers.values()] ...
[ "Reorders", "renderers", "based", "on", "the", "defined", "draw", "order" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/graphs.py#L313-L319
[ "def", "_reorder_renderers", "(", "self", ",", "plot", ",", "renderer", ",", "mapping", ")", ":", "renderers", "=", "dict", "(", "{", "r", ":", "self", ".", "handles", "[", "r", "+", "'_glyph_renderer'", "]", "for", "r", "in", "mapping", "}", ",", "g...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ChordPlot.get_extents
A Chord plot is always drawn on a unit circle.
holoviews/plotting/bokeh/graphs.py
def get_extents(self, element, ranges, range_type='combined'): """ A Chord plot is always drawn on a unit circle. """ xdim, ydim = element.nodes.kdims[:2] if range_type not in ('combined', 'data', 'extents'): return xdim.range[0], ydim.range[0], xdim.range[1], ydim.ra...
def get_extents(self, element, ranges, range_type='combined'): """ A Chord plot is always drawn on a unit circle. """ xdim, ydim = element.nodes.kdims[:2] if range_type not in ('combined', 'data', 'extents'): return xdim.range[0], ydim.range[0], xdim.range[1], ydim.ra...
[ "A", "Chord", "plot", "is", "always", "drawn", "on", "a", "unit", "circle", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/graphs.py#L394-L406
[ "def", "get_extents", "(", "self", ",", "element", ",", "ranges", ",", "range_type", "=", "'combined'", ")", ":", "xdim", ",", "ydim", "=", "element", ".", "nodes", ".", "kdims", "[", ":", "2", "]", "if", "range_type", "not", "in", "(", "'combined'", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
sanitizer
String sanitizer to avoid problematic characters in filenames.
holoviews/core/io.py
def sanitizer(name, replacements=[(':','_'), ('/','_'), ('\\','_')]): """ String sanitizer to avoid problematic characters in filenames. """ for old,new in replacements: name = name.replace(old,new) return name
def sanitizer(name, replacements=[(':','_'), ('/','_'), ('\\','_')]): """ String sanitizer to avoid problematic characters in filenames. """ for old,new in replacements: name = name.replace(old,new) return name
[ "String", "sanitizer", "to", "avoid", "problematic", "characters", "in", "filenames", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L34-L40
[ "def", "sanitizer", "(", "name", ",", "replacements", "=", "[", "(", "':'", ",", "'_'", ")", ",", "(", "'/'", ",", "'_'", ")", ",", "(", "'\\\\'", ",", "'_'", ")", "]", ")", ":", "for", "old", ",", "new", "in", "replacements", ":", "name", "=",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655