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
simple_name_generator
Simple name_generator designed for HoloViews objects. Objects are labeled with {group}-{label} for each nested object, based on a depth-first search. Adjacent objects with identical representations yield only a single copy of the representation, to avoid long names for the common case of a contain...
holoviews/core/io.py
def simple_name_generator(obj): """ Simple name_generator designed for HoloViews objects. Objects are labeled with {group}-{label} for each nested object, based on a depth-first search. Adjacent objects with identical representations yield only a single copy of the representation, to avoid lon...
def simple_name_generator(obj): """ Simple name_generator designed for HoloViews objects. Objects are labeled with {group}-{label} for each nested object, based on a depth-first search. Adjacent objects with identical representations yield only a single copy of the representation, to avoid lon...
[ "Simple", "name_generator", "designed", "for", "HoloViews", "objects", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L499-L517
[ "def", "simple_name_generator", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "LabelledData", ")", ":", "labels", "=", "obj", ".", "traverse", "(", "lambda", "x", ":", "(", "x", ".", "group", "+", "(", "'-'", "+", "x", ".", "label", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Exporter.encode
Classmethod that applies conditional encoding based on mime-type. Given an entry as returned by __call__ return the data in the appropriate encoding.
holoviews/core/io.py
def encode(cls, entry): """ Classmethod that applies conditional encoding based on mime-type. Given an entry as returned by __call__ return the data in the appropriate encoding. """ (data, info) = entry if info['mime_type'] in cls.utf8_mime_types: retu...
def encode(cls, entry): """ Classmethod that applies conditional encoding based on mime-type. Given an entry as returned by __call__ return the data in the appropriate encoding. """ (data, info) = entry if info['mime_type'] in cls.utf8_mime_types: retu...
[ "Classmethod", "that", "applies", "conditional", "encoding", "based", "on", "mime", "-", "type", ".", "Given", "an", "entry", "as", "returned", "by", "__call__", "return", "the", "data", "in", "the", "appropriate", "encoding", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L111-L121
[ "def", "encode", "(", "cls", ",", "entry", ")", ":", "(", "data", ",", "info", ")", "=", "entry", "if", "info", "[", "'mime_type'", "]", "in", "cls", ".", "utf8_mime_types", ":", "return", "data", ".", "encode", "(", "'utf-8'", ")", "else", ":", "r...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Exporter._filename
Add the file extension if not already present
holoviews/core/io.py
def _filename(self_or_cls, filename): "Add the file extension if not already present" if not filename.endswith(self_or_cls.file_ext): return '%s.%s' % (filename, self_or_cls.file_ext) else: return filename
def _filename(self_or_cls, filename): "Add the file extension if not already present" if not filename.endswith(self_or_cls.file_ext): return '%s.%s' % (filename, self_or_cls.file_ext) else: return filename
[ "Add", "the", "file", "extension", "if", "not", "already", "present" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L124-L129
[ "def", "_filename", "(", "self_or_cls", ",", "filename", ")", ":", "if", "not", "filename", ".", "endswith", "(", "self_or_cls", ".", "file_ext", ")", ":", "return", "'%s.%s'", "%", "(", "filename", ",", "self_or_cls", ".", "file_ext", ")", "else", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Exporter._merge_metadata
Returns a merged metadata info dictionary from the supplied function and additional dictionaries
holoviews/core/io.py
def _merge_metadata(self_or_cls, obj, fn, *dicts): """ Returns a merged metadata info dictionary from the supplied function and additional dictionaries """ merged = dict([(k,v) for d in dicts for (k,v) in d.items()]) return dict(merged, **fn(obj)) if fn else merged
def _merge_metadata(self_or_cls, obj, fn, *dicts): """ Returns a merged metadata info dictionary from the supplied function and additional dictionaries """ merged = dict([(k,v) for d in dicts for (k,v) in d.items()]) return dict(merged, **fn(obj)) if fn else merged
[ "Returns", "a", "merged", "metadata", "info", "dictionary", "from", "the", "supplied", "function", "and", "additional", "dictionaries" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L132-L138
[ "def", "_merge_metadata", "(", "self_or_cls", ",", "obj", ",", "fn", ",", "*", "dicts", ")", ":", "merged", "=", "dict", "(", "[", "(", "k", ",", "v", ")", "for", "d", "in", "dicts", "for", "(", "k", ",", "v", ")", "in", "d", ".", "items", "(...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Unpickler.collect
Given a list or NdMapping type containing file paths return a Layout of Collators, which can be called to load a given set of files using the current Importer. If supplied as a list each file is expected to disambiguate itself with contained metadata. If an NdMapping type is sup...
holoviews/core/io.py
def collect(self_or_cls, files, drop=[], metadata=True): """ Given a list or NdMapping type containing file paths return a Layout of Collators, which can be called to load a given set of files using the current Importer. If supplied as a list each file is expected to disambiguat...
def collect(self_or_cls, files, drop=[], metadata=True): """ Given a list or NdMapping type containing file paths return a Layout of Collators, which can be called to load a given set of files using the current Importer. If supplied as a list each file is expected to disambiguat...
[ "Given", "a", "list", "or", "NdMapping", "type", "containing", "file", "paths", "return", "a", "Layout", "of", "Collators", "which", "can", "be", "called", "to", "load", "a", "given", "set", "of", "files", "using", "the", "current", "Importer", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L417-L466
[ "def", "collect", "(", "self_or_cls", ",", "files", ",", "drop", "=", "[", "]", ",", "metadata", "=", "True", ")", ":", "aslist", "=", "not", "isinstance", "(", "files", ",", "(", "NdMapping", ",", "Element", ")", ")", "if", "isinstance", "(", "files...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
FileArchive.parse_fields
Returns the format fields otherwise raise exception
holoviews/core/io.py
def parse_fields(cls, formatter): "Returns the format fields otherwise raise exception" if formatter is None: return [] try: parse = list(string.Formatter().parse(formatter)) return set(f for f in list(zip(*parse))[1] if f is not None) except: raise S...
def parse_fields(cls, formatter): "Returns the format fields otherwise raise exception" if formatter is None: return [] try: parse = list(string.Formatter().parse(formatter)) return set(f for f in list(zip(*parse))[1] if f is not None) except: raise S...
[ "Returns", "the", "format", "fields", "otherwise", "raise", "exception" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L605-L612
[ "def", "parse_fields", "(", "cls", ",", "formatter", ")", ":", "if", "formatter", "is", "None", ":", "return", "[", "]", "try", ":", "parse", "=", "list", "(", "string", ".", "Formatter", "(", ")", ".", "parse", "(", "formatter", ")", ")", "return", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
FileArchive.add
If a filename is supplied, it will be used. Otherwise, a filename will be generated from the supplied object. Note that if the explicit filename uses the {timestamp} field, it will be formatted upon export. The data to be archived is either supplied explicitly as 'data' or autom...
holoviews/core/io.py
def add(self, obj=None, filename=None, data=None, info={}, **kwargs): """ If a filename is supplied, it will be used. Otherwise, a filename will be generated from the supplied object. Note that if the explicit filename uses the {timestamp} field, it will be formatted upon export....
def add(self, obj=None, filename=None, data=None, info={}, **kwargs): """ If a filename is supplied, it will be used. Otherwise, a filename will be generated from the supplied object. Note that if the explicit filename uses the {timestamp} field, it will be formatted upon export....
[ "If", "a", "filename", "is", "supplied", "it", "will", "be", "used", ".", "Otherwise", "a", "filename", "will", "be", "generated", "from", "the", "supplied", "object", ".", "Note", "that", "if", "the", "explicit", "filename", "uses", "the", "{", "timestamp...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L652-L688
[ "def", "add", "(", "self", ",", "obj", "=", "None", ",", "filename", "=", "None", ",", "data", "=", "None", ",", "info", "=", "{", "}", ",", "*", "*", "kwargs", ")", ":", "if", "[", "filename", ",", "obj", "]", "==", "[", "None", ",", "None",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
FileArchive._unique_name
Find a unique basename for a new file/key where existing is either a list of (basename, ext) pairs or an absolute path to a directory. By default, uniqueness is enforced depending on the state of the unique_name parameter (for export names). If force is True, this parameter is i...
holoviews/core/io.py
def _unique_name(self, basename, ext, existing, force=False): """ Find a unique basename for a new file/key where existing is either a list of (basename, ext) pairs or an absolute path to a directory. By default, uniqueness is enforced depending on the state of the uniqu...
def _unique_name(self, basename, ext, existing, force=False): """ Find a unique basename for a new file/key where existing is either a list of (basename, ext) pairs or an absolute path to a directory. By default, uniqueness is enforced depending on the state of the uniqu...
[ "Find", "a", "unique", "basename", "for", "a", "new", "file", "/", "key", "where", "existing", "is", "either", "a", "list", "of", "(", "basename", "ext", ")", "pairs", "or", "an", "absolute", "path", "to", "a", "directory", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L762-L783
[ "def", "_unique_name", "(", "self", ",", "basename", ",", "ext", ",", "existing", ",", "force", "=", "False", ")", ":", "skip", "=", "False", "if", "force", "else", "(", "not", "self", ".", "unique_name", ")", "if", "skip", ":", "return", "(", "basen...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
FileArchive.export
Export the archive, directory or file.
holoviews/core/io.py
def export(self, timestamp=None, info={}): """ Export the archive, directory or file. """ tval = tuple(time.localtime()) if timestamp is None else timestamp tstamp = time.strftime(self.timestamp_format, tval) info = dict(info, timestamp=tstamp) export_name = self...
def export(self, timestamp=None, info={}): """ Export the archive, directory or file. """ tval = tuple(time.localtime()) if timestamp is None else timestamp tstamp = time.strftime(self.timestamp_format, tval) info = dict(info, timestamp=tstamp) export_name = self...
[ "Export", "the", "archive", "directory", "or", "file", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L804-L826
[ "def", "export", "(", "self", ",", "timestamp", "=", "None", ",", "info", "=", "{", "}", ")", ":", "tval", "=", "tuple", "(", "time", ".", "localtime", "(", ")", ")", "if", "timestamp", "is", "None", "else", "timestamp", "tstamp", "=", "time", ".",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
FileArchive.contents
Print the current (unexported) contents of the archive
holoviews/core/io.py
def contents(self, maxlen=70): "Print the current (unexported) contents of the archive" lines = [] if len(self._files) == 0: print("Empty %s" % self.__class__.__name__) return fnames = [self._truncate_name(maxlen=maxlen, *k) for k in self._files] max_len ...
def contents(self, maxlen=70): "Print the current (unexported) contents of the archive" lines = [] if len(self._files) == 0: print("Empty %s" % self.__class__.__name__) return fnames = [self._truncate_name(maxlen=maxlen, *k) for k in self._files] max_len ...
[ "Print", "the", "current", "(", "unexported", ")", "contents", "of", "the", "archive" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L840-L852
[ "def", "contents", "(", "self", ",", "maxlen", "=", "70", ")", ":", "lines", "=", "[", "]", "if", "len", "(", "self", ".", "_files", ")", "==", "0", ":", "print", "(", "\"Empty %s\"", "%", "self", ".", "__class__", ".", "__name__", ")", "return", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
FileArchive.listing
Return a list of filename entries currently in the archive
holoviews/core/io.py
def listing(self): "Return a list of filename entries currently in the archive" return ['.'.join([f,ext]) if ext else f for (f,ext) in self._files.keys()]
def listing(self): "Return a list of filename entries currently in the archive" return ['.'.join([f,ext]) if ext else f for (f,ext) in self._files.keys()]
[ "Return", "a", "list", "of", "filename", "entries", "currently", "in", "the", "archive" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/io.py#L854-L856
[ "def", "listing", "(", "self", ")", ":", "return", "[", "'.'", ".", "join", "(", "[", "f", ",", "ext", "]", ")", "if", "ext", "else", "f", "for", "(", "f", ",", "ext", ")", "in", "self", ".", "_files", ".", "keys", "(", ")", "]" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
progress
A helper utility to display a progress bar when iterating over a collection of a fixed length or a generator (with a declared length). If enum=True, then equivalent to enumerate with a progress bar.
holoviews/ipython/widgets.py
def progress(iterator, enum=False, length=None): """ A helper utility to display a progress bar when iterating over a collection of a fixed length or a generator (with a declared length). If enum=True, then equivalent to enumerate with a progress bar. """ progress = ProgressBar() length...
def progress(iterator, enum=False, length=None): """ A helper utility to display a progress bar when iterating over a collection of a fixed length or a generator (with a declared length). If enum=True, then equivalent to enumerate with a progress bar. """ progress = ProgressBar() length...
[ "A", "helper", "utility", "to", "display", "a", "progress", "bar", "when", "iterating", "over", "a", "collection", "of", "a", "fixed", "length", "or", "a", "generator", "(", "with", "a", "declared", "length", ")", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/widgets.py#L209-L226
[ "def", "progress", "(", "iterator", ",", "enum", "=", "False", ",", "length", "=", "None", ")", ":", "progress", "=", "ProgressBar", "(", ")", "length", "=", "len", "(", "iterator", ")", "if", "length", "is", "None", "else", "length", "gen", "=", "en...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PlotlyWidget._plot_figure
Returns the figure in html format on the first call and
holoviews/plotting/plotly/widgets.py
def _plot_figure(self, idx, fig_format='json'): """ Returns the figure in html format on the first call and """ self.plot.update(idx) if self.embed: return self.renderer.diff(self.plot)
def _plot_figure(self, idx, fig_format='json'): """ Returns the figure in html format on the first call and """ self.plot.update(idx) if self.embed: return self.renderer.diff(self.plot)
[ "Returns", "the", "figure", "in", "html", "format", "on", "the", "first", "call", "and" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/plotly/widgets.py#L24-L31
[ "def", "_plot_figure", "(", "self", ",", "idx", ",", "fig_format", "=", "'json'", ")", ":", "self", ".", "plot", ".", "update", "(", "idx", ")", "if", "self", ".", "embed", ":", "return", "self", ".", "renderer", ".", "diff", "(", "self", ".", "plo...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.__equalize_densities
Calculate the true density along x, and adjust the top and bottom bounds so that the density along y will be equal. Returns (adjusted_bounds, true_density)
holoviews/core/sheetcoords.py
def __equalize_densities(self,nominal_bounds,nominal_density): """ Calculate the true density along x, and adjust the top and bottom bounds so that the density along y will be equal. Returns (adjusted_bounds, true_density) """ left,bottom,right,top = nominal_bounds.lbrt(...
def __equalize_densities(self,nominal_bounds,nominal_density): """ Calculate the true density along x, and adjust the top and bottom bounds so that the density along y will be equal. Returns (adjusted_bounds, true_density) """ left,bottom,right,top = nominal_bounds.lbrt(...
[ "Calculate", "the", "true", "density", "along", "x", "and", "adjust", "the", "top", "and", "bottom", "bounds", "so", "that", "the", "density", "along", "y", "will", "be", "equal", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L180-L199
[ "def", "__equalize_densities", "(", "self", ",", "nominal_bounds", ",", "nominal_density", ")", ":", "left", ",", "bottom", ",", "right", ",", "top", "=", "nominal_bounds", ".", "lbrt", "(", ")", "width", "=", "right", "-", "left", "height", "=", "top", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.sheet2matrix
Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates. Returns (float_row,float_col), where float_row corresponds to y, and float_col to x. Valid for scalar or array x and y. Note about Bounds For a Sheet with BoundingBox(points=((-0.5,-0.5),(0.5,...
holoviews/core/sheetcoords.py
def sheet2matrix(self,x,y): """ Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates. Returns (float_row,float_col), where float_row corresponds to y, and float_col to x. Valid for scalar or array x and y. Note about Bounds For a Sheet wi...
def sheet2matrix(self,x,y): """ Convert a point (x,y) in Sheet coordinates to continuous matrix coordinates. Returns (float_row,float_col), where float_row corresponds to y, and float_col to x. Valid for scalar or array x and y. Note about Bounds For a Sheet wi...
[ "Convert", "a", "point", "(", "x", "y", ")", "in", "Sheet", "coordinates", "to", "continuous", "matrix", "coordinates", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L202-L242
[ "def", "sheet2matrix", "(", "self", ",", "x", ",", "y", ")", ":", "# First translate to (left,top), which is [0,0] in the matrix,", "# then scale to the size of the matrix. The y coordinate needs", "# to be flipped, because the points are moving down in the", "# sheet as the y index increa...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.sheet2matrixidx
Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column). Note that if coordinates along the right or bottom boundary are passed into this function, the returned matrix ...
holoviews/core/sheetcoords.py
def sheet2matrixidx(self,x,y): """ Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column). Note that if coordinates along the right or bottom boundary ...
def sheet2matrixidx(self,x,y): """ Convert a point (x,y) in sheet coordinates to the integer row and column index of the matrix cell in which that point falls, given a bounds and density. Returns (row,column). Note that if coordinates along the right or bottom boundary ...
[ "Convert", "a", "point", "(", "x", "y", ")", "in", "sheet", "coordinates", "to", "the", "integer", "row", "and", "column", "index", "of", "the", "matrix", "cell", "in", "which", "that", "point", "falls", "given", "a", "bounds", "and", "density", ".", "...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L245-L265
[ "def", "sheet2matrixidx", "(", "self", ",", "x", ",", "y", ")", ":", "r", ",", "c", "=", "self", ".", "sheet2matrix", "(", "x", ",", "y", ")", "r", "=", "np", ".", "floor", "(", "r", ")", "c", "=", "np", ".", "floor", "(", "c", ")", "if", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.matrix2sheet
Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates. Valid for scalar or array float_row and float_col. Inverse of sheet2matrix().
holoviews/core/sheetcoords.py
def matrix2sheet(self,float_row,float_col): """ Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates. Valid for scalar or array float_row and float_col. Inverse of sheet2matrix(). ...
def matrix2sheet(self,float_row,float_col): """ Convert a floating-point location (float_row,float_col) in matrix coordinates to its corresponding location (x,y) in sheet coordinates. Valid for scalar or array float_row and float_col. Inverse of sheet2matrix(). ...
[ "Convert", "a", "floating", "-", "point", "location", "(", "float_row", "float_col", ")", "in", "matrix", "coordinates", "to", "its", "corresponding", "location", "(", "x", "y", ")", "in", "sheet", "coordinates", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L268-L286
[ "def", "matrix2sheet", "(", "self", ",", "float_row", ",", "float_col", ")", ":", "xoffset", "=", "float_col", "*", "self", ".", "__xstep", "if", "isinstance", "(", "self", ".", "lbrt", "[", "0", "]", ",", "datetime_types", ")", ":", "xoffset", "=", "n...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.matrixidx2sheet
Return (x,y) where x and y are the floating point coordinates of the *center* of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1. NOTE: This is NOT the strict mathematical inverse of sheet2mat...
holoviews/core/sheetcoords.py
def matrixidx2sheet(self,row,col): """ Return (x,y) where x and y are the floating point coordinates of the *center* of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1. NOTE: This is N...
def matrixidx2sheet(self,row,col): """ Return (x,y) where x and y are the floating point coordinates of the *center* of the given matrix cell (row,col). If the matrix cell represents a 0.2 by 0.2 region, then the center location returned would be 0.1,0.1. NOTE: This is N...
[ "Return", "(", "x", "y", ")", "where", "x", "and", "y", "are", "the", "floating", "point", "coordinates", "of", "the", "*", "center", "*", "of", "the", "given", "matrix", "cell", "(", "row", "col", ")", ".", "If", "the", "matrix", "cell", "represents...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L289-L309
[ "def", "matrixidx2sheet", "(", "self", ",", "row", ",", "col", ")", ":", "x", ",", "y", "=", "self", ".", "matrix2sheet", "(", "(", "row", "+", "0.5", ")", ",", "(", "col", "+", "0.5", ")", ")", "# Rounding allows easier comparison with user specified valu...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.closest_cell_center
Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.
holoviews/core/sheetcoords.py
def closest_cell_center(self,x,y): """ Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit. """ return self.matrixidx2sheet(*self.sheet2matrixidx(x,y))
def closest_cell_center(self,x,y): """ Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit. """ return self.matrixidx2sheet(*self.sheet2matrixidx(x,y))
[ "Given", "arbitrary", "sheet", "coordinates", "return", "the", "sheet", "coordinates", "of", "the", "center", "of", "the", "closest", "unit", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L312-L317
[ "def", "closest_cell_center", "(", "self", ",", "x", ",", "y", ")", ":", "return", "self", ".", "matrixidx2sheet", "(", "*", "self", ".", "sheet2matrixidx", "(", "x", ",", "y", ")", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SheetCoordinateSystem.sheetcoordinates_of_matrixidx
Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell.
holoviews/core/sheetcoords.py
def sheetcoordinates_of_matrixidx(self): """ Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell. """ rows,cols = self.shape return self.matrixidx2sheet(np.arang...
def sheetcoordinates_of_matrixidx(self): """ Return x,y where x is a vector of sheet coordinates representing the x-center of each matrix cell, and y represents the corresponding y-center of the cell. """ rows,cols = self.shape return self.matrixidx2sheet(np.arang...
[ "Return", "x", "y", "where", "x", "is", "a", "vector", "of", "sheet", "coordinates", "representing", "the", "x", "-", "center", "of", "each", "matrix", "cell", "and", "y", "represents", "the", "corresponding", "y", "-", "center", "of", "the", "cell", "."...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L320-L327
[ "def", "sheetcoordinates_of_matrixidx", "(", "self", ")", ":", "rows", ",", "cols", "=", "self", ".", "shape", "return", "self", ".", "matrixidx2sheet", "(", "np", ".", "arange", "(", "rows", ")", ",", "np", ".", "arange", "(", "cols", ")", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice.findinputslice
Gets the matrix indices of a slice within an array of size sheetshape from a sliceshape, positioned at coord.
holoviews/core/sheetcoords.py
def findinputslice(coord, sliceshape, sheetshape): """ Gets the matrix indices of a slice within an array of size sheetshape from a sliceshape, positioned at coord. """ center_row, center_col = coord n_rows, n_cols = sliceshape sheet_rows, sheet_cols = sheetshape ...
def findinputslice(coord, sliceshape, sheetshape): """ Gets the matrix indices of a slice within an array of size sheetshape from a sliceshape, positioned at coord. """ center_row, center_col = coord n_rows, n_cols = sliceshape sheet_rows, sheet_cols = sheetshape ...
[ "Gets", "the", "matrix", "indices", "of", "a", "slice", "within", "an", "array", "of", "size", "sheetshape", "from", "a", "sliceshape", "positioned", "at", "coord", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L387-L401
[ "def", "findinputslice", "(", "coord", ",", "sliceshape", ",", "sheetshape", ")", ":", "center_row", ",", "center_col", "=", "coord", "n_rows", ",", "n_cols", "=", "sliceshape", "sheet_rows", ",", "sheet_cols", "=", "sheetshape", "c1", "=", "-", "min", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice.positionlesscrop
Return the correct slice for a weights/mask matrix at this ConnectionField's location on the sheet (i.e. for getting the correct submatrix of the weights or mask in case the unit is near the edge of the sheet).
holoviews/core/sheetcoords.py
def positionlesscrop(self,x,y,sheet_coord_system): """ Return the correct slice for a weights/mask matrix at this ConnectionField's location on the sheet (i.e. for getting the correct submatrix of the weights or mask in case the unit is near the edge of the sheet). """ ...
def positionlesscrop(self,x,y,sheet_coord_system): """ Return the correct slice for a weights/mask matrix at this ConnectionField's location on the sheet (i.e. for getting the correct submatrix of the weights or mask in case the unit is near the edge of the sheet). """ ...
[ "Return", "the", "correct", "slice", "for", "a", "weights", "/", "mask", "matrix", "at", "this", "ConnectionField", "s", "location", "on", "the", "sheet", "(", "i", ".", "e", ".", "for", "getting", "the", "correct", "submatrix", "of", "the", "weights", "...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L404-L415
[ "def", "positionlesscrop", "(", "self", ",", "x", ",", "y", ",", "sheet_coord_system", ")", ":", "slice_inds", "=", "self", ".", "findinputslice", "(", "sheet_coord_system", ".", "sheet2matrixidx", "(", "x", ",", "y", ")", ",", "self", ".", "shape_on_sheet",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice.positionedcrop
Offset the bounds_template to this cf's location and store the result in the 'bounds' attribute. Also stores the input_sheet_slice for access by C.
holoviews/core/sheetcoords.py
def positionedcrop(self,x,y,sheet_coord_system): """ Offset the bounds_template to this cf's location and store the result in the 'bounds' attribute. Also stores the input_sheet_slice for access by C. """ cf_row,cf_col = sheet_coord_system.sheet2matrixidx(x,y) bo...
def positionedcrop(self,x,y,sheet_coord_system): """ Offset the bounds_template to this cf's location and store the result in the 'bounds' attribute. Also stores the input_sheet_slice for access by C. """ cf_row,cf_col = sheet_coord_system.sheet2matrixidx(x,y) bo...
[ "Offset", "the", "bounds_template", "to", "this", "cf", "s", "location", "and", "store", "the", "result", "in", "the", "bounds", "attribute", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L418-L432
[ "def", "positionedcrop", "(", "self", ",", "x", ",", "y", ",", "sheet_coord_system", ")", ":", "cf_row", ",", "cf_col", "=", "sheet_coord_system", ".", "sheet2matrixidx", "(", "x", ",", "y", ")", "bounds_x", ",", "bounds_y", "=", "self", ".", "compute_boun...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice.crop_to_sheet
Crop the slice to the SheetCoordinateSystem's bounds.
holoviews/core/sheetcoords.py
def crop_to_sheet(self,sheet_coord_system): "Crop the slice to the SheetCoordinateSystem's bounds." maxrow,maxcol = sheet_coord_system.shape self[0] = max(0,self[0]) self[1] = min(maxrow,self[1]) self[2] = max(0,self[2]) self[3] = min(maxcol,self[3])
def crop_to_sheet(self,sheet_coord_system): "Crop the slice to the SheetCoordinateSystem's bounds." maxrow,maxcol = sheet_coord_system.shape self[0] = max(0,self[0]) self[1] = min(maxrow,self[1]) self[2] = max(0,self[2]) self[3] = min(maxcol,self[3])
[ "Crop", "the", "slice", "to", "the", "SheetCoordinateSystem", "s", "bounds", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L450-L457
[ "def", "crop_to_sheet", "(", "self", ",", "sheet_coord_system", ")", ":", "maxrow", ",", "maxcol", "=", "sheet_coord_system", ".", "shape", "self", "[", "0", "]", "=", "max", "(", "0", ",", "self", "[", "0", "]", ")", "self", "[", "1", "]", "=", "m...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice._createoddslicespec
Create the 'odd' Slice that best approximates the specified sheet-coordinate bounds. The supplied bounds are translated to have a center at the center of one of the sheet's units (we arbitrarily use the center unit), and then these bounds are converted to a slice in such a way t...
holoviews/core/sheetcoords.py
def _createoddslicespec(bounds,scs,min_matrix_radius): """ Create the 'odd' Slice that best approximates the specified sheet-coordinate bounds. The supplied bounds are translated to have a center at the center of one of the sheet's units (we arbitrarily use the center un...
def _createoddslicespec(bounds,scs,min_matrix_radius): """ Create the 'odd' Slice that best approximates the specified sheet-coordinate bounds. The supplied bounds are translated to have a center at the center of one of the sheet's units (we arbitrarily use the center un...
[ "Create", "the", "odd", "Slice", "that", "best", "approximates", "the", "specified", "sheet", "-", "coordinate", "bounds", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L461-L499
[ "def", "_createoddslicespec", "(", "bounds", ",", "scs", ",", "min_matrix_radius", ")", ":", "bounds_xcenter", ",", "bounds_ycenter", "=", "bounds", ".", "centroid", "(", ")", "sheet_rows", ",", "sheet_cols", "=", "scs", ".", "shape", "center_row", ",", "cente...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice._boundsspec2slicespec
Convert an iterable boundsspec (supplying l,b,r,t of a BoundingRegion) into a Slice specification. Includes all units whose centers are within the specified sheet-coordinate bounds specified by boundsspec. Exact inverse of _slicespec2boundsspec().
holoviews/core/sheetcoords.py
def _boundsspec2slicespec(boundsspec,scs): """ Convert an iterable boundsspec (supplying l,b,r,t of a BoundingRegion) into a Slice specification. Includes all units whose centers are within the specified sheet-coordinate bounds specified by boundsspec. Exact inverse of ...
def _boundsspec2slicespec(boundsspec,scs): """ Convert an iterable boundsspec (supplying l,b,r,t of a BoundingRegion) into a Slice specification. Includes all units whose centers are within the specified sheet-coordinate bounds specified by boundsspec. Exact inverse of ...
[ "Convert", "an", "iterable", "boundsspec", "(", "supplying", "l", "b", "r", "t", "of", "a", "BoundingRegion", ")", "into", "a", "Slice", "specification", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L503-L524
[ "def", "_boundsspec2slicespec", "(", "boundsspec", ",", "scs", ")", ":", "l", ",", "b", ",", "r", ",", "t", "=", "boundsspec", "t_m", ",", "l_m", "=", "scs", ".", "sheet2matrix", "(", "l", ",", "t", ")", "b_m", ",", "r_m", "=", "scs", ".", "sheet...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Slice._slicespec2boundsspec
Convert an iterable slicespec (supplying r1,r2,c1,c2 of a Slice) into a BoundingRegion specification. Exact inverse of _boundsspec2slicespec().
holoviews/core/sheetcoords.py
def _slicespec2boundsspec(slicespec,scs): """ Convert an iterable slicespec (supplying r1,r2,c1,c2 of a Slice) into a BoundingRegion specification. Exact inverse of _boundsspec2slicespec(). """ r1,r2,c1,c2 = slicespec left,bottom = scs.matrix2sheet(r2,c1) ...
def _slicespec2boundsspec(slicespec,scs): """ Convert an iterable slicespec (supplying r1,r2,c1,c2 of a Slice) into a BoundingRegion specification. Exact inverse of _boundsspec2slicespec(). """ r1,r2,c1,c2 = slicespec left,bottom = scs.matrix2sheet(r2,c1) ...
[ "Convert", "an", "iterable", "slicespec", "(", "supplying", "r1", "r2", "c1", "c2", "of", "a", "Slice", ")", "into", "a", "BoundingRegion", "specification", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/sheetcoords.py#L528-L540
[ "def", "_slicespec2boundsspec", "(", "slicespec", ",", "scs", ")", ":", "r1", ",", "r2", ",", "c1", ",", "c2", "=", "slicespec", "left", ",", "bottom", "=", "scs", ".", "matrix2sheet", "(", "r2", ",", "c1", ")", "right", ",", "top", "=", "scs", "."...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SankeyPlot.get_extents
A Chord plot is always drawn on a unit circle.
holoviews/plotting/mpl/sankey.py
def get_extents(self, element, ranges, range_type='combined'): """ A Chord plot is always drawn on a unit circle. """ if range_type == 'extents': return element.nodes.extents xdim, ydim = element.nodes.kdims[:2] xpad = .05 if self.label_index is None else 0.25...
def get_extents(self, element, ranges, range_type='combined'): """ A Chord plot is always drawn on a unit circle. """ if range_type == 'extents': return element.nodes.extents xdim, ydim = element.nodes.kdims[:2] xpad = .05 if self.label_index is None else 0.25...
[ "A", "Chord", "plot", "is", "always", "drawn", "on", "a", "unit", "circle", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/sankey.py#L49-L67
[ "def", "get_extents", "(", "self", ",", "element", ",", "ranges", ",", "range_type", "=", "'combined'", ")", ":", "if", "range_type", "==", "'extents'", ":", "return", "element", ".", "nodes", ".", "extents", "xdim", ",", "ydim", "=", "element", ".", "no...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PandasInterface.unpack_scalar
Given a dataset object and data in the appropriate format for the interface, return a simple scalar.
holoviews/core/data/pandas.py
def unpack_scalar(cls, dataset, data): """ Given a dataset object and data in the appropriate format for the interface, return a simple scalar. """ if len(data) != 1 or len(data.columns) > 1: return data return data.iat[0,0]
def unpack_scalar(cls, dataset, data): """ Given a dataset object and data in the appropriate format for the interface, return a simple scalar. """ if len(data) != 1 or len(data.columns) > 1: return data return data.iat[0,0]
[ "Given", "a", "dataset", "object", "and", "data", "in", "the", "appropriate", "format", "for", "the", "interface", "return", "a", "simple", "scalar", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/pandas.py#L231-L238
[ "def", "unpack_scalar", "(", "cls", ",", "dataset", ",", "data", ")", ":", "if", "len", "(", "data", ")", "!=", "1", "or", "len", "(", "data", ".", "columns", ")", ">", "1", ":", "return", "data", "return", "data", ".", "iat", "[", "0", ",", "0...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PandasInterface.as_dframe
Returns the data of a Dataset as a dataframe avoiding copying if it already a dataframe type.
holoviews/core/data/pandas.py
def as_dframe(cls, dataset): """ Returns the data of a Dataset as a dataframe avoiding copying if it already a dataframe type. """ if issubclass(dataset.interface, PandasInterface): return dataset.data else: return dataset.dframe()
def as_dframe(cls, dataset): """ Returns the data of a Dataset as a dataframe avoiding copying if it already a dataframe type. """ if issubclass(dataset.interface, PandasInterface): return dataset.data else: return dataset.dframe()
[ "Returns", "the", "data", "of", "a", "Dataset", "as", "a", "dataframe", "avoiding", "copying", "if", "it", "already", "a", "dataframe", "type", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/data/pandas.py#L307-L315
[ "def", "as_dframe", "(", "cls", ",", "dataset", ")", ":", "if", "issubclass", "(", "dataset", ".", "interface", ",", "PandasInterface", ")", ":", "return", "dataset", ".", "data", "else", ":", "return", "dataset", ".", "dframe", "(", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
escape_vals
Escapes a list of values to a string, converting to unicode for safety.
holoviews/plotting/widgets/__init__.py
def escape_vals(vals, escape_numerics=True): """ Escapes a list of values to a string, converting to unicode for safety. """ # Ints formatted as floats to disambiguate with counter mode ints, floats = "%.1f", "%.10f" escaped = [] for v in vals: if isinstance(v, np.timedelta64): ...
def escape_vals(vals, escape_numerics=True): """ Escapes a list of values to a string, converting to unicode for safety. """ # Ints formatted as floats to disambiguate with counter mode ints, floats = "%.1f", "%.10f" escaped = [] for v in vals: if isinstance(v, np.timedelta64): ...
[ "Escapes", "a", "list", "of", "values", "to", "a", "string", "converting", "to", "unicode", "for", "safety", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/widgets/__init__.py#L17-L41
[ "def", "escape_vals", "(", "vals", ",", "escape_numerics", "=", "True", ")", ":", "# Ints formatted as floats to disambiguate with counter mode", "ints", ",", "floats", "=", "\"%.1f\"", ",", "\"%.10f\"", "escaped", "=", "[", "]", "for", "v", "in", "vals", ":", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
NdWidget.save_json
Saves frames data into a json file at the specified json_path, named with the widget uuid.
holoviews/plotting/widgets/__init__.py
def save_json(self, frames): """ Saves frames data into a json file at the specified json_path, named with the widget uuid. """ if self.json_save_path is None: return path = os.path.join(self.json_save_path, '%s.json' % self.id) if not os.path.isdir(self.json_save...
def save_json(self, frames): """ Saves frames data into a json file at the specified json_path, named with the widget uuid. """ if self.json_save_path is None: return path = os.path.join(self.json_save_path, '%s.json' % self.id) if not os.path.isdir(self.json_save...
[ "Saves", "frames", "data", "into", "a", "json", "file", "at", "the", "specified", "json_path", "named", "with", "the", "widget", "uuid", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/widgets/__init__.py#L233-L244
[ "def", "save_json", "(", "self", ",", "frames", ")", ":", "if", "self", ".", "json_save_path", "is", "None", ":", "return", "path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "json_save_path", ",", "'%s.json'", "%", "self", ".", "id", ")"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
renderer
Helper utility to access the active renderer for a given extension.
holoviews/util/__init__.py
def renderer(name): """ Helper utility to access the active renderer for a given extension. """ try: if name not in Store.renderers: extension(name) return Store.renderers[name] except ImportError: msg = ('Could not find a {name!r} renderer, available renderers ar...
def renderer(name): """ Helper utility to access the active renderer for a given extension. """ try: if name not in Store.renderers: extension(name) return Store.renderers[name] except ImportError: msg = ('Could not find a {name!r} renderer, available renderers ar...
[ "Helper", "utility", "to", "access", "the", "active", "renderer", "for", "a", "given", "extension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L627-L638
[ "def", "renderer", "(", "name", ")", ":", "try", ":", "if", "name", "not", "in", "Store", ".", "renderers", ":", "extension", "(", "name", ")", "return", "Store", ".", "renderers", "[", "name", "]", "except", "ImportError", ":", "msg", "=", "(", "'Co...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
save
Saves the supplied object to file. The available output formats depend on the backend being used. By default and if the filename is a string the output format will be inferred from the file extension. Otherwise an explicit format will need to be specified. For ambiguous file extensions such as html...
holoviews/util/__init__.py
def save(obj, filename, fmt='auto', backend=None, **kwargs): """ Saves the supplied object to file. The available output formats depend on the backend being used. By default and if the filename is a string the output format will be inferred from the file extension. Otherwise an explicit format ...
def save(obj, filename, fmt='auto', backend=None, **kwargs): """ Saves the supplied object to file. The available output formats depend on the backend being used. By default and if the filename is a string the output format will be inferred from the file extension. Otherwise an explicit format ...
[ "Saves", "the", "supplied", "object", "to", "file", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L714-L756
[ "def", "save", "(", "obj", ",", "filename", ",", "fmt", "=", "'auto'", ",", "backend", "=", "None", ",", "*", "*", "kwargs", ")", ":", "backend", "=", "backend", "or", "Store", ".", "current_backend", "renderer_obj", "=", "renderer", "(", "backend", ")...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
render
Renders the HoloViews object to the corresponding object in the specified backend, e.g. a Matplotlib or Bokeh figure. The backend defaults to the currently declared default backend. The resulting object can then be used with other objects in the specified backend. For instance, if you want to make a ...
holoviews/util/__init__.py
def render(obj, backend=None, **kwargs): """ Renders the HoloViews object to the corresponding object in the specified backend, e.g. a Matplotlib or Bokeh figure. The backend defaults to the currently declared default backend. The resulting object can then be used with other objects in the spec...
def render(obj, backend=None, **kwargs): """ Renders the HoloViews object to the corresponding object in the specified backend, e.g. a Matplotlib or Bokeh figure. The backend defaults to the currently declared default backend. The resulting object can then be used with other objects in the spec...
[ "Renders", "the", "HoloViews", "object", "to", "the", "corresponding", "object", "in", "the", "specified", "backend", "e", ".", "g", ".", "a", "Matplotlib", "or", "Bokeh", "figure", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L759-L795
[ "def", "render", "(", "obj", ",", "backend", "=", "None", ",", "*", "*", "kwargs", ")", ":", "backend", "=", "backend", "or", "Store", ".", "current_backend", "renderer_obj", "=", "renderer", "(", "backend", ")", "if", "kwargs", ":", "renderer_obj", "=",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._group_kwargs_to_options
Format option group kwargs into canonical options format
holoviews/util/__init__.py
def _group_kwargs_to_options(cls, obj, kwargs): "Format option group kwargs into canonical options format" groups = Options._option_groups if set(kwargs.keys()) - set(groups): raise Exception("Keyword options %s must be one of %s" % (groups, ','.join(repr...
def _group_kwargs_to_options(cls, obj, kwargs): "Format option group kwargs into canonical options format" groups = Options._option_groups if set(kwargs.keys()) - set(groups): raise Exception("Keyword options %s must be one of %s" % (groups, ','.join(repr...
[ "Format", "option", "group", "kwargs", "into", "canonical", "options", "format" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L115-L148
[ "def", "_group_kwargs_to_options", "(", "cls", ",", "obj", ",", "kwargs", ")", ":", "groups", "=", "Options", ".", "_option_groups", "if", "set", "(", "kwargs", ".", "keys", "(", ")", ")", "-", "set", "(", "groups", ")", ":", "raise", "Exception", "(",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._apply_groups_to_backend
Apply the groups to a single specified backend
holoviews/util/__init__.py
def _apply_groups_to_backend(cls, obj, options, backend, clone): "Apply the groups to a single specified backend" obj_handle = obj if options is None: if clone: obj_handle = obj.map(lambda x: x.clone(id=None)) else: obj.map(lambda x: setatt...
def _apply_groups_to_backend(cls, obj, options, backend, clone): "Apply the groups to a single specified backend" obj_handle = obj if options is None: if clone: obj_handle = obj.map(lambda x: x.clone(id=None)) else: obj.map(lambda x: setatt...
[ "Apply", "the", "groups", "to", "a", "single", "specified", "backend" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L151-L162
[ "def", "_apply_groups_to_backend", "(", "cls", ",", "obj", ",", "options", ",", "backend", ",", "clone", ")", ":", "obj_handle", "=", "obj", "if", "options", "is", "None", ":", "if", "clone", ":", "obj_handle", "=", "obj", ".", "map", "(", "lambda", "x...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._grouped_backends
Group options by backend and filter out output group appropriately
holoviews/util/__init__.py
def _grouped_backends(cls, options, backend): "Group options by backend and filter out output group appropriately" if options is None: return [(backend or Store.current_backend, options)] dfltdict = defaultdict(dict) for spec, groups in options.items(): if 'outpu...
def _grouped_backends(cls, options, backend): "Group options by backend and filter out output group appropriately" if options is None: return [(backend or Store.current_backend, options)] dfltdict = defaultdict(dict) for spec, groups in options.items(): if 'outpu...
[ "Group", "options", "by", "backend", "and", "filter", "out", "output", "group", "appropriately" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L166-L183
[ "def", "_grouped_backends", "(", "cls", ",", "options", ",", "backend", ")", ":", "if", "options", "is", "None", ":", "return", "[", "(", "backend", "or", "Store", ".", "current_backend", ",", "options", ")", "]", "dfltdict", "=", "defaultdict", "(", "di...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts.apply_groups
Applies nested options definition grouped by type. Applies options on an object or nested group of objects, returning a new object with the options applied. This method accepts the separate option namespaces explicitly (i.e 'plot', 'style' and 'norm'). If the options are to be ...
holoviews/util/__init__.py
def apply_groups(cls, obj, options=None, backend=None, clone=True, **kwargs): """Applies nested options definition grouped by type. Applies options on an object or nested group of objects, returning a new object with the options applied. This method accepts the separate option namespace...
def apply_groups(cls, obj, options=None, backend=None, clone=True, **kwargs): """Applies nested options definition grouped by type. Applies options on an object or nested group of objects, returning a new object with the options applied. This method accepts the separate option namespace...
[ "Applies", "nested", "options", "definition", "grouped", "by", "type", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L186-L238
[ "def", "apply_groups", "(", "cls", ",", "obj", ",", "options", "=", "None", ",", "backend", "=", "None", ",", "clone", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "isinstance", "(", "options", ",", "basestring", ")", ":", "from", ".", "."...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._cellmagic
Deprecated, not expected to be used by any current code
holoviews/util/__init__.py
def _cellmagic(cls, options, obj, strict=False): "Deprecated, not expected to be used by any current code" options, failure = cls._process_magic(options, strict) if failure: return obj if not isinstance(obj, Dimensioned): return obj else: return StoreOptio...
def _cellmagic(cls, options, obj, strict=False): "Deprecated, not expected to be used by any current code" options, failure = cls._process_magic(options, strict) if failure: return obj if not isinstance(obj, Dimensioned): return obj else: return StoreOptio...
[ "Deprecated", "not", "expected", "to", "be", "used", "by", "any", "current", "code" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L257-L264
[ "def", "_cellmagic", "(", "cls", ",", "options", ",", "obj", ",", "strict", "=", "False", ")", ":", "options", ",", "failure", "=", "cls", ".", "_process_magic", "(", "options", ",", "strict", ")", "if", "failure", ":", "return", "obj", "if", "not", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._linemagic
Deprecated, not expected to be used by any current code
holoviews/util/__init__.py
def _linemagic(cls, options, strict=False, backend=None): "Deprecated, not expected to be used by any current code" backends = None if backend is None else [backend] options, failure = cls._process_magic(options, strict, backends=backends) if failure: return with options_policy(s...
def _linemagic(cls, options, strict=False, backend=None): "Deprecated, not expected to be used by any current code" backends = None if backend is None else [backend] options, failure = cls._process_magic(options, strict, backends=backends) if failure: return with options_policy(s...
[ "Deprecated", "not", "expected", "to", "be", "used", "by", "any", "current", "code" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L267-L273
[ "def", "_linemagic", "(", "cls", ",", "options", ",", "strict", "=", "False", ",", "backend", "=", "None", ")", ":", "backends", "=", "None", "if", "backend", "is", "None", "else", "[", "backend", "]", "options", ",", "failure", "=", "cls", ".", "_pr...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts.defaults
Set default options for a session. Set default options for a session. whether in a Python script or a Jupyter notebook. Args: *options: Option objects used to specify the defaults. backend: The plotting extension the options apply to
holoviews/util/__init__.py
def defaults(cls, *options, **kwargs): """Set default options for a session. Set default options for a session. whether in a Python script or a Jupyter notebook. Args: *options: Option objects used to specify the defaults. backend: The plotting extension the opti...
def defaults(cls, *options, **kwargs): """Set default options for a session. Set default options for a session. whether in a Python script or a Jupyter notebook. Args: *options: Option objects used to specify the defaults. backend: The plotting extension the opti...
[ "Set", "default", "options", "for", "a", "session", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L277-L290
[ "def", "defaults", "(", "cls", ",", "*", "options", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", "and", "len", "(", "kwargs", ")", "!=", "1", "and", "list", "(", "kwargs", ".", "keys", "(", ")", ")", "[", "0", "]", "!=", "'backend'", ":",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._expand_by_backend
Given a list of flat Option objects which may or may not have 'backend' in their kwargs, return a list of grouped backend
holoviews/util/__init__.py
def _expand_by_backend(cls, options, backend): """ Given a list of flat Option objects which may or may not have 'backend' in their kwargs, return a list of grouped backend """ groups = defaultdict(list) used_fallback = False for obj in options: if 'ba...
def _expand_by_backend(cls, options, backend): """ Given a list of flat Option objects which may or may not have 'backend' in their kwargs, return a list of grouped backend """ groups = defaultdict(list) used_fallback = False for obj in options: if 'ba...
[ "Given", "a", "list", "of", "flat", "Option", "objects", "which", "may", "or", "may", "not", "have", "backend", "in", "their", "kwargs", "return", "a", "list", "of", "grouped", "backend" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L294-L317
[ "def", "_expand_by_backend", "(", "cls", ",", "options", ",", "backend", ")", ":", "groups", "=", "defaultdict", "(", "list", ")", "used_fallback", "=", "False", "for", "obj", "in", "options", ":", "if", "'backend'", "in", "obj", ".", "kwargs", ":", "opt...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._expand_options
Validates and expands a dictionaries of options indexed by type[.group][.label] keys into separate style, plot, norm and output options. opts._expand_options({'Image': dict(cmap='viridis', show_title=False)}) returns {'Image': {'plot': dict(show_title=False), 'style': ...
holoviews/util/__init__.py
def _expand_options(cls, options, backend=None): """ Validates and expands a dictionaries of options indexed by type[.group][.label] keys into separate style, plot, norm and output options. opts._expand_options({'Image': dict(cmap='viridis', show_title=False)}) retu...
def _expand_options(cls, options, backend=None): """ Validates and expands a dictionaries of options indexed by type[.group][.label] keys into separate style, plot, norm and output options. opts._expand_options({'Image': dict(cmap='viridis', show_title=False)}) retu...
[ "Validates", "and", "expands", "a", "dictionaries", "of", "options", "indexed", "by", "type", "[", ".", "group", "]", "[", ".", "label", "]", "keys", "into", "separate", "style", "plot", "norm", "and", "output", "options", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L320-L359
[ "def", "_expand_options", "(", "cls", ",", "options", ",", "backend", "=", "None", ")", ":", "current_backend", "=", "Store", ".", "current_backend", "try", ":", "backend_options", "=", "Store", ".", "options", "(", "backend", "=", "backend", "or", "current_...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._options_error
Generates an error message for an invalid option suggesting similar options through fuzzy matching.
holoviews/util/__init__.py
def _options_error(cls, opt, objtype, backend, valid_options): """ Generates an error message for an invalid option suggesting similar options through fuzzy matching. """ current_backend = Store.current_backend loaded_backends = Store.loaded_backends() kws = Keywo...
def _options_error(cls, opt, objtype, backend, valid_options): """ Generates an error message for an invalid option suggesting similar options through fuzzy matching. """ current_backend = Store.current_backend loaded_backends = Store.loaded_backends() kws = Keywo...
[ "Generates", "an", "error", "message", "for", "an", "invalid", "option", "suggesting", "similar", "options", "through", "fuzzy", "matching", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L363-L408
[ "def", "_options_error", "(", "cls", ",", "opt", ",", "objtype", ",", "backend", ",", "valid_options", ")", ":", "current_backend", "=", "Store", ".", "current_backend", "loaded_backends", "=", "Store", ".", "loaded_backends", "(", ")", "kws", "=", "Keywords",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._builder_reprs
Given a list of Option objects (such as those returned from OptsSpec.parse_options) or an %opts or %%opts magic string, return a list of corresponding option builder reprs. The namespace is typically given as 'hv' if fully qualified namespaces are desired.
holoviews/util/__init__.py
def _builder_reprs(cls, options, namespace=None, ns=None): """ Given a list of Option objects (such as those returned from OptsSpec.parse_options) or an %opts or %%opts magic string, return a list of corresponding option builder reprs. The namespace is typically given as 'hv' if ...
def _builder_reprs(cls, options, namespace=None, ns=None): """ Given a list of Option objects (such as those returned from OptsSpec.parse_options) or an %opts or %%opts magic string, return a list of corresponding option builder reprs. The namespace is typically given as 'hv' if ...
[ "Given", "a", "list", "of", "Option", "objects", "(", "such", "as", "those", "returned", "from", "OptsSpec", ".", "parse_options", ")", "or", "an", "%opts", "or", "%%opts", "magic", "string", "return", "a", "list", "of", "corresponding", "option", "builder",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L411-L441
[ "def", "_builder_reprs", "(", "cls", ",", "options", ",", "namespace", "=", "None", ",", "ns", "=", "None", ")", ":", "if", "isinstance", "(", "options", ",", "basestring", ")", ":", "from", ".", "parser", "import", "OptsSpec", "if", "ns", "is", "None"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
opts._element_keywords
Returns a dictionary of element names to allowed keywords
holoviews/util/__init__.py
def _element_keywords(cls, backend, elements=None): "Returns a dictionary of element names to allowed keywords" if backend not in Store.loaded_backends(): return {} mapping = {} backend_options = Store.options(backend) elements = elements if elements is not None else...
def _element_keywords(cls, backend, elements=None): "Returns a dictionary of element names to allowed keywords" if backend not in Store.loaded_backends(): return {} mapping = {} backend_options = Store.options(backend) elements = elements if elements is not None else...
[ "Returns", "a", "dictionary", "of", "element", "names", "to", "allowed", "keywords" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L494-L511
[ "def", "_element_keywords", "(", "cls", ",", "backend", ",", "elements", "=", "None", ")", ":", "if", "backend", "not", "in", "Store", ".", "loaded_backends", "(", ")", ":", "return", "{", "}", "mapping", "=", "{", "}", "backend_options", "=", "Store", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dynamic._get_streams
Generates a list of streams to attach to the returned DynamicMap. If the input is a DynamicMap any streams that are supplying values for the key dimension of the input are inherited. And the list of supplied stream classes and instances are processed and added to the list.
holoviews/util/__init__.py
def _get_streams(self, map_obj, watch=True): """ Generates a list of streams to attach to the returned DynamicMap. If the input is a DynamicMap any streams that are supplying values for the key dimension of the input are inherited. And the list of supplied stream classes and inst...
def _get_streams(self, map_obj, watch=True): """ Generates a list of streams to attach to the returned DynamicMap. If the input is a DynamicMap any streams that are supplying values for the key dimension of the input are inherited. And the list of supplied stream classes and inst...
[ "Generates", "a", "list", "of", "streams", "to", "attach", "to", "the", "returned", "DynamicMap", ".", "If", "the", "input", "is", "a", "DynamicMap", "any", "streams", "that", "are", "supplying", "values", "for", "the", "key", "dimension", "of", "the", "in...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L852-L900
[ "def", "_get_streams", "(", "self", ",", "map_obj", ",", "watch", "=", "True", ")", ":", "streams", "=", "[", "]", "for", "stream", "in", "self", ".", "p", ".", "streams", ":", "if", "inspect", ".", "isclass", "(", "stream", ")", "and", "issubclass",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dynamic._eval_kwargs
Evaluates any parameterized methods in the kwargs
holoviews/util/__init__.py
def _eval_kwargs(self): """Evaluates any parameterized methods in the kwargs""" evaled_kwargs = {} for k, v in self.p.kwargs.items(): if util.is_param_method(v): v = v() evaled_kwargs[k] = v return evaled_kwargs
def _eval_kwargs(self): """Evaluates any parameterized methods in the kwargs""" evaled_kwargs = {} for k, v in self.p.kwargs.items(): if util.is_param_method(v): v = v() evaled_kwargs[k] = v return evaled_kwargs
[ "Evaluates", "any", "parameterized", "methods", "in", "the", "kwargs" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L912-L919
[ "def", "_eval_kwargs", "(", "self", ")", ":", "evaled_kwargs", "=", "{", "}", "for", "k", ",", "v", "in", "self", ".", "p", ".", "kwargs", ".", "items", "(", ")", ":", "if", "util", ".", "is_param_method", "(", "v", ")", ":", "v", "=", "v", "("...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dynamic._dynamic_operation
Generate function to dynamically apply the operation. Wraps an existing HoloMap or DynamicMap.
holoviews/util/__init__.py
def _dynamic_operation(self, map_obj): """ Generate function to dynamically apply the operation. Wraps an existing HoloMap or DynamicMap. """ if not isinstance(map_obj, DynamicMap): def dynamic_operation(*key, **kwargs): kwargs = dict(self._eval_kwargs...
def _dynamic_operation(self, map_obj): """ Generate function to dynamically apply the operation. Wraps an existing HoloMap or DynamicMap. """ if not isinstance(map_obj, DynamicMap): def dynamic_operation(*key, **kwargs): kwargs = dict(self._eval_kwargs...
[ "Generate", "function", "to", "dynamically", "apply", "the", "operation", ".", "Wraps", "an", "existing", "HoloMap", "or", "DynamicMap", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L921-L941
[ "def", "_dynamic_operation", "(", "self", ",", "map_obj", ")", ":", "if", "not", "isinstance", "(", "map_obj", ",", "DynamicMap", ")", ":", "def", "dynamic_operation", "(", "*", "key", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "dict", "(", "sel...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Dynamic._make_dynamic
Accepts a HoloMap and a dynamic callback function creating an equivalent DynamicMap from the HoloMap.
holoviews/util/__init__.py
def _make_dynamic(self, hmap, dynamic_fn, streams): """ Accepts a HoloMap and a dynamic callback function creating an equivalent DynamicMap from the HoloMap. """ if isinstance(hmap, ViewableElement): return DynamicMap(dynamic_fn, streams=streams) dim_values = ...
def _make_dynamic(self, hmap, dynamic_fn, streams): """ Accepts a HoloMap and a dynamic callback function creating an equivalent DynamicMap from the HoloMap. """ if isinstance(hmap, ViewableElement): return DynamicMap(dynamic_fn, streams=streams) dim_values = ...
[ "Accepts", "a", "HoloMap", "and", "a", "dynamic", "callback", "function", "creating", "an", "equivalent", "DynamicMap", "from", "the", "HoloMap", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/__init__.py#L944-L955
[ "def", "_make_dynamic", "(", "self", ",", "hmap", ",", "dynamic_fn", ",", "streams", ")", ":", "if", "isinstance", "(", "hmap", ",", "ViewableElement", ")", ":", "return", "DynamicMap", "(", "dynamic_fn", ",", "streams", "=", "streams", ")", "dim_values", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PlotlyPlot._trigger_refresh
Triggers update to a plot on a refresh event
holoviews/plotting/plotly/plot.py
def _trigger_refresh(self, key): "Triggers update to a plot on a refresh event" if self.top_level: self.update(key) else: self.current_key = None self.current_frame = None
def _trigger_refresh(self, key): "Triggers update to a plot on a refresh event" if self.top_level: self.update(key) else: self.current_key = None self.current_frame = None
[ "Triggers", "update", "to", "a", "plot", "on", "a", "refresh", "event" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/plotly/plot.py#L33-L39
[ "def", "_trigger_refresh", "(", "self", ",", "key", ")", ":", "if", "self", ".", "top_level", ":", "self", ".", "update", "(", "key", ")", "else", ":", "self", ".", "current_key", "=", "None", "self", ".", "current_frame", "=", "None" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
norm
Unity-based normalization to scale data into 0-1 range. (values - min) / (max - min) Args: values: Array of values to be normalized min (float, optional): Lower bound of normalization range max (float, optional): Upper bound of normalization range Returns: Array of nor...
holoviews/util/transform.py
def norm(values, min=None, max=None): """Unity-based normalization to scale data into 0-1 range. (values - min) / (max - min) Args: values: Array of values to be normalized min (float, optional): Lower bound of normalization range max (float, optional): Upper bound of normaliza...
def norm(values, min=None, max=None): """Unity-based normalization to scale data into 0-1 range. (values - min) / (max - min) Args: values: Array of values to be normalized min (float, optional): Lower bound of normalization range max (float, optional): Upper bound of normaliza...
[ "Unity", "-", "based", "normalization", "to", "scale", "data", "into", "0", "-", "1", "range", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L17-L32
[ "def", "norm", "(", "values", ",", "min", "=", "None", ",", "max", "=", "None", ")", ":", "min", "=", "np", ".", "min", "(", "values", ")", "if", "min", "is", "None", "else", "min", "max", "=", "np", ".", "max", "(", "values", ")", "if", "max...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
bin
Bins data into declared bins Bins data into declared bins. By default each bin is labelled with bin center values but an explicit list of bin labels may be defined. Args: values: Array of values to be binned bins: List or array containing the bin boundaries labels: List of labe...
holoviews/util/transform.py
def bin(values, bins, labels=None): """Bins data into declared bins Bins data into declared bins. By default each bin is labelled with bin center values but an explicit list of bin labels may be defined. Args: values: Array of values to be binned bins: List or array containing the ...
def bin(values, bins, labels=None): """Bins data into declared bins Bins data into declared bins. By default each bin is labelled with bin center values but an explicit list of bin labels may be defined. Args: values: Array of values to be binned bins: List or array containing the ...
[ "Bins", "data", "into", "declared", "bins" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L35-L61
[ "def", "bin", "(", "values", ",", "bins", ",", "labels", "=", "None", ")", ":", "bins", "=", "np", ".", "asarray", "(", "bins", ")", "if", "labels", "is", "None", ":", "labels", "=", "(", "bins", "[", ":", "-", "1", "]", "+", "np", ".", "diff...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
categorize
Maps discrete values to supplied categories. Replaces discrete values in input array with a fixed set of categories defined either as a list or dictionary. Args: values: Array of values to be categorized categories: List or dict of categories to map inputs to default: Default value...
holoviews/util/transform.py
def categorize(values, categories, default=None): """Maps discrete values to supplied categories. Replaces discrete values in input array with a fixed set of categories defined either as a list or dictionary. Args: values: Array of values to be categorized categories: List or dict of c...
def categorize(values, categories, default=None): """Maps discrete values to supplied categories. Replaces discrete values in input array with a fixed set of categories defined either as a list or dictionary. Args: values: Array of values to be categorized categories: List or dict of c...
[ "Maps", "discrete", "values", "to", "supplied", "categories", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L64-L90
[ "def", "categorize", "(", "values", ",", "categories", ",", "default", "=", "None", ")", ":", "uniq_cats", "=", "list", "(", "unique_iterator", "(", "values", ")", ")", "cats", "=", "[", "]", "for", "c", "in", "values", ":", "if", "isinstance", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim.bin
Bins continuous values. Bins continuous using the provided bins and assigns labels either computed from each bins center point or from the supplied labels. Args: bins: List or array containing the bin boundaries labels: List of labels to assign to each bin ...
holoviews/util/transform.py
def bin(self, bins, labels=None): """Bins continuous values. Bins continuous using the provided bins and assigns labels either computed from each bins center point or from the supplied labels. Args: bins: List or array containing the bin boundaries label...
def bin(self, bins, labels=None): """Bins continuous values. Bins continuous using the provided bins and assigns labels either computed from each bins center point or from the supplied labels. Args: bins: List or array containing the bin boundaries label...
[ "Bins", "continuous", "values", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L228-L240
[ "def", "bin", "(", "self", ",", "bins", ",", "labels", "=", "None", ")", ":", "return", "dim", "(", "self", ",", "bin", ",", "bins", ",", "labels", "=", "labels", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim.categorize
Replaces discrete values with supplied categories Replaces discrete values in input array into a fixed set of categories defined either as a list or dictionary. Args: categories: List or dict of categories to map inputs to default: Default value to assign if value not i...
holoviews/util/transform.py
def categorize(self, categories, default=None): """Replaces discrete values with supplied categories Replaces discrete values in input array into a fixed set of categories defined either as a list or dictionary. Args: categories: List or dict of categories to map inputs to ...
def categorize(self, categories, default=None): """Replaces discrete values with supplied categories Replaces discrete values in input array into a fixed set of categories defined either as a list or dictionary. Args: categories: List or dict of categories to map inputs to ...
[ "Replaces", "discrete", "values", "with", "supplied", "categories" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L242-L252
[ "def", "categorize", "(", "self", ",", "categories", ",", "default", "=", "None", ")", ":", "return", "dim", "(", "self", ",", "categorize", ",", "categories", "=", "categories", ",", "default", "=", "default", ")" ]
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim.norm
Unity-based normalization to scale data into 0-1 range. (values - min) / (max - min) Args: limits: tuple of (min, max) defining the normalization range
holoviews/util/transform.py
def norm(self, limits=None): """Unity-based normalization to scale data into 0-1 range. (values - min) / (max - min) Args: limits: tuple of (min, max) defining the normalization range """ kwargs = {} if limits is not None: kwargs = {'min': li...
def norm(self, limits=None): """Unity-based normalization to scale data into 0-1 range. (values - min) / (max - min) Args: limits: tuple of (min, max) defining the normalization range """ kwargs = {} if limits is not None: kwargs = {'min': li...
[ "Unity", "-", "based", "normalization", "to", "scale", "data", "into", "0", "-", "1", "range", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L254-L265
[ "def", "norm", "(", "self", ",", "limits", "=", "None", ")", ":", "kwargs", "=", "{", "}", "if", "limits", "is", "not", "None", ":", "kwargs", "=", "{", "'min'", ":", "limits", "[", "0", "]", ",", "'max'", ":", "limits", "[", "1", "]", "}", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim.applies
Determines whether the dim transform can be applied to the Dataset, i.e. whether all referenced dimensions can be resolved.
holoviews/util/transform.py
def applies(self, dataset): """ Determines whether the dim transform can be applied to the Dataset, i.e. whether all referenced dimensions can be resolved. """ if isinstance(self.dimension, dim): applies = self.dimension.applies(dataset) else: ...
def applies(self, dataset): """ Determines whether the dim transform can be applied to the Dataset, i.e. whether all referenced dimensions can be resolved. """ if isinstance(self.dimension, dim): applies = self.dimension.applies(dataset) else: ...
[ "Determines", "whether", "the", "dim", "transform", "can", "be", "applied", "to", "the", "Dataset", "i", ".", "e", ".", "whether", "all", "referenced", "dimensions", "can", "be", "resolved", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L273-L292
[ "def", "applies", "(", "self", ",", "dataset", ")", ":", "if", "isinstance", "(", "self", ".", "dimension", ",", "dim", ")", ":", "applies", "=", "self", ".", "dimension", ".", "applies", "(", "dataset", ")", "else", ":", "applies", "=", "dataset", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
dim.apply
Evaluates the transform on the supplied dataset. Args: dataset: Dataset object to evaluate the expression on flat: Whether to flatten the returned array expanded: Whether to use the expanded expand values ranges: Dictionary for ranges for normalization ...
holoviews/util/transform.py
def apply(self, dataset, flat=False, expanded=None, ranges={}, all_values=False): """Evaluates the transform on the supplied dataset. Args: dataset: Dataset object to evaluate the expression on flat: Whether to flatten the returned array expanded: Whether to use the ...
def apply(self, dataset, flat=False, expanded=None, ranges={}, all_values=False): """Evaluates the transform on the supplied dataset. Args: dataset: Dataset object to evaluate the expression on flat: Whether to flatten the returned array expanded: Whether to use the ...
[ "Evaluates", "the", "transform", "on", "the", "supplied", "dataset", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/util/transform.py#L294-L335
[ "def", "apply", "(", "self", ",", "dataset", ",", "flat", "=", "False", ",", "expanded", "=", "None", ",", "ranges", "=", "{", "}", ",", "all_values", "=", "False", ")", ":", "dimension", "=", "self", ".", "dimension", "if", "expanded", "is", "None",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SankeyPlot._compute_quads
Computes the node quad glyph data.x
holoviews/plotting/bokeh/sankey.py
def _compute_quads(self, element, data, mapping): """ Computes the node quad glyph data.x """ quad_mapping = {'left': 'x0', 'right': 'x1', 'bottom': 'y0', 'top': 'y1'} quad_data = dict(data['scatter_1']) quad_data.update({'x0': [], 'x1': [], 'y0': [], 'y1': []}) f...
def _compute_quads(self, element, data, mapping): """ Computes the node quad glyph data.x """ quad_mapping = {'left': 'x0', 'right': 'x1', 'bottom': 'y0', 'top': 'y1'} quad_data = dict(data['scatter_1']) quad_data.update({'x0': [], 'x1': [], 'y0': [], 'y1': []}) f...
[ "Computes", "the", "node", "quad", "glyph", "data", ".", "x" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/sankey.py#L101-L115
[ "def", "_compute_quads", "(", "self", ",", "element", ",", "data", ",", "mapping", ")", ":", "quad_mapping", "=", "{", "'left'", ":", "'x0'", ",", "'right'", ":", "'x1'", ",", "'bottom'", ":", "'y0'", ",", "'top'", ":", "'y1'", "}", "quad_data", "=", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SankeyPlot._compute_labels
Computes labels for the nodes and adds it to the data.
holoviews/plotting/bokeh/sankey.py
def _compute_labels(self, element, data, mapping): """ Computes labels for the nodes and adds it to the data. """ if element.vdims: edges = Dataset(element)[element[element.vdims[0].name]>0] nodes = list(np.unique([edges.dimension_values(i) for i in range(2)])) ...
def _compute_labels(self, element, data, mapping): """ Computes labels for the nodes and adds it to the data. """ if element.vdims: edges = Dataset(element)[element[element.vdims[0].name]>0] nodes = list(np.unique([edges.dimension_values(i) for i in range(2)])) ...
[ "Computes", "labels", "for", "the", "nodes", "and", "adds", "it", "to", "the", "data", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/sankey.py#L117-L178
[ "def", "_compute_labels", "(", "self", ",", "element", ",", "data", ",", "mapping", ")", ":", "if", "element", ".", "vdims", ":", "edges", "=", "Dataset", "(", "element", ")", "[", "element", "[", "element", ".", "vdims", "[", "0", "]", ".", "name", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
SankeyPlot._patch_hover
Replace edge start and end hover data with label_index data.
holoviews/plotting/bokeh/sankey.py
def _patch_hover(self, element, data): """ Replace edge start and end hover data with label_index data. """ if not (self.inspection_policy == 'edges' and 'hover' in self.handles): return lidx = element.nodes.get_dimension(self.label_index) src, tgt = [dimensio...
def _patch_hover(self, element, data): """ Replace edge start and end hover data with label_index data. """ if not (self.inspection_policy == 'edges' and 'hover' in self.handles): return lidx = element.nodes.get_dimension(self.label_index) src, tgt = [dimensio...
[ "Replace", "edge", "start", "and", "end", "hover", "data", "with", "label_index", "data", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/sankey.py#L180-L194
[ "def", "_patch_hover", "(", "self", ",", "element", ",", "data", ")", ":", "if", "not", "(", "self", ".", "inspection_policy", "==", "'edges'", "and", "'hover'", "in", "self", ".", "handles", ")", ":", "return", "lidx", "=", "element", ".", "nodes", "....
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
set_style
Select a style by name, e.g. set_style('default'). To revert to the previous style use the key 'unset' or False.
holoviews/plotting/mpl/__init__.py
def set_style(key): """ Select a style by name, e.g. set_style('default'). To revert to the previous style use the key 'unset' or False. """ if key is None: return elif not key or key in ['unset', 'backup']: if 'backup' in styles: plt.rcParams.update(styles['backup'])...
def set_style(key): """ Select a style by name, e.g. set_style('default'). To revert to the previous style use the key 'unset' or False. """ if key is None: return elif not key or key in ['unset', 'backup']: if 'backup' in styles: plt.rcParams.update(styles['backup'])...
[ "Select", "a", "style", "by", "name", "e", ".", "g", ".", "set_style", "(", "default", ")", ".", "To", "revert", "to", "the", "previous", "style", "use", "the", "key", "unset", "or", "False", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/mpl/__init__.py#L41-L60
[ "def", "set_style", "(", "key", ")", ":", "if", "key", "is", "None", ":", "return", "elif", "not", "key", "or", "key", "in", "[", "'unset'", ",", "'backup'", "]", ":", "if", "'backup'", "in", "styles", ":", "plt", ".", "rcParams", ".", "update", "(...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
ParamFilter.regexp_filter
Builds a parameter filter using the supplied pattern (may be a general Python regular expression)
holoviews/core/pprint.py
def regexp_filter(self_or_cls, pattern): """ Builds a parameter filter using the supplied pattern (may be a general Python regular expression) """ def inner_filter(name, p): name_match = re.search(pattern,name) if name_match is not None: re...
def regexp_filter(self_or_cls, pattern): """ Builds a parameter filter using the supplied pattern (may be a general Python regular expression) """ def inner_filter(name, p): name_match = re.search(pattern,name) if name_match is not None: re...
[ "Builds", "a", "parameter", "filter", "using", "the", "supplied", "pattern", "(", "may", "be", "a", "general", "Python", "regular", "expression", ")" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L61-L74
[ "def", "regexp_filter", "(", "self_or_cls", ",", "pattern", ")", ":", "def", "inner_filter", "(", "name", ",", "p", ")", ":", "name_match", "=", "re", ".", "search", "(", "pattern", ",", "name", ")", "if", "name_match", "is", "not", "None", ":", "retur...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
InfoPrinter.get_parameter_info
Get parameter information from the supplied class or object.
holoviews/core/pprint.py
def get_parameter_info(cls, obj, ansi=False, show_values=True, pattern=None, max_col_len=40): """ Get parameter information from the supplied class or object. """ if cls.ppager is None: return '' if pattern is not None: obj = ParamFilter(ob...
def get_parameter_info(cls, obj, ansi=False, show_values=True, pattern=None, max_col_len=40): """ Get parameter information from the supplied class or object. """ if cls.ppager is None: return '' if pattern is not None: obj = ParamFilter(ob...
[ "Get", "parameter", "information", "from", "the", "supplied", "class", "or", "object", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L89-L108
[ "def", "get_parameter_info", "(", "cls", ",", "obj", ",", "ansi", "=", "False", ",", "show_values", "=", "True", ",", "pattern", "=", "None", ",", "max_col_len", "=", "40", ")", ":", "if", "cls", ".", "ppager", "is", "None", ":", "return", "''", "if"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
InfoPrinter.heading
Turn the supplied heading text into a suitable heading with optional underline and color.
holoviews/core/pprint.py
def heading(cls, heading_text, char='=', level=0, ansi=False): """ Turn the supplied heading text into a suitable heading with optional underline and color. """ heading_color = cls.headings[level] if ansi else '%s' if char is None: return heading_color % '%s\n...
def heading(cls, heading_text, char='=', level=0, ansi=False): """ Turn the supplied heading text into a suitable heading with optional underline and color. """ heading_color = cls.headings[level] if ansi else '%s' if char is None: return heading_color % '%s\n...
[ "Turn", "the", "supplied", "heading", "text", "into", "a", "suitable", "heading", "with", "optional", "underline", "and", "color", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L111-L121
[ "def", "heading", "(", "cls", ",", "heading_text", ",", "char", "=", "'='", ",", "level", "=", "0", ",", "ansi", "=", "False", ")", ":", "heading_color", "=", "cls", ".", "headings", "[", "level", "]", "if", "ansi", "else", "'%s'", "if", "char", "i...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
InfoPrinter.info
Show information about an object in the given category. ANSI color codes may be enabled or disabled.
holoviews/core/pprint.py
def info(cls, obj, ansi=False, backend='matplotlib', visualization=True, pattern=None, elements=[]): """ Show information about an object in the given category. ANSI color codes may be enabled or disabled. """ cls.elements = elements ansi_escape = re.compile(...
def info(cls, obj, ansi=False, backend='matplotlib', visualization=True, pattern=None, elements=[]): """ Show information about an object in the given category. ANSI color codes may be enabled or disabled. """ cls.elements = elements ansi_escape = re.compile(...
[ "Show", "information", "about", "an", "object", "in", "the", "given", "category", ".", "ANSI", "color", "codes", "may", "be", "enabled", "or", "disabled", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L132-L171
[ "def", "info", "(", "cls", ",", "obj", ",", "ansi", "=", "False", ",", "backend", "=", "'matplotlib'", ",", "visualization", "=", "True", ",", "pattern", "=", "None", ",", "elements", "=", "[", "]", ")", ":", "cls", ".", "elements", "=", "elements", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PrettyPrinter.component_type
Return the type.group.label dotted information
holoviews/core/pprint.py
def component_type(cls_or_slf, node): "Return the type.group.label dotted information" if node is None: return '' return cls_or_slf.type_formatter.format(type=str(type(node).__name__))
def component_type(cls_or_slf, node): "Return the type.group.label dotted information" if node is None: return '' return cls_or_slf.type_formatter.format(type=str(type(node).__name__))
[ "Return", "the", "type", ".", "group", ".", "label", "dotted", "information" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L302-L305
[ "def", "component_type", "(", "cls_or_slf", ",", "node", ")", ":", "if", "node", "is", "None", ":", "return", "''", "return", "cls_or_slf", ".", "type_formatter", ".", "format", "(", "type", "=", "str", "(", "type", "(", "node", ")", ".", "__name__", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PrettyPrinter.recurse
Recursive function that builds up an ASCII tree given an AttrTree node.
holoviews/core/pprint.py
def recurse(cls_or_slf, node, attrpath=None, attrpaths=[], siblings=[], level=0, value_dims=True): """ Recursive function that builds up an ASCII tree given an AttrTree node. """ level, lines = cls_or_slf.node_info(node, attrpath, attrpaths, siblings, level, value_dims) a...
def recurse(cls_or_slf, node, attrpath=None, attrpaths=[], siblings=[], level=0, value_dims=True): """ Recursive function that builds up an ASCII tree given an AttrTree node. """ level, lines = cls_or_slf.node_info(node, attrpath, attrpaths, siblings, level, value_dims) a...
[ "Recursive", "function", "that", "builds", "up", "an", "ASCII", "tree", "given", "an", "AttrTree", "node", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L308-L319
[ "def", "recurse", "(", "cls_or_slf", ",", "node", ",", "attrpath", "=", "None", ",", "attrpaths", "=", "[", "]", ",", "siblings", "=", "[", "]", ",", "level", "=", "0", ",", "value_dims", "=", "True", ")", ":", "level", ",", "lines", "=", "cls_or_s...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PrettyPrinter.node_info
Given a node, return relevant information.
holoviews/core/pprint.py
def node_info(cls_or_slf, node, attrpath, attrpaths, siblings, level, value_dims): """ Given a node, return relevant information. """ opts = None if hasattr(node, 'children'): (lvl, lines) = (level, [(level, cls_or_slf.component_type(node))]) opts = cls_or...
def node_info(cls_or_slf, node, attrpath, attrpaths, siblings, level, value_dims): """ Given a node, return relevant information. """ opts = None if hasattr(node, 'children'): (lvl, lines) = (level, [(level, cls_or_slf.component_type(node))]) opts = cls_or...
[ "Given", "a", "node", "return", "relevant", "information", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L322-L351
[ "def", "node_info", "(", "cls_or_slf", ",", "node", ",", "attrpath", ",", "attrpaths", ",", "siblings", ",", "level", ",", "value_dims", ")", ":", "opts", "=", "None", "if", "hasattr", "(", "node", ",", "'children'", ")", ":", "(", "lvl", ",", "lines",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
PrettyPrinter.element_info
Return the information summary for an Element. This consists of the dotted name followed by an value dimension names.
holoviews/core/pprint.py
def element_info(cls_or_slf, node, siblings, level, value_dims): """ Return the information summary for an Element. This consists of the dotted name followed by an value dimension names. """ info = cls_or_slf.component_type(node) if len(node.kdims) >= 1: info ...
def element_info(cls_or_slf, node, siblings, level, value_dims): """ Return the information summary for an Element. This consists of the dotted name followed by an value dimension names. """ info = cls_or_slf.component_type(node) if len(node.kdims) >= 1: info ...
[ "Return", "the", "information", "summary", "for", "an", "Element", ".", "This", "consists", "of", "the", "dotted", "name", "followed", "by", "an", "value", "dimension", "names", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/core/pprint.py#L354-L364
[ "def", "element_info", "(", "cls_or_slf", ",", "node", ",", "siblings", ",", "level", ",", "value_dims", ")", ":", "info", "=", "cls_or_slf", ".", "component_type", "(", "node", ")", "if", "len", "(", "node", ".", "kdims", ")", ">=", "1", ":", "info", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
split_path
Split a Path type containing a single NaN separated path into multiple subpaths.
holoviews/element/util.py
def split_path(path): """ Split a Path type containing a single NaN separated path into multiple subpaths. """ path = path.split(0, 1)[0] values = path.dimension_values(0) splits = np.concatenate([[0], np.where(np.isnan(values))[0]+1, [None]]) subpaths = [] data = PandasInterface.as_...
def split_path(path): """ Split a Path type containing a single NaN separated path into multiple subpaths. """ path = path.split(0, 1)[0] values = path.dimension_values(0) splits = np.concatenate([[0], np.where(np.isnan(values))[0]+1, [None]]) subpaths = [] data = PandasInterface.as_...
[ "Split", "a", "Path", "type", "containing", "a", "single", "NaN", "separated", "path", "into", "multiple", "subpaths", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L21-L37
[ "def", "split_path", "(", "path", ")", ":", "path", "=", "path", ".", "split", "(", "0", ",", "1", ")", "[", "0", "]", "values", "=", "path", ".", "dimension_values", "(", "0", ")", "splits", "=", "np", ".", "concatenate", "(", "[", "[", "0", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
compute_slice_bounds
Given a 2D selection consisting of slices/coordinates, a SheetCoordinateSystem and the shape of the array returns a new BoundingBox representing the sliced region.
holoviews/element/util.py
def compute_slice_bounds(slices, scs, shape): """ Given a 2D selection consisting of slices/coordinates, a SheetCoordinateSystem and the shape of the array returns a new BoundingBox representing the sliced region. """ xidx, yidx = slices ys, xs = shape l, b, r, t = scs.bounds.lbrt() ...
def compute_slice_bounds(slices, scs, shape): """ Given a 2D selection consisting of slices/coordinates, a SheetCoordinateSystem and the shape of the array returns a new BoundingBox representing the sliced region. """ xidx, yidx = slices ys, xs = shape l, b, r, t = scs.bounds.lbrt() ...
[ "Given", "a", "2D", "selection", "consisting", "of", "slices", "/", "coordinates", "a", "SheetCoordinateSystem", "and", "the", "shape", "of", "the", "array", "returns", "a", "new", "BoundingBox", "representing", "the", "sliced", "region", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L40-L89
[ "def", "compute_slice_bounds", "(", "slices", ",", "scs", ",", "shape", ")", ":", "xidx", ",", "yidx", "=", "slices", "ys", ",", "xs", "=", "shape", "l", ",", "b", ",", "r", ",", "t", "=", "scs", ".", "bounds", ".", "lbrt", "(", ")", "xdensity", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
reduce_fn
Aggregation function to get the first non-zero value.
holoviews/element/util.py
def reduce_fn(x): """ Aggregation function to get the first non-zero value. """ values = x.values if pd and isinstance(x, pd.Series) else x for v in values: if not is_nan(v): return v return np.NaN
def reduce_fn(x): """ Aggregation function to get the first non-zero value. """ values = x.values if pd and isinstance(x, pd.Series) else x for v in values: if not is_nan(v): return v return np.NaN
[ "Aggregation", "function", "to", "get", "the", "first", "non", "-", "zero", "value", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L92-L100
[ "def", "reduce_fn", "(", "x", ")", ":", "values", "=", "x", ".", "values", "if", "pd", "and", "isinstance", "(", "x", ",", "pd", ".", "Series", ")", "else", "x", "for", "v", "in", "values", ":", "if", "not", "is_nan", "(", "v", ")", ":", "retur...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
circular_layout
Lay out nodes on a circle and add node index.
holoviews/element/util.py
def circular_layout(nodes): """ Lay out nodes on a circle and add node index. """ N = len(nodes) if not N: return ([], [], []) circ = np.pi/N*np.arange(N)*2 x = np.cos(circ) y = np.sin(circ) return (x, y, nodes)
def circular_layout(nodes): """ Lay out nodes on a circle and add node index. """ N = len(nodes) if not N: return ([], [], []) circ = np.pi/N*np.arange(N)*2 x = np.cos(circ) y = np.sin(circ) return (x, y, nodes)
[ "Lay", "out", "nodes", "on", "a", "circle", "and", "add", "node", "index", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L219-L229
[ "def", "circular_layout", "(", "nodes", ")", ":", "N", "=", "len", "(", "nodes", ")", "if", "not", "N", ":", "return", "(", "[", "]", ",", "[", "]", ",", "[", "]", ")", "circ", "=", "np", ".", "pi", "/", "N", "*", "np", ".", "arange", "(", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
quadratic_bezier
Compute quadratic bezier spline given start and end coordinate and two control points.
holoviews/element/util.py
def quadratic_bezier(start, end, c0=(0, 0), c1=(0, 0), steps=50): """ Compute quadratic bezier spline given start and end coordinate and two control points. """ steps = np.linspace(0, 1, steps) sx, sy = start ex, ey = end cx0, cy0 = c0 cx1, cy1 = c1 xs = ((1-steps)**3*sx + 3*((1-...
def quadratic_bezier(start, end, c0=(0, 0), c1=(0, 0), steps=50): """ Compute quadratic bezier spline given start and end coordinate and two control points. """ steps = np.linspace(0, 1, steps) sx, sy = start ex, ey = end cx0, cy0 = c0 cx1, cy1 = c1 xs = ((1-steps)**3*sx + 3*((1-...
[ "Compute", "quadratic", "bezier", "spline", "given", "start", "and", "end", "coordinate", "and", "two", "control", "points", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L232-L246
[ "def", "quadratic_bezier", "(", "start", ",", "end", ",", "c0", "=", "(", "0", ",", "0", ")", ",", "c1", "=", "(", "0", ",", "0", ")", ",", "steps", "=", "50", ")", ":", "steps", "=", "np", ".", "linspace", "(", "0", ",", "1", ",", "steps",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
connect_edges_pd
Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation depends on pandas and is a lot faster than the pure NumPy equivalent.
holoviews/element/util.py
def connect_edges_pd(graph): """ Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation depends on pandas and is a lot faster than the pure NumPy equivalent. """ edges = graph.dframe() edges.index.name = 'grap...
def connect_edges_pd(graph): """ Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation depends on pandas and is a lot faster than the pure NumPy equivalent. """ edges = graph.dframe() edges.index.name = 'grap...
[ "Given", "a", "Graph", "element", "containing", "abstract", "edges", "compute", "edge", "segments", "directly", "connecting", "the", "source", "and", "target", "nodes", ".", "This", "operation", "depends", "on", "pandas", "and", "is", "a", "lot", "faster", "th...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L249-L275
[ "def", "connect_edges_pd", "(", "graph", ")", ":", "edges", "=", "graph", ".", "dframe", "(", ")", "edges", ".", "index", ".", "name", "=", "'graph_edge_index'", "edges", "=", "edges", ".", "reset_index", "(", ")", "nodes", "=", "graph", ".", "nodes", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
connect_edges
Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation just uses internal HoloViews operations and will be a lot slower than the pandas equivalent.
holoviews/element/util.py
def connect_edges(graph): """ Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation just uses internal HoloViews operations and will be a lot slower than the pandas equivalent. """ paths = [] for start, end ...
def connect_edges(graph): """ Given a Graph element containing abstract edges compute edge segments directly connecting the source and target nodes. This operation just uses internal HoloViews operations and will be a lot slower than the pandas equivalent. """ paths = [] for start, end ...
[ "Given", "a", "Graph", "element", "containing", "abstract", "edges", "compute", "edge", "segments", "directly", "connecting", "the", "source", "and", "target", "nodes", ".", "This", "operation", "just", "uses", "internal", "HoloViews", "operations", "and", "will",...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L278-L294
[ "def", "connect_edges", "(", "graph", ")", ":", "paths", "=", "[", "]", "for", "start", ",", "end", "in", "graph", ".", "array", "(", "graph", ".", "kdims", ")", ":", "start_ds", "=", "graph", ".", "nodes", "[", ":", ",", ":", ",", "start", "]", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
categorical_aggregate2d._get_coords
Get the coordinates of the 2D aggregate, maintaining the correct sorting order.
holoviews/element/util.py
def _get_coords(self, obj): """ Get the coordinates of the 2D aggregate, maintaining the correct sorting order. """ xdim, ydim = obj.dimensions(label=True)[:2] xcoords = obj.dimension_values(xdim, False) ycoords = obj.dimension_values(ydim, False) # Deter...
def _get_coords(self, obj): """ Get the coordinates of the 2D aggregate, maintaining the correct sorting order. """ xdim, ydim = obj.dimensions(label=True)[:2] xcoords = obj.dimension_values(xdim, False) ycoords = obj.dimension_values(ydim, False) # Deter...
[ "Get", "the", "coordinates", "of", "the", "2D", "aggregate", "maintaining", "the", "correct", "sorting", "order", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L126-L158
[ "def", "_get_coords", "(", "self", ",", "obj", ")", ":", "xdim", ",", "ydim", "=", "obj", ".", "dimensions", "(", "label", "=", "True", ")", "[", ":", "2", "]", "xcoords", "=", "obj", ".", "dimension_values", "(", "xdim", ",", "False", ")", "ycoord...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
categorical_aggregate2d._aggregate_dataset
Generates a gridded Dataset from a column-based dataset and lists of xcoords and ycoords
holoviews/element/util.py
def _aggregate_dataset(self, obj, xcoords, ycoords): """ Generates a gridded Dataset from a column-based dataset and lists of xcoords and ycoords """ dim_labels = obj.dimensions(label=True) vdims = obj.dimensions()[2:] xdim, ydim = dim_labels[:2] shape = (...
def _aggregate_dataset(self, obj, xcoords, ycoords): """ Generates a gridded Dataset from a column-based dataset and lists of xcoords and ycoords """ dim_labels = obj.dimensions(label=True) vdims = obj.dimensions()[2:] xdim, ydim = dim_labels[:2] shape = (...
[ "Generates", "a", "gridded", "Dataset", "from", "a", "column", "-", "based", "dataset", "and", "lists", "of", "xcoords", "and", "ycoords" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L161-L196
[ "def", "_aggregate_dataset", "(", "self", ",", "obj", ",", "xcoords", ",", "ycoords", ")", ":", "dim_labels", "=", "obj", ".", "dimensions", "(", "label", "=", "True", ")", "vdims", "=", "obj", ".", "dimensions", "(", ")", "[", "2", ":", "]", "xdim",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
categorical_aggregate2d._process
Generates a categorical 2D aggregate by inserting NaNs at all cross-product locations that do not already have a value assigned. Returns a 2D gridded Dataset object.
holoviews/element/util.py
def _process(self, obj, key=None): """ Generates a categorical 2D aggregate by inserting NaNs at all cross-product locations that do not already have a value assigned. Returns a 2D gridded Dataset object. """ if isinstance(obj, Dataset) and obj.interface.gridded: ...
def _process(self, obj, key=None): """ Generates a categorical 2D aggregate by inserting NaNs at all cross-product locations that do not already have a value assigned. Returns a 2D gridded Dataset object. """ if isinstance(obj, Dataset) and obj.interface.gridded: ...
[ "Generates", "a", "categorical", "2D", "aggregate", "by", "inserting", "NaNs", "at", "all", "cross", "-", "product", "locations", "that", "do", "not", "already", "have", "a", "value", "assigned", ".", "Returns", "a", "2D", "gridded", "Dataset", "object", "."...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/util.py#L199-L216
[ "def", "_process", "(", "self", ",", "obj", ",", "key", "=", "None", ")", ":", "if", "isinstance", "(", "obj", ",", "Dataset", ")", "and", "obj", ".", "interface", ".", "gridded", ":", "return", "obj", "elif", "obj", ".", "ndims", ">", "2", ":", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
TablePlot.initialize_plot
Initializes a new plot object with the last available frame.
holoviews/plotting/bokeh/tabular.py
def initialize_plot(self, ranges=None, plot=None, plots=None, source=None): """ Initializes a new plot object with the last available frame. """ # Get element key and ranges for frame element = self.hmap.last key = self.keys[-1] self.current_frame = element ...
def initialize_plot(self, ranges=None, plot=None, plots=None, source=None): """ Initializes a new plot object with the last available frame. """ # Get element key and ranges for frame element = self.hmap.last key = self.keys[-1] self.current_frame = element ...
[ "Initializes", "a", "new", "plot", "object", "with", "the", "last", "available", "frame", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/tabular.py#L53-L89
[ "def", "initialize_plot", "(", "self", ",", "ranges", "=", "None", ",", "plot", "=", "None", ",", "plots", "=", "None", ",", "source", "=", "None", ")", ":", "# Get element key and ranges for frame", "element", "=", "self", ".", "hmap", ".", "last", "key",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
TablePlot.update_frame
Updates an existing plot with data corresponding to the key.
holoviews/plotting/bokeh/tabular.py
def update_frame(self, key, ranges=None, plot=None): """ Updates an existing plot with data corresponding to the key. """ element = self._get_frame(key) self._get_title_div(key, '12pt') # Cache frame object id to skip updating data if unchanged previous_i...
def update_frame(self, key, ranges=None, plot=None): """ Updates an existing plot with data corresponding to the key. """ element = self._get_frame(key) self._get_title_div(key, '12pt') # Cache frame object id to skip updating data if unchanged previous_i...
[ "Updates", "an", "existing", "plot", "with", "data", "corresponding", "to", "the", "key", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/plotting/bokeh/tabular.py#L116-L138
[ "def", "update_frame", "(", "self", ",", "key", ",", "ranges", "=", "None", ",", "plot", "=", "None", ")", ":", "element", "=", "self", ".", "_get_frame", "(", "key", ")", "self", ".", "_get_title_div", "(", "key", ",", "'12pt'", ")", "# Cache frame ob...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Raster.dimension_values
The set of samples available along a particular dimension.
holoviews/element/raster.py
def dimension_values(self, dim, expanded=True, flat=True): """ The set of samples available along a particular dimension. """ dim_idx = self.get_dimension_index(dim) if not expanded and dim_idx == 0: return np.array(range(self.data.shape[1])) elif not expanded...
def dimension_values(self, dim, expanded=True, flat=True): """ The set of samples available along a particular dimension. """ dim_idx = self.get_dimension_index(dim) if not expanded and dim_idx == 0: return np.array(range(self.data.shape[1])) elif not expanded...
[ "The", "set", "of", "samples", "available", "along", "a", "particular", "dimension", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L87-L103
[ "def", "dimension_values", "(", "self", ",", "dim", ",", "expanded", "=", "True", ",", "flat", "=", "True", ")", ":", "dim_idx", "=", "self", ".", "get_dimension_index", "(", "dim", ")", "if", "not", "expanded", "and", "dim_idx", "==", "0", ":", "retur...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Raster.sample
Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value of the sampled unit indexed by the value in the new_xaxis ...
holoviews/element/raster.py
def sample(self, samples=[], **sample_values): """ Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value ...
def sample(self, samples=[], **sample_values): """ Sample the Raster along one or both of its dimensions, returning a reduced dimensionality type, which is either a ItemTable, Curve or Scatter. If two dimension samples and a new_xaxis is provided the sample will be the value ...
[ "Sample", "the", "Raster", "along", "one", "or", "both", "of", "its", "dimensions", "returning", "a", "reduced", "dimensionality", "type", "which", "is", "either", "a", "ItemTable", "Curve", "or", "Scatter", ".", "If", "two", "dimension", "samples", "and", "...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L119-L169
[ "def", "sample", "(", "self", ",", "samples", "=", "[", "]", ",", "*", "*", "sample_values", ")", ":", "if", "isinstance", "(", "samples", ",", "tuple", ")", ":", "X", ",", "Y", "=", "samples", "samples", "=", "zip", "(", "X", ",", "Y", ")", "p...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Raster.reduce
Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label.
holoviews/element/raster.py
def reduce(self, dimensions=None, function=None, **reduce_map): """ Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label. """ ...
def reduce(self, dimensions=None, function=None, **reduce_map): """ Reduces the Raster using functions provided via the kwargs, where the keyword is the dimension to be reduced. Optionally a label_prefix can be provided to prepend to the result Element label. """ ...
[ "Reduces", "the", "Raster", "using", "functions", "provided", "via", "the", "kwargs", "where", "the", "keyword", "is", "the", "dimension", "to", "be", "reduced", ".", "Optionally", "a", "label_prefix", "can", "be", "provided", "to", "prepend", "to", "the", "...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L172-L198
[ "def", "reduce", "(", "self", ",", "dimensions", "=", "None", ",", "function", "=", "None", ",", "*", "*", "reduce_map", ")", ":", "function", ",", "dims", "=", "self", ".", "_reduce_map", "(", "dimensions", ",", "function", ",", "reduce_map", ")", "if...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Image.clone
Returns a clone of the object with matching parameter values containing the specified args and kwargs. If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
holoviews/element/raster.py
def clone(self, data=None, shared_data=True, new_type=None, link=True, *args, **overrides): """ Returns a clone of the object with matching parameter values containing the specified args and kwargs. If shared_data is set to True and no data explicitly supplied, the...
def clone(self, data=None, shared_data=True, new_type=None, link=True, *args, **overrides): """ Returns a clone of the object with matching parameter values containing the specified args and kwargs. If shared_data is set to True and no data explicitly supplied, the...
[ "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/raster.py#L413-L428
[ "def", "clone", "(", "self", ",", "data", "=", "None", ",", "shared_data", "=", "True", ",", "new_type", "=", "None", ",", "link", "=", "True", ",", "*", "args", ",", "*", "*", "overrides", ")", ":", "if", "data", "is", "None", "and", "(", "new_t...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Image.select
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) ...
holoviews/element/raster.py
def select(self, selection_specs=None, **selection): """ Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the...
def select(self, selection_specs=None, **selection): """ Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the...
[ "Allows", "selecting", "data", "by", "the", "slices", "sets", "and", "scalar", "values", "along", "a", "particular", "dimension", ".", "The", "indices", "should", "be", "supplied", "as", "keywords", "mapping", "between", "the", "selected", "dimension", "and", ...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L436-L483
[ "def", "select", "(", "self", ",", "selection_specs", "=", "None", ",", "*", "*", "selection", ")", ":", "if", "selection_specs", "and", "not", "any", "(", "self", ".", "matches", "(", "sp", ")", "for", "sp", "in", "selection_specs", ")", ":", "return"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Image.sample
Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coordinates are continuously indexed and will always sn...
holoviews/element/raster.py
def sample(self, samples=[], **kwargs): """ Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coo...
def sample(self, samples=[], **kwargs): """ Allows sampling of an Image as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. On an Image the coo...
[ "Allows", "sampling", "of", "an", "Image", "as", "an", "iterator", "of", "coordinates", "matching", "the", "key", "dimensions", "returning", "a", "new", "object", "containing", "just", "the", "selected", "samples", ".", "Alternatively", "may", "supply", "kwargs"...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L486-L541
[ "def", "sample", "(", "self", ",", "samples", "=", "[", "]", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "{", "k", ":", "v", "for", "k", ",", "v", "in", "kwargs", ".", "items", "(", ")", "if", "k", "!=", "'closest'", "}", "if", "kwargs"...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
Image.closest
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates.
holoviews/element/raster.py
def closest(self, coords=[], **kwargs): """ Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. """ if kwargs and coords: raise...
def closest(self, coords=[], **kwargs): """ Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. """ if kwargs and coords: raise...
[ "Given", "a", "single", "coordinate", "or", "multiple", "coordinates", "as", "a", "tuple", "or", "list", "of", "tuples", "or", "keyword", "arguments", "matching", "the", "dimension", "closest", "will", "find", "the", "closest", "actual", "x", "/", "y", "coor...
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L544-L578
[ "def", "closest", "(", "self", ",", "coords", "=", "[", "]", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", "and", "coords", ":", "raise", "ValueError", "(", "\"Specify coordinate using as either a list \"", "\"keyword arguments not both\"", ")", "if", "kwar...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
RGB.load_image
Returns an raster element or raw numpy array from a PNG image file, using matplotlib. The specified height determines the bounds of the raster object in sheet coordinates: by default the height is 1 unit with the width scaled appropriately by the image aspect ratio. Note that a...
holoviews/element/raster.py
def load_image(cls, filename, height=1, array=False, bounds=None, bare=False, **kwargs): """ Returns an raster element or raw numpy array from a PNG image file, using matplotlib. The specified height determines the bounds of the raster object in sheet coordinates: by default the...
def load_image(cls, filename, height=1, array=False, bounds=None, bare=False, **kwargs): """ Returns an raster element or raw numpy array from a PNG image file, using matplotlib. The specified height determines the bounds of the raster object in sheet coordinates: by default the...
[ "Returns", "an", "raster", "element", "or", "raw", "numpy", "array", "from", "a", "PNG", "image", "file", "using", "matplotlib", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L681-L715
[ "def", "load_image", "(", "cls", ",", "filename", ",", "height", "=", "1", ",", "array", "=", "False", ",", "bounds", "=", "None", ",", "bare", "=", "False", ",", "*", "*", "kwargs", ")", ":", "try", ":", "from", "matplotlib", "import", "pyplot", "...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
HSV.rgb
Conversion from HSV to RGB.
holoviews/element/raster.py
def rgb(self): """ Conversion from HSV to RGB. """ coords = tuple(self.dimension_values(d, expanded=False) for d in self.kdims) data = [self.dimension_values(d, flat=False) for d in self.vdims] hsv = self.hsv_to_rgb(*data[:3]) ...
def rgb(self): """ Conversion from HSV to RGB. """ coords = tuple(self.dimension_values(d, expanded=False) for d in self.kdims) data = [self.dimension_values(d, flat=False) for d in self.vdims] hsv = self.hsv_to_rgb(*data[:3]) ...
[ "Conversion", "from", "HSV", "to", "RGB", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L789-L806
[ "def", "rgb", "(", "self", ")", ":", "coords", "=", "tuple", "(", "self", ".", "dimension_values", "(", "d", ",", "expanded", "=", "False", ")", "for", "d", "in", "self", ".", "kdims", ")", "data", "=", "[", "self", ".", "dimension_values", "(", "d...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
QuadMesh.trimesh
Converts a QuadMesh into a TriMesh.
holoviews/element/raster.py
def trimesh(self): """ Converts a QuadMesh into a TriMesh. """ # Generate vertices xs = self.interface.coords(self, 0, edges=True) ys = self.interface.coords(self, 1, edges=True) if xs.ndim == 1: if np.all(xs[1:] < xs[:-1]): xs = xs[::...
def trimesh(self): """ Converts a QuadMesh into a TriMesh. """ # Generate vertices xs = self.interface.coords(self, 0, edges=True) ys = self.interface.coords(self, 1, edges=True) if xs.ndim == 1: if np.all(xs[1:] < xs[:-1]): xs = xs[::...
[ "Converts", "a", "QuadMesh", "into", "a", "TriMesh", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/element/raster.py#L867-L910
[ "def", "trimesh", "(", "self", ")", ":", "# Generate vertices", "xs", "=", "self", ".", "interface", ".", "coords", "(", "self", ",", "0", ",", "edges", "=", "True", ")", "ys", "=", "self", ".", "interface", ".", "coords", "(", "self", ",", "1", ",...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
notebook_extension.completions_sorting_key
Fixed version of IPyton.completer.completions_sorting_key
holoviews/ipython/__init__.py
def completions_sorting_key(cls, word): "Fixed version of IPyton.completer.completions_sorting_key" prio1, prio2 = 0, 0 if word.startswith('__'): prio1 = 2 elif word.startswith('_'): prio1 = 1 if word.endswith('='): prio1 = -1 if word.startswith('%%'): if...
def completions_sorting_key(cls, word): "Fixed version of IPyton.completer.completions_sorting_key" prio1, prio2 = 0, 0 if word.startswith('__'): prio1 = 2 elif word.startswith('_'): prio1 = 1 if word.endswith('='): prio1 = -1 if word.startswith('%%'): if...
[ "Fixed", "version", "of", "IPyton", ".", "completer", ".", "completions_sorting_key" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/__init__.py#L197-L209
[ "def", "completions_sorting_key", "(", "cls", ",", "word", ")", ":", "prio1", ",", "prio2", "=", "0", ",", "0", "if", "word", ".", "startswith", "(", "'__'", ")", ":", "prio1", "=", "2", "elif", "word", ".", "startswith", "(", "'_'", ")", ":", "pri...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
notebook_extension._get_resources
Finds the list of resources from the keyword parameters and pops them out of the params dictionary.
holoviews/ipython/__init__.py
def _get_resources(self, args, params): """ Finds the list of resources from the keyword parameters and pops them out of the params dictionary. """ resources = [] disabled = [] for resource in ['holoviews'] + list(Store.renderers.keys()): if resource i...
def _get_resources(self, args, params): """ Finds the list of resources from the keyword parameters and pops them out of the params dictionary. """ resources = [] disabled = [] for resource in ['holoviews'] + list(Store.renderers.keys()): if resource i...
[ "Finds", "the", "list", "of", "resources", "from", "the", "keyword", "parameters", "and", "pops", "them", "out", "of", "the", "params", "dictionary", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/__init__.py#L212-L239
[ "def", "_get_resources", "(", "self", ",", "args", ",", "params", ")", ":", "resources", "=", "[", "]", "disabled", "=", "[", "]", "for", "resource", "in", "[", "'holoviews'", "]", "+", "list", "(", "Store", ".", "renderers", ".", "keys", "(", ")", ...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
notebook_extension.load_hvjs
Displays javascript and CSS to initialize HoloViews widgets.
holoviews/ipython/__init__.py
def load_hvjs(cls, logo=False, bokeh_logo=False, mpl_logo=False, plotly_logo=False, JS=True, message='HoloViewsJS successfully loaded.'): """ Displays javascript and CSS to initialize HoloViews widgets. """ import jinja2 # Evaluate load_notebook.html template wi...
def load_hvjs(cls, logo=False, bokeh_logo=False, mpl_logo=False, plotly_logo=False, JS=True, message='HoloViewsJS successfully loaded.'): """ Displays javascript and CSS to initialize HoloViews widgets. """ import jinja2 # Evaluate load_notebook.html template wi...
[ "Displays", "javascript", "and", "CSS", "to", "initialize", "HoloViews", "widgets", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/__init__.py#L242-L277
[ "def", "load_hvjs", "(", "cls", ",", "logo", "=", "False", ",", "bokeh_logo", "=", "False", ",", "mpl_logo", "=", "False", ",", "plotly_logo", "=", "False", ",", "JS", "=", "True", ",", "message", "=", "'HoloViewsJS successfully loaded.'", ")", ":", "impor...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
notebook_extension.tab_completion_docstring
Generates a docstring that can be used to enable tab-completion of resources.
holoviews/ipython/__init__.py
def tab_completion_docstring(self_or_cls): """ Generates a docstring that can be used to enable tab-completion of resources. """ elements = ['%s=Boolean' %k for k in list(Store.renderers.keys())] for name, p in self_or_cls.params().items(): param_type = p.__cl...
def tab_completion_docstring(self_or_cls): """ Generates a docstring that can be used to enable tab-completion of resources. """ elements = ['%s=Boolean' %k for k in list(Store.renderers.keys())] for name, p in self_or_cls.params().items(): param_type = p.__cl...
[ "Generates", "a", "docstring", "that", "can", "be", "used", "to", "enable", "tab", "-", "completion", "of", "resources", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/__init__.py#L281-L291
[ "def", "tab_completion_docstring", "(", "self_or_cls", ")", ":", "elements", "=", "[", "'%s=Boolean'", "%", "k", "for", "k", "in", "list", "(", "Store", ".", "renderers", ".", "keys", "(", ")", ")", "]", "for", "name", ",", "p", "in", "self_or_cls", "....
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptsCompleter.setup_completer
Get the dictionary of valid completions
holoviews/ipython/magics.py
def setup_completer(cls): "Get the dictionary of valid completions" try: for element in Store.options().keys(): options = Store.options()['.'.join(element)] plotkws = options['plot'].allowed_keywords stylekws = options['style'].allowed_keywords...
def setup_completer(cls): "Get the dictionary of valid completions" try: for element in Store.options().keys(): options = Store.options()['.'.join(element)] plotkws = options['plot'].allowed_keywords stylekws = options['style'].allowed_keywords...
[ "Get", "the", "dictionary", "of", "valid", "completions" ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/magics.py#L161-L172
[ "def", "setup_completer", "(", "cls", ")", ":", "try", ":", "for", "element", "in", "Store", ".", "options", "(", ")", ".", "keys", "(", ")", ":", "options", "=", "Store", ".", "options", "(", ")", "[", "'.'", ".", "join", "(", "element", ")", "]...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655
train
OptsCompleter.dotted_completion
Supply the appropriate key in Store.options and supply suggestions for further completion.
holoviews/ipython/magics.py
def dotted_completion(cls, line, sorted_keys, compositor_defs): """ Supply the appropriate key in Store.options and supply suggestions for further completion. """ completion_key, suggestions = None, [] tokens = [t for t in reversed(line.replace('.', ' ').split())] ...
def dotted_completion(cls, line, sorted_keys, compositor_defs): """ Supply the appropriate key in Store.options and supply suggestions for further completion. """ completion_key, suggestions = None, [] tokens = [t for t in reversed(line.replace('.', ' ').split())] ...
[ "Supply", "the", "appropriate", "key", "in", "Store", ".", "options", "and", "supply", "suggestions", "for", "further", "completion", "." ]
pyviz/holoviews
python
https://github.com/pyviz/holoviews/blob/ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655/holoviews/ipython/magics.py#L175-L202
[ "def", "dotted_completion", "(", "cls", ",", "line", ",", "sorted_keys", ",", "compositor_defs", ")", ":", "completion_key", ",", "suggestions", "=", "None", ",", "[", "]", "tokens", "=", "[", "t", "for", "t", "in", "reversed", "(", "line", ".", "replace...
ae0dd2f3de448b0ca5e9065aabd6ef8d84c7e655