holoviews.core Package


core Package

class holoviews.core. Operation ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

An Operation process an Element or HoloMap at the level of individual elements or overlays. If a holomap is passed in as input, a processed holomap is returned as output where the individual elements have been transformed accordingly. An Operation may turn overlays in new elements or vice versa.

An Operation can be set to be dynamic, which will return a DynamicMap with a callback that will apply the operation dynamically. An Operation may also supply a list of Stream classes on a streams parameter, which can allow dynamic control over the parameters on the operation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Operation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The group string used to identify the output of the Operation. By default this should match the operation name.
param ObjectSelector dynamic ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=default, instantiate=False, names=None, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.
param ClassSelector input_ranges ( allow_None=True, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.
param Boolean link_inputs ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
param List streams ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
classmethod get_overlay_bounds ( overlay ) [source]

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label ( overlay , default_label='' ) [source]

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.operation.Operation'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

process_element ( element , key , **params ) [source]

The process_element method allows a single element to be operated on given an externally supplied key.

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search ( element , pattern ) [source]

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. CompositeOverlay ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableElement , holoviews.core.layout.Composable

CompositeOverlay provides a common baseclass for Overlay classes.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. AdjointLayout ( data , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

An AdjointLayout provides a convenient container to lay out some marginal plots next to a primary plot. This is often useful to display the marginal distributions of a plot next to the primary plot. AdjointLayout accepts a list of up to three elements, which are laid out as follows with the names ‘main’, ‘top’ and ‘right’:

3 | |

|___________|___| | | | 1: main | | | 2: right | 1 | 2 | 3: top | | | |___________|___|

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘AdjointLayout’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Applies to the main object in the AdjointLayout.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
get ( key , default=None ) [source]

Returns the viewable corresponding to the supplied string or integer based key.

Args:
key: Numeric or string index: 0) ‘main’ 1) ‘right’ 2) ‘top’ default: Value returned if key not found
Returns:
Indexed value or supplied default
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
group

Group inherited from main element

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
label

Label inherited from main element

main

Returns the main element in the AdjointLayout

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to child up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
right

Returns the right marginal element in the AdjointLayout

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

top

Returns the top marginal element in the AdjointLayout

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. NdOverlay ( overlays=None , kdims=None , **params ) [source]

Bases: holoviews.core.overlay.Overlayable , holoviews.core.ndmapping.UniformNdMapping , holoviews.core.overlay.CompositeOverlay

An NdOverlay allows a group of NdOverlay to be overlaid together. NdOverlay can be indexed out of an overlay and an overlay is an iterable that iterates over the contained layers.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Element’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of dimensions the NdOverlay can be indexed by.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. ViewableTree ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.tree.AttrTree , holoviews.core.dimension.Dimensioned

A ViewableTree is an AttrTree with Viewable objects as its leaf nodes. It combines the tree like data structure of a tree while extending it with the deep indexable properties of Dimensioned and LabelledData objects.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableTree, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
classmethod from_values ( vals ) [source]

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group ) [source]

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. ViewableElement ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

A ViewableElement is a dimensioned datastructure that may be associated with a corresponding atomic visualization. An atomic visualization will display the data on a single set of axes (i.e. excludes multiple subplots that are displayed at once). The only new parameter introduced by ViewableElement is the title associated with the object for display.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. Dimensioned ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.LabelledData

Dimensioned is a base class that allows the data contents of a class to be associated with dimensions. The contents associated with dimensions may be partitioned into one of three types

  • key dimensions: These are the dimensions that can be indexed via

    the __getitem__ method. Dimension objects supporting key dimensions must support indexing over these dimensions and may also support slicing. This list ordering of dimensions describes the positional components of each multi-dimensional indexing operation.

    For instance, if the key dimension names are ‘weight’ followed by ‘height’ for Dimensioned object ‘obj’, then obj[80,175] indexes a weight of 80 and height of 175.

    Accessed using either kdims.

  • value dimensions: These dimensions correspond to any data held

    on the Dimensioned object not in the key dimensions. Indexing by value dimension is supported by dimension name (when there are multiple possible value dimensions); no slicing semantics is supported and all the data associated with that dimension will be returned at once. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either vdims.

  • deep dimensions: These are dynamically computed dimensions that

    belong to other Dimensioned objects that are nested in the data. Objects that support this should enable the _deep_indexable flag. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either ddims.

Dimensioned class support generalized methods for finding the range and type of values along a particular Dimension. The range method relies on the appropriate implementation of the dimension_values methods on subclasses.

The index of an arbitrary dimension is its positional index in the list of all dimensions, starting with the key dimensions, followed by the value dimensions and ending with the deep dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False ) [source]

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_dimension ( dimension , default=None , strict=False ) [source]

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension ) [source]

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. SheetCoordinateSystem ( bounds , xdensity , ydensity=None ) [source]

Bases: object

Provides methods to allow conversion between sheet and matrix coordinates.

closest_cell_center ( x , y ) [source]

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

matrix2sheet ( float_row , float_col ) [source]

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().

matrixidx2sheet ( row , col ) [source]

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 sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

sheet2matrix ( x , y ) [source]

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,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y ) [source]

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 coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( ) [source]

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.

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.core. NdLayout ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping

NdLayout is a UniformNdMapping providing an n-dimensional data structure to display the contained Elements and containers in a layout. Using the cols method the NdLayout can be rearranged with the desired number of columns.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( *args , **overrides ) [source]

Clones the NdLayout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned NdLayout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
grid_items ( ) [source]

Compute a dict of {(row,column): (key, value)} elements from the current set of items and specified number of columns.

group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns another NdLayout constituted of the last views of the individual elements (if they are maps).

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
shape

Tuple indicating the number of rows and columns in the NdLayout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. GridMatrix ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.spaces.GridSpace

GridMatrix is container type for heterogeneous Element types laid out in a grid. Unlike a GridSpace the axes of the Grid must not represent an actual coordinate space, but may be used to plot various dimensions against each other. The GridMatrix is usually constructed using the gridmatrix operation, which will generate a GridMatrix plotting each dimension in an Element against each other.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘X’), Dimension(‘Y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( full_grid=False )

Returns the keys of the GridSpace

Args:
full_grid (bool, optional): Return full cross-product of keys
Returns:
List of keys
label

Label inherited from items

last

The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
shape

Returns the 2D shape of the GridSpace as (rows, cols).

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. Dataset ( data , kdims=None , vdims=None , **kwargs ) [source]

Bases: holoviews.core.element.Element

Dataset provides a general baseclass for Element types that contain structured data and supports a range of data formats.

The Dataset class supports various methods offering a consistent way of working with the stored data regardless of the storage format used. These operations include indexing, selection and various ways of aggregating or collapsing the data with a supplied function.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dataset, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param List datatype ( allow_None=False, bounds=(0, None), constant=False, default=[‘dataframe’, ‘dictionary’, ‘grid’, ‘xarray’, ‘dask’, ‘array’, ‘multitabular’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A priority list of the data types to be used for storage on the .data attribute. If the input supplied to the element constructor cannot be put into the requested format, the next format listed will be used until a suitable format is found (or the data fails to be understood).
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs ) [source]

Adds a dimension and its values to the Dataset

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or array of values, matching the length o shape of the Dataset.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
aggregate ( dimensions=None , function=None , spreadfn=None , **kwargs ) [source]

Aggregates data on the supplied dimensions.

Aggregates over the supplied key dimensions with the defined function.

Args:
dimensions: Dimension(s) to aggregate on
Default to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the aggregated Dataset
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned object
closest ( coords=[] , **kwargs ) [source]

Snaps coordinate(s) to closest coordinate in Dataset

Args:
coords: List of coordinates expressed as tuples ** kwargs: Coordinates defined as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

columns ( dimensions=None ) [source]

Convert dimension values to a dictionary.

Returns a dictionary of column arrays along each dimension of the element.

Args:
dimensions: Dimensions to return as columns
Returns:
Dictionary of arrays for each dimension
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
groupby ( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) [source]

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
iloc

Returns iloc indexer with support for columnar indexing.

Returns an iloc object providing a convenient interface to slice and index into the Dataset using row and column indices. Allow selection by integer index, slice and list of integer indices and boolean arrays.

Examples:

  • Index the first row and column:

    dataset.iloc[0, 0]

  • Select rows 1 and 2 with a slice:

    dataset.iloc[1:3, :]

  • Select with a list of integer coordinates:

    dataset.iloc[[0, 2, 3]]

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

ndloc

Returns ndloc indexer with support for gridded indexing.

Returns an ndloc object providing nd-array like indexing for gridded datasets. Follows NumPy array indexing conventions, allowing for indexing, slicing and selecting a list of indices on multi-dimensional arrays using integer indices. The order of array indices is inverted relative to the Dataset key dimensions, e.g. an Image with key dimensions ‘x’ and ‘y’ can be indexed with image.ndloc[iy, ix] , where iy and ix are integer indices along the y and x dimensions.

Examples:

  • Index value in 2D array:

    dataset.ndloc[3, 1]

  • Slice along y-axis of 2D array:

    dataset.ndloc[2:5, :]

  • Vectorized (non-orthogonal) indexing along x- and y-axes:

    dataset.ndloc[[1, 2, 3], [0, 2, 3]]

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dim , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reductions ) [source]

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=None , vdims=None ) [source]

Reindexes Dataset dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.x

Args:
kdims (optional): New list of key dimensionsx vdims (optional): New list of value dimensions
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=True , **kwargs ) [source]

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **selection ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.data.Dataset'>)
shape

Returns the shape of the data.

sort ( by=None , reverse=False ) [source]

Sorts the data by the values along the supplied dimensions.

Args:
by: Dimension(s) to sort by reverse (bool, optional): Reverse sort order
Returns:
Sorted Dataset
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

to

Returns the conversion interface with methods to convert Dataset

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. Overlay ( items=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableTree , holoviews.core.overlay.CompositeOverlay

An Overlay consists of multiple Elements (potentially of heterogeneous type) presented one on top each other with a particular z-ordering.

Overlays along with elements constitute the only valid leaf types of a Layout and in fact extend the Layout structure. Overlays are constructed using the * operator (building an identical structure to the + operator).

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableTree, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( function ) [source]

Deprecated method to collapse layers in the Overlay.

collate ( ) [source]

Collates any objects in the Overlay resolving any issues the recommended nesting structure.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
from_values ( vals )

Deprecated method to construct tree from list of objects

get ( identifier , default=None ) [source]

Get a layer in the Overlay.

Get a particular layer in the Overlay using its path string or an integer index.

Args:
identifier: Index or path string of the item to return default: Value to return if no item is found
Returns:
The indexed layer of the Overlay
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group )

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. Element ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableElement , holoviews.core.layout.Composable , holoviews.core.overlay.Overlayable

Element is the atomic datastructure used to wrap some data with an associated visual representation, e.g. an element may represent a set of points, an image or a curve. Elements provide a common API for interacting with data of different types and define how the data map to a set of dimensions and how those map to the visual representation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
array ( dimensions=None ) [source]

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs ) [source]

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
classmethod collapse_data ( data , function=None , kdims=None , **kwargs ) [source]

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs ) [source]

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction ) [source]

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values ) [source]

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None ) [source]

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. HoloMap ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping , holoviews.core.overlay.Overlayable

A HoloMap is an n-dimensional mapping of viewable elements or overlays. Each item in a HoloMap has an tuple key defining the values along each of the declared key dimensions, defining the discretely sampled space of values.

The visual representation of a HoloMap consists of the viewable objects inside the HoloMap which can be explored by varying one or more widgets mapping onto the key dimensions of the HoloMap.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( dimensions=None , function=None , spreadfn=None , **kwargs ) [source]

Concatenates and aggregates along supplied dimensions

Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves.

Args:
dimensions: Dimension(s) to collapse
Defaults to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the collapsed element or HoloMap of collapsed elements
collate ( merge_type=None , drop=[] , drop_constant=False ) [source]

Collate allows reordering nested containers

Collation allows collapsing nested mapping types by merging their dimensions. In simple terms in merges nested containers into a single merged type.

In the simple case a HoloMap containing other HoloMaps can easily be joined in this way. However collation is particularly useful when the objects being joined are deeply nested, e.g. you want to join multiple Layouts recorded at different times, collation will return one Layout containing HoloMaps indexed by Time. Changing the merge_type will allow merging the outer Dimension into any other UniformNdMapping type.

Args:
merge_type: Type of the object to merge with drop: List of dimensions to drop drop_constant: Drop constant dimensions automatically
Returns:
Collated Layout or HoloMap
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
grid ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and lay out groups in grid

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by
Returns:
GridSpace with supplied dimensions
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of HoloMap and histograms or just the histograms
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

layout ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and lay out groups

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout.

Args:
dimensions: Dimension(s) to group by
Returns:
NdLayout with supplied dimensions
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object

Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects in the HoloMap a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})
Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
overlay ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and overlay each group

Groups data by supplied dimension(s) overlaying the groups along the dimension(s).

Args:
dimensions: Dimension(s) of dimensions to group by
Returns:
NdOverlay object(s) with supplied dimensions
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=None , function=None , spread_fn=None , **reduce_map ) [source]

Applies reduction to elements along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , **sample_values ) [source]

Samples element values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
A Table containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
split_overlays ( ) [source]

Deprecated method to split overlays inside the HoloMap.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core. Columns

alias of holoviews.core.data.Dataset

class holoviews.core. Layout ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.dimension.ViewableTree

A Layout is an ViewableTree with ViewableElement objects as leaf values. Unlike ViewableTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual ViewableTree indexing, Layout supports indexing of items by their row and column index in the layout.

The maximum number of columns in such a layout may be controlled with the cols method.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Layout, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( *args , **overrides ) [source]

Clones the Layout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned Layout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
from_values ( vals )

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group )

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

shape

Tuple indicating the number of rows and columns in the Layout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. BoundingEllipse ( **args ) [source]

Bases: holoviews.core.boundingregion.BoundingBox

Similar to BoundingBox, but the region is the ellipse inscribed within the rectangle.

centroid ( )

Return the coordinates of the center of this BoundingBox

contains_exclusive ( x , y )

Return True if the given point is contained within the bounding box, where the bottom and right boundaries are considered exclusive.

containsbb_exclusive ( x )

Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive.

containsbb_inclusive ( x )

Returns true if the given BoundingBox x is contained within the bounding box, including cases of exact match.

lbrt ( )

return left,bottom,right,top values for the BoundingBox.

upperexclusive_contains ( x , y )

Returns true if the given point is contained within the bounding box, where the right and upper boundaries are exclusive, and the left and lower boundaries are inclusive. Useful for tiling a plane into non-overlapping regions.

class holoviews.core. Dimension ( spec , **params ) [source]

Bases: param.parameterized.Parameterized

Dimension objects are used to specify some important general features that may be associated with a collection of values.

For instance, a Dimension may specify that a set of numeric values actually correspond to ‘Height’ (dimension name), in units of meters, with a descriptive label ‘Height of adult males’.

All dimensions object have a name that identifies them and a label containing a suitable description. If the label is not explicitly specified it matches the name.

These two parameters define the core identity of the dimension object and must match if two dimension objects are to be considered equivalent. All other parameters are considered optional metadata and are not used when testing for equality.

Unlike all the other parameters, these core parameters can be used to construct a Dimension object from a tuple. This format is sufficient to define an identical Dimension:

Dimension(‘a’, label=’Dimension A’) == Dimension((‘a’, ‘Dimension A’))

Everything else about a dimension is considered to reflect non-semantic preferences. Examples include the default value (which may be used in a visualization to set an initial slider position), how the value is to rendered as text (which may be used to specify the printed floating point precision) or a suitable range of values to consider for a particular analysis.

Full unit support with automated conversions are on the HoloViews roadmap. Once rich unit objects are supported, the unit (or more specifically the type of unit) will be part of the core dimension specification used to establish equality.

Until this feature is implemented, there are two auxiliary parameters that hold some partial information about the unit: the name of the unit and whether or not it is cyclic. The name of the unit is used as part of the pretty-printed representation and knowing whether it is cyclic is important for certain operations.

param String label ( allow_None=True, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Unrestricted label used to describe the dimension. A label should succinctly describe the dimension and may contain any characters, including Unicode and LaTeX expression.
param Boolean cyclic ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the range of this feature is cyclic such that the maximum allowed value (defined by the range parameter) is continuous with the minimum allowed value.
param Callable value_format ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Formatting function applied to each value before display.
param Tuple range ( allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Specifies the minimum and maximum allowed values for a Dimension. None is used to represent an unlimited bound.
param Tuple soft_range ( allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Specifies a minimum and maximum reference value, which may be overridden by the data.
param Parameter type ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Optional type associated with the Dimension values. The type may be an inbuilt constructor (such as int, str, float) or a custom class object.
param Parameter default ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Default value of the Dimension which may be useful for widget or other situations that require an initial or default value.
param Number step ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional floating point step specifying how frequently the underlying space should be sampled. May be used to define a discrete sampling over the range.
param String unit ( allow_None=True, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional unit string associated with the Dimension. For instance, the string ‘m’ may be used represent units of meters and ‘s’ to represent units of seconds.
param List values ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Optional specification of the allowed value set for the dimension that may also be used to retain a categorical ordering.
clone ( spec=None , **overrides ) [source]

Clones the Dimension with new parameters

Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides

Args:
spec (tuple, optional): Dimension tuple specification ** overrides: Dimension parameter overrides
Returns:
Cloned Dimension object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint_label

The pretty-printed label string for the Dimension

pprint_value ( value ) [source]

Applies the applicable formatter to the value.

Args:
value: Dimension value to format
Returns:
Formatted dimension value
pprint_value_string ( value ) [source]

Pretty print the dimension value and unit.

Args:
value: Dimension value to format
Returns:
Formatted dimension value string with unit
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
spec

“Returns the Dimensions tuple specification

Returns:
tuple: Dimension tuple specification
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. GridSpace ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping

Grids are distinct from Layouts as they ensure all contained elements to be of the same type. Unlike Layouts, which have integer keys, Grids usually have floating point keys, which correspond to a grid sampling in some two-dimensional space. This two-dimensional space may have to arbitrary dimensions, e.g. for 2D parameter spaces.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘X’), Dimension(‘Y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( full_grid=False ) [source]

Returns the keys of the GridSpace

Args:
full_grid (bool, optional): Return full cross-product of keys
Returns:
List of keys
label

Label inherited from items

last

The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
shape

Returns the 2D shape of the GridSpace as (rows, cols).

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. BoundingBox ( **args ) [source]

Bases: holoviews.core.boundingregion.BoundingRegion

A rectangular bounding box defined either by two points forming an axis-aligned rectangle (or simply a radius for a square).

centroid ( )

Return the coordinates of the center of this BoundingBox

contains ( x , y ) [source]

Returns true if the given point is contained within the bounding box, where all boundaries of the box are considered to be inclusive.

contains_exclusive ( x , y ) [source]

Return True if the given point is contained within the bounding box, where the bottom and right boundaries are considered exclusive.

containsbb_exclusive ( x ) [source]

Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive.

containsbb_inclusive ( x ) [source]

Returns true if the given BoundingBox x is contained within the bounding box, including cases of exact match.

lbrt ( ) [source]

return left,bottom,right,top values for the BoundingBox.

upperexclusive_contains ( x , y ) [source]

Returns true if the given point is contained within the bounding box, where the right and upper boundaries are exclusive, and the left and lower boundaries are inclusive. Useful for tiling a plane into non-overlapping regions.

class holoviews.core. Tabular ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.element.Element

Baseclass to give an elements providing an API to generate a tabular representation of the object.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
cell_type ( row , col ) [source]

Type of the table cell, either ‘data’ or ‘heading’

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Type of the table cell, either ‘data’ or ‘heading’
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

cols

Number of columns in table

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

pprint_cell ( row , col ) [source]

Formatted contents of table cell.

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Formatted table cell contents
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rows

Number of rows in table (including header)

sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. Empty [source]

Bases: holoviews.core.dimension.Dimensioned , holoviews.core.layout.Composable

Empty may be used to define an empty placeholder in a Layout. It can be placed in a Layout just like any regular Element and container type via the + operator or by passing it to the Layout constructor as a part of a list.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Empty, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. UniformNdMapping ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.NdMapping

A UniformNdMapping is a map of Dimensioned objects and is itself indexed over a number of specified dimensions. The dimension may be a spatial dimension (i.e., a ZStack), time (specifying a frame sequence) or any other combination of Dimensions.

UniformNdMapping objects can be sliced, sampled, reduced, overlaid and split along its and its containing Element’s dimensions. Subclasses should implement the appropriate slicing, sampling and reduction methods for their Dimensioned type.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. Collator ( data=None , **params ) [source]

Bases: holoviews.core.ndmapping.NdMapping

Collator is an NdMapping type which can merge any number of HoloViews components with whatever level of nesting by inserting the Collators key dimensions on the HoloMaps. If the items in the Collator do not contain HoloMaps they will be created. Collator also supports filtering of Tree structures and dropping of constant dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Collator, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Collator operates on HoloViews objects, if vdims are specified a value_transform function must also be supplied.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
param List drop ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of dimensions to drop when collating data, specified as strings.
param Boolean drop_constant ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to demote any non-varying key dimensions to constant dimensions.
param List filters ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of paths to drop when collating data, specified as strings or tuples.
param Parameter progress_bar ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The progress bar instance used to report progress. Set to None to disable progress bars.

param ClassSelector merge_type ( allow_None=False, constant=False, default=<class ‘holoviews.core.spaces.HoloMap’>, instantiate=False, is_instance=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )

param Callable value_transform ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If supplied the function will be applied on each Collator value during collation. This may be used to apply an operation to the data or load references from disk before they are collated into a displayable HoloViews object.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( )

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge_type

alias of holoviews.core.spaces.HoloMap

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

static_dimensions

Return all constant dimensions.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. NdMapping ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.MultiDimensionalMapping

NdMapping supports the same indexing semantics as MultiDimensionalMapping but also supports slicing semantics.

Slicing semantics on an NdMapping is dependent on the ordering semantics of the keys. As MultiDimensionalMapping sort the keys, a slice on an NdMapping is effectively a way of filtering out the keys that are outside the slice range.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( )

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. DynamicMap ( callback , initial_items=None , streams=None , **params ) [source]

Bases: holoviews.core.spaces.HoloMap

A DynamicMap is a type of HoloMap where the elements are dynamically generated by a callable. The callable is invoked with values associated with the key dimensions or with values supplied by stream parameters.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a DynamicMap map to the arguments of the callback. This mapping can be by position or by name.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
param ClassSelector callback ( allow_None=True, constant=True, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The callable used to generate the elements. The arguments to the callable includes any number of declared key dimensions as well as any number of stream parameters defined on the input streams. If the callable is an instance of Callable it will be used directly, otherwise it will be automatically wrapped in one.
param List streams ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of Stream instances to associate with the DynamicMap. The set of parameter values across these streams will be supplied as keyword arguments to the callback when the events are received, updating the streams.
param Integer cache_size ( allow_None=False, bounds=None, constant=False, default=500, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The number of entries to cache for fast access. This is an LRU cache where the least recently used item is overwritten once the cache is full.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( dimensions=None , function=None , spreadfn=None , **kwargs )

Concatenates and aggregates along supplied dimensions

Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves.

Args:
dimensions: Dimension(s) to collapse
Defaults to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the collapsed element or HoloMap of collapsed elements
collate ( ) [source]

Unpacks DynamicMap into container of DynamicMaps

Collation allows unpacking DynamicMaps which return Layout, NdLayout or GridSpace objects into a single such object containing DynamicMaps. Assumes that the items in the layout or grid that is returned do not change.

Returns:
Collated container containing DynamicMaps
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
event ( **kwargs ) [source]

Updates attached streams and triggers events

Automatically find streams matching the supplied kwargs to update and trigger events on them.

Args:
** kwargs: Events to update streams with
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
grid ( dimensions=None , **kwargs ) [source]

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by

Returns: grid: GridSpace

GridSpace with supplied dimensions
group

Group inherited from items

groupby ( dimensions=None , container_type=None , group_type=None , **kwargs ) [source]

Groups DynamicMap by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of DynamicMap and adjoined histogram if adjoin=True, otherwise just the histogram
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

layout ( dimensions=None , **kwargs ) [source]

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by

Returns: layout: NdLayout

NdLayout with supplied dimensions
map ( map_fn , specs=None , clone=True , link_inputs=True ) [source]

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects returned by the DynamicMap a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})
Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
overlay ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and overlay each group

Groups data by supplied dimension(s) overlaying the groups along the dimension(s).

Args:
dimensions: Dimension(s) of dimensions to group by
Returns:
NdOverlay object(s) with supplied dimensions
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=None , function=None , spread_fn=None , **reduce_map )

Applies reduction to elements along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=[] , force=False ) [source]

Reorders key dimensions on DynamicMap

Create a new object with a reordered set of key dimensions. Dropping dimensions is not allowed on a DynamicMap.

Args:
kdims: List of dimensions to reindex the mapping with force: Not applicable to a DynamicMap
Returns:
Reindexed DynamicMap
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
reset ( ) [source]

Clear the DynamicMap cache

sample ( samples=[] , bounds=None , **sample_values )

Samples element values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
A Table containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
split_overlays ( ) [source]

Deprecated method to split overlays inside the DynamicMap.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

unbounded

Returns a list of key dimensions that are unbounded, excluding stream parameters. If any of theses key dimensions are unbounded, the DynamicMap as a whole is also unbounded.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core. AttrTree ( items=None , identifier=None , parent=None , dir_mode='default' ) [source]

Bases: object

An AttrTree offers convenient, multi-level attribute access for collections of objects. AttrTree objects may also be combined together using the update method or merge classmethod. Here is an example of adding a ViewableElement to an AttrTree and accessing it:

>>> t = AttrTree()
>>> t.Example.Path = 1
>>> t.Example.Path                             
1
filter ( path_filters ) [source]

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

get ( identifier , default=None ) [source]

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
items ( ) [source]

Keys and nodes of the AttrTree

keys ( ) [source]

Keys of nodes in the AttrTree

classmethod merge ( trees ) [source]

Merge a collection of AttrTree objects.

path

Returns the path up to the root for the current node.

pop ( identifier , default=None ) [source]

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
set_path ( path , val ) [source]

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

update ( other ) [source]

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( ) [source]

Nodes of the AttrTree


boundingregion Module

Inheritance diagram of holoviews.core.boundingregion

Bounding regions and bounding boxes.

File originally part of the Topographica project.

class holoviews.core.boundingregion. AARectangle ( *points ) [source]

Bases: object

Axis-aligned rectangle class.

Defines the smallest axis-aligned rectangle that encloses a set of points.

Usage: aar = AARectangle( (x1,y1),(x2,y2), … , (xN,yN) )

bottom ( ) [source]

Return the y-coordinate of the bottom of the rectangle.

centroid ( ) [source]

Return the centroid of the rectangle.

lbrt ( ) [source]

Return (left,bottom,right,top) as a tuple.

left ( ) [source]

Return the x-coordinate of the left side of the rectangle.

right ( ) [source]

Return the x-coordinate of the right side of the rectangle.

top ( ) [source]

Return the y-coordinate of the top of the rectangle.

class holoviews.core.boundingregion. BoundingBox ( **args ) [source]

Bases: holoviews.core.boundingregion.BoundingRegion

A rectangular bounding box defined either by two points forming an axis-aligned rectangle (or simply a radius for a square).

centroid ( )

Return the coordinates of the center of this BoundingBox

contains ( x , y ) [source]

Returns true if the given point is contained within the bounding box, where all boundaries of the box are considered to be inclusive.

contains_exclusive ( x , y ) [source]

Return True if the given point is contained within the bounding box, where the bottom and right boundaries are considered exclusive.

containsbb_exclusive ( x ) [source]

Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive.

containsbb_inclusive ( x ) [source]

Returns true if the given BoundingBox x is contained within the bounding box, including cases of exact match.

lbrt ( ) [source]

return left,bottom,right,top values for the BoundingBox.

upperexclusive_contains ( x , y ) [source]

Returns true if the given point is contained within the bounding box, where the right and upper boundaries are exclusive, and the left and lower boundaries are inclusive. Useful for tiling a plane into non-overlapping regions.

class holoviews.core.boundingregion. BoundingEllipse ( **args ) [source]

Bases: holoviews.core.boundingregion.BoundingBox

Similar to BoundingBox, but the region is the ellipse inscribed within the rectangle.

centroid ( )

Return the coordinates of the center of this BoundingBox

contains_exclusive ( x , y )

Return True if the given point is contained within the bounding box, where the bottom and right boundaries are considered exclusive.

containsbb_exclusive ( x )

Returns true if the given BoundingBox x is contained within the bounding box, where at least one of the boundaries of the box has to be exclusive.

containsbb_inclusive ( x )

Returns true if the given BoundingBox x is contained within the bounding box, including cases of exact match.

lbrt ( )

return left,bottom,right,top values for the BoundingBox.

upperexclusive_contains ( x , y )

Returns true if the given point is contained within the bounding box, where the right and upper boundaries are exclusive, and the left and lower boundaries are inclusive. Useful for tiling a plane into non-overlapping regions.

class holoviews.core.boundingregion. BoundingRegion [source]

Bases: object

Abstract bounding region class, for any portion of a 2D plane.

Only subclasses can be instantiated directly.

centroid ( ) [source]

Return the coordinates of the center of this BoundingBox

class holoviews.core.boundingregion. BoundingRegionParameter ( default=BoundingBox(radius=0.5) , **params ) [source]

Bases: param.parameterized.Parameter

Parameter whose value can be any BoundingRegion instance, enclosing a region in a 2D plane.


dimension Module

Inheritance diagram of holoviews.core.dimension

Provides Dimension objects for tracking the properties of a value, axis or map dimension. Also supplies the Dimensioned abstract baseclass for classes that accept Dimension values.

class holoviews.core.dimension. Dimension ( spec , **params ) [source]

Bases: param.parameterized.Parameterized

Dimension objects are used to specify some important general features that may be associated with a collection of values.

For instance, a Dimension may specify that a set of numeric values actually correspond to ‘Height’ (dimension name), in units of meters, with a descriptive label ‘Height of adult males’.

All dimensions object have a name that identifies them and a label containing a suitable description. If the label is not explicitly specified it matches the name.

These two parameters define the core identity of the dimension object and must match if two dimension objects are to be considered equivalent. All other parameters are considered optional metadata and are not used when testing for equality.

Unlike all the other parameters, these core parameters can be used to construct a Dimension object from a tuple. This format is sufficient to define an identical Dimension:

Dimension(‘a’, label=’Dimension A’) == Dimension((‘a’, ‘Dimension A’))

Everything else about a dimension is considered to reflect non-semantic preferences. Examples include the default value (which may be used in a visualization to set an initial slider position), how the value is to rendered as text (which may be used to specify the printed floating point precision) or a suitable range of values to consider for a particular analysis.

Full unit support with automated conversions are on the HoloViews roadmap. Once rich unit objects are supported, the unit (or more specifically the type of unit) will be part of the core dimension specification used to establish equality.

Until this feature is implemented, there are two auxiliary parameters that hold some partial information about the unit: the name of the unit and whether or not it is cyclic. The name of the unit is used as part of the pretty-printed representation and knowing whether it is cyclic is important for certain operations.

param String label ( allow_None=True, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Unrestricted label used to describe the dimension. A label should succinctly describe the dimension and may contain any characters, including Unicode and LaTeX expression.
param Boolean cyclic ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the range of this feature is cyclic such that the maximum allowed value (defined by the range parameter) is continuous with the minimum allowed value.
param Callable value_format ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Formatting function applied to each value before display.
param Tuple range ( allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Specifies the minimum and maximum allowed values for a Dimension. None is used to represent an unlimited bound.
param Tuple soft_range ( allow_None=False, constant=False, default=(None, None), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Specifies a minimum and maximum reference value, which may be overridden by the data.
param Parameter type ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Optional type associated with the Dimension values. The type may be an inbuilt constructor (such as int, str, float) or a custom class object.
param Parameter default ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Default value of the Dimension which may be useful for widget or other situations that require an initial or default value.
param Number step ( allow_None=True, bounds=None, constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Optional floating point step specifying how frequently the underlying space should be sampled. May be used to define a discrete sampling over the range.
param String unit ( allow_None=True, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional unit string associated with the Dimension. For instance, the string ‘m’ may be used represent units of meters and ‘s’ to represent units of seconds.
param List values ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Optional specification of the allowed value set for the dimension that may also be used to retain a categorical ordering.
clone ( spec=None , **overrides ) [source]

Clones the Dimension with new parameters

Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides

Args:
spec (tuple, optional): Dimension tuple specification ** overrides: Dimension parameter overrides
Returns:
Cloned Dimension object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint_label

The pretty-printed label string for the Dimension

pprint_value ( value ) [source]

Applies the applicable formatter to the value.

Args:
value: Dimension value to format
Returns:
Formatted dimension value
pprint_value_string ( value ) [source]

Pretty print the dimension value and unit.

Args:
value: Dimension value to format
Returns:
Formatted dimension value string with unit
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimension'>)
spec

“Returns the Dimensions tuple specification

Returns:
tuple: Dimension tuple specification
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.dimension. Dimensioned ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.LabelledData

Dimensioned is a base class that allows the data contents of a class to be associated with dimensions. The contents associated with dimensions may be partitioned into one of three types

  • key dimensions: These are the dimensions that can be indexed via

    the __getitem__ method. Dimension objects supporting key dimensions must support indexing over these dimensions and may also support slicing. This list ordering of dimensions describes the positional components of each multi-dimensional indexing operation.

    For instance, if the key dimension names are ‘weight’ followed by ‘height’ for Dimensioned object ‘obj’, then obj[80,175] indexes a weight of 80 and height of 175.

    Accessed using either kdims.

  • value dimensions: These dimensions correspond to any data held

    on the Dimensioned object not in the key dimensions. Indexing by value dimension is supported by dimension name (when there are multiple possible value dimensions); no slicing semantics is supported and all the data associated with that dimension will be returned at once. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either vdims.

  • deep dimensions: These are dynamically computed dimensions that

    belong to other Dimensioned objects that are nested in the data. Objects that support this should enable the _deep_indexable flag. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either ddims.

Dimensioned class support generalized methods for finding the range and type of values along a particular Dimension. The range method relies on the appropriate implementation of the dimension_values methods on subclasses.

The index of an arbitrary dimension is its positional index in the list of all dimensions, starting with the key dimensions, followed by the value dimensions and ending with the deep dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False ) [source]

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_dimension ( dimension , default=None , strict=False ) [source]

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension ) [source]

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.dimension. LabelledData ( data , id=None , plot_id=None , **params ) [source]

Bases: param.parameterized.Parameterized

LabelledData is a mix-in class designed to introduce the group and label parameters (and corresponding methods) to any class containing data. This class assumes that the core data contents will be held in the attribute called ‘data’.

Used together, group and label are designed to allow a simple and flexible means of addressing data. For instance, if you are collecting the heights of people in different demographics, you could specify the values of your objects as ‘Height’ and then use the label to specify the (sub)population.

In this scheme, one object may have the parameters set to [group=’Height’, label=’Children’] and another may use [group=’Height’, label=’Adults’].

Note: Another level of specification is implicit in the type (i.e class) of the LabelledData object. A full specification of a LabelledData object is therefore given by the tuple (<type>, <group>, label>). This additional level of specification is used in the traverse method.

Any strings can be used for the group and label, but it can be convenient to use a capitalized string of alphanumeric characters, in which case the keys used for matching in the matches and traverse method will correspond exactly to {type}.{group}.{label}. Otherwise the strings provided will be sanitized to be valid capitalized Python identifiers, which works fine but can sometimes be confusing.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=LabelledData, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the type of data contained by the object. By default this will typically mirror the class name.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.LabelledData'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.LabelledData'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.LabelledData'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.LabelledData'>)
map ( map_fn , specs=None , clone=True ) [source]

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec ) [source]

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

relabel ( label=None , group=None , depth=0 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.LabelledData'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.LabelledData'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True ) [source]

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.dimension. ViewableElement ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

A ViewableElement is a dimensioned datastructure that may be associated with a corresponding atomic visualization. An atomic visualization will display the data on a single set of axes (i.e. excludes multiple subplots that are displayed at once). The only new parameter introduced by ViewableElement is the title associated with the object for display.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.dimension. ViewableTree ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.tree.AttrTree , holoviews.core.dimension.Dimensioned

A ViewableTree is an AttrTree with Viewable objects as its leaf nodes. It combines the tree like data structure of a tree while extending it with the deep indexable properties of Dimensioned and LabelledData objects.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableTree, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
classmethod from_values ( vals ) [source]

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group ) [source]

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core.dimension. asdim ( dimension ) [source]

Convert the input to a Dimension.

Args:
dimension: tuple, dict or string type to convert to Dimension
Returns:
A Dimension object constructed from the dimension spec. No copy is performed if the input is already a Dimension.
holoviews.core.dimension. dimension_name ( dimension ) [source]

Return the Dimension.name for a dimension-like object.

Args:
dimension: Dimension or dimension string, tuple or dict
Returns:
The name of the Dimension or what would be the name if the input as converted to a Dimension.
holoviews.core.dimension. param_aliases ( d ) [source]

Called from __setstate__ in LabelledData in order to load old pickles with outdated parameter names.

Warning: We want to keep pickle hacking to a minimum!

holoviews.core.dimension. process_dimensions ( kdims , vdims ) [source]

Converts kdims and vdims to Dimension objects.

Args:
kdims: List or single key dimension(s) specified as strings,
tuples dicts or Dimension objects.
vdims: List or single value dimension(s) specified as strings,
tuples dicts or Dimension objects.
Returns:

Dictionary containing kdims and vdims converted to Dimension objects:

{‘kdims’: [Dimension(‘x’)], ‘vdims’: [Dimension(‘y’)]

class holoviews.core.dimension. redim ( parent , mode=None ) [source]

Bases: object

Utility that supports re-dimensioning any HoloViews object via the redim method.

classmethod replace_dimensions ( dimensions , overrides ) [source]

Replaces dimensions in list with dictionary of overrides.

Args:
dimensions: List of dimensions overrides: Dictionary of dimension specs indexed by name
Returns:
list: List of dimensions with replacements applied

element Module

Inheritance diagram of holoviews.core.element
class holoviews.core.element. Element ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableElement , holoviews.core.layout.Composable , holoviews.core.overlay.Overlayable

Element is the atomic datastructure used to wrap some data with an associated visual representation, e.g. an element may represent a set of points, an image or a curve. Elements provide a common API for interacting with data of different types and define how the data map to a set of dimensions and how those map to the visual representation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
array ( dimensions=None ) [source]

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs ) [source]

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
classmethod collapse_data ( data , function=None , kdims=None , **kwargs ) [source]

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs ) [source]

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction ) [source]

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , closest=False , **sample_values ) [source]

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Element'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None ) [source]

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. HoloMap ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping , holoviews.core.overlay.Overlayable

A HoloMap is an n-dimensional mapping of viewable elements or overlays. Each item in a HoloMap has an tuple key defining the values along each of the declared key dimensions, defining the discretely sampled space of values.

The visual representation of a HoloMap consists of the viewable objects inside the HoloMap which can be explored by varying one or more widgets mapping onto the key dimensions of the HoloMap.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( dimensions=None , function=None , spreadfn=None , **kwargs ) [source]

Concatenates and aggregates along supplied dimensions

Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves.

Args:
dimensions: Dimension(s) to collapse
Defaults to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the collapsed element or HoloMap of collapsed elements
collate ( merge_type=None , drop=[] , drop_constant=False ) [source]

Collate allows reordering nested containers

Collation allows collapsing nested mapping types by merging their dimensions. In simple terms in merges nested containers into a single merged type.

In the simple case a HoloMap containing other HoloMaps can easily be joined in this way. However collation is particularly useful when the objects being joined are deeply nested, e.g. you want to join multiple Layouts recorded at different times, collation will return one Layout containing HoloMaps indexed by Time. Changing the merge_type will allow merging the outer Dimension into any other UniformNdMapping type.

Args:
merge_type: Type of the object to merge with drop: List of dimensions to drop drop_constant: Drop constant dimensions automatically
Returns:
Collated Layout or HoloMap
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
grid ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and lay out groups in grid

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by
Returns:
GridSpace with supplied dimensions
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of HoloMap and histograms or just the histograms
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

layout ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and lay out groups

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout.

Args:
dimensions: Dimension(s) to group by
Returns:
NdLayout with supplied dimensions
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object

Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects in the HoloMap a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})
Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
overlay ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and overlay each group

Groups data by supplied dimension(s) overlaying the groups along the dimension(s).

Args:
dimensions: Dimension(s) of dimensions to group by
Returns:
NdOverlay object(s) with supplied dimensions
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=None , function=None , spread_fn=None , **reduce_map ) [source]

Applies reduction to elements along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , **sample_values ) [source]

Samples element values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
A Table containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
split_overlays ( ) [source]

Deprecated method to split overlays inside the HoloMap.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. ViewableElement ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

A ViewableElement is a dimensioned datastructure that may be associated with a corresponding atomic visualization. An atomic visualization will display the data on a single set of axes (i.e. excludes multiple subplots that are displayed at once). The only new parameter introduced by ViewableElement is the title associated with the object for display.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. Dimensioned ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.LabelledData

Dimensioned is a base class that allows the data contents of a class to be associated with dimensions. The contents associated with dimensions may be partitioned into one of three types

  • key dimensions: These are the dimensions that can be indexed via

    the __getitem__ method. Dimension objects supporting key dimensions must support indexing over these dimensions and may also support slicing. This list ordering of dimensions describes the positional components of each multi-dimensional indexing operation.

    For instance, if the key dimension names are ‘weight’ followed by ‘height’ for Dimensioned object ‘obj’, then obj[80,175] indexes a weight of 80 and height of 175.

    Accessed using either kdims.

  • value dimensions: These dimensions correspond to any data held

    on the Dimensioned object not in the key dimensions. Indexing by value dimension is supported by dimension name (when there are multiple possible value dimensions); no slicing semantics is supported and all the data associated with that dimension will be returned at once. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either vdims.

  • deep dimensions: These are dynamically computed dimensions that

    belong to other Dimensioned objects that are nested in the data. Objects that support this should enable the _deep_indexable flag. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either ddims.

Dimensioned class support generalized methods for finding the range and type of values along a particular Dimension. The range method relies on the appropriate implementation of the dimension_values methods on subclasses.

The index of an arbitrary dimension is its positional index in the list of all dimensions, starting with the key dimensions, followed by the value dimensions and ending with the deep dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False ) [source]

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_dimension ( dimension , default=None , strict=False ) [source]

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension ) [source]

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. CompositeOverlay ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableElement , holoviews.core.layout.Composable

CompositeOverlay provides a common baseclass for Overlay classes.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. NdLayout ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping

NdLayout is a UniformNdMapping providing an n-dimensional data structure to display the contained Elements and containers in a layout. Using the cols method the NdLayout can be rearranged with the desired number of columns.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( *args , **overrides ) [source]

Clones the NdLayout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned NdLayout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
grid_items ( ) [source]

Compute a dict of {(row,column): (key, value)} elements from the current set of items and specified number of columns.

group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns another NdLayout constituted of the last views of the individual elements (if they are maps).

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
shape

Tuple indicating the number of rows and columns in the NdLayout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. GridSpace ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping

Grids are distinct from Layouts as they ensure all contained elements to be of the same type. Unlike Layouts, which have integer keys, Grids usually have floating point keys, which correspond to a grid sampling in some two-dimensional space. This two-dimensional space may have to arbitrary dimensions, e.g. for 2D parameter spaces.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘X’), Dimension(‘Y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( full_grid=False ) [source]

Returns the keys of the GridSpace

Args:
full_grid (bool, optional): Return full cross-product of keys
Returns:
List of keys
label

Label inherited from items

last

The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
shape

Returns the 2D shape of the GridSpace as (rows, cols).

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. Tabular ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.element.Element

Baseclass to give an elements providing an API to generate a tabular representation of the object.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
array ( dimensions=None )

Convert dimension values to columnar array.

Args:
dimensions: List of dimensions to return
Returns:
Array of columns corresponding to each dimension
cell_type ( row , col ) [source]

Type of the table cell, either ‘data’ or ‘heading’

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Type of the table cell, either ‘data’ or ‘heading’
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
closest ( coords , **kwargs )

Snap list or dict of coordinates to closest position.

Args:
coords: List of 1D or 2D coordinates ** kwargs: Coordinates specified as keyword pairs
Returns:
List of tuples of the snapped coordinates
Raises:
NotImplementedError: Raised if snapping is not supported
collapse_data ( data , function=None , kdims=None , **kwargs )

Deprecated method to perform collapse operations, which may now be performed through concatenation and aggregation.

cols

Number of columns in table

ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
mapping ( kdims=None , vdims=None , **kwargs )

Deprecated method to convert data to dictionary

matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

pprint_cell ( row , col ) [source]

Formatted contents of table cell.

Args:
row (int): Integer index of table row col (int): Integer index of table column
Returns:
Formatted table cell contents
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=[] , function=None , spreadfn=None , **reduction )

Applies reduction along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The element after reductions have been applied.
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
rows

Number of rows in table (including header)

sample ( samples=[] , bounds=None , closest=False , **sample_values )

Samples values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
Element containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Tabular'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None )

Deprecated method to convert any Element to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. Layout ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.dimension.ViewableTree

A Layout is an ViewableTree with ViewableElement objects as leaf values. Unlike ViewableTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual ViewableTree indexing, Layout supports indexing of items by their row and column index in the layout.

The maximum number of columns in such a layout may be controlled with the cols method.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Layout, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( *args , **overrides ) [source]

Clones the Layout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned Layout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
from_values ( vals )

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group )

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

shape

Tuple indicating the number of rows and columns in the Layout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. Collator ( data=None , **params ) [source]

Bases: holoviews.core.ndmapping.NdMapping

Collator is an NdMapping type which can merge any number of HoloViews components with whatever level of nesting by inserting the Collators key dimensions on the HoloMaps. If the items in the Collator do not contain HoloMaps they will be created. Collator also supports filtering of Tree structures and dropping of constant dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Collator, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Collator operates on HoloViews objects, if vdims are specified a value_transform function must also be supplied.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
param List drop ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of dimensions to drop when collating data, specified as strings.
param Boolean drop_constant ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to demote any non-varying key dimensions to constant dimensions.
param List filters ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of paths to drop when collating data, specified as strings or tuples.
param Parameter progress_bar ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The progress bar instance used to report progress. Set to None to disable progress bars.

param ClassSelector merge_type ( allow_None=False, constant=False, default=<class ‘holoviews.core.spaces.HoloMap’>, instantiate=False, is_instance=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )

param Callable value_transform ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If supplied the function will be applied on each Collator value during collation. This may be used to apply an operation to the data or load references from disk before they are collated into a displayable HoloViews object.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( )

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge_type

alias of holoviews.core.spaces.HoloMap

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.element.Collator'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

static_dimensions

Return all constant dimensions.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. NdMapping ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.MultiDimensionalMapping

NdMapping supports the same indexing semantics as MultiDimensionalMapping but also supports slicing semantics.

Slicing semantics on an NdMapping is dependent on the ordering semantics of the keys. As MultiDimensionalMapping sort the keys, a slice on an NdMapping is effectively a way of filtering out the keys that are outside the slice range.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( )

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.element. NdOverlay ( overlays=None , kdims=None , **params ) [source]

Bases: holoviews.core.overlay.Overlayable , holoviews.core.ndmapping.UniformNdMapping , holoviews.core.overlay.CompositeOverlay

An NdOverlay allows a group of NdOverlay to be overlaid together. NdOverlay can be indexed out of an overlay and an overlay is an iterable that iterates over the contained layers.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Element’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of dimensions the NdOverlay can be indexed by.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


io Module

Inheritance diagram of holoviews.core.io

Module defining input/output interfaces to HoloViews.

There are two components for input/output:

Exporters: Process (composite) HoloViews objects one at a time. For
instance, an exporter may render a HoloViews object as a svg or perhaps pickle it.
Archives: A collection of HoloViews objects that are first collected
then processed together. For instance, collecting HoloViews objects for a report then generating a PDF or collecting HoloViews objects to dump to HDF5.
class holoviews.core.io. Archive ( **params ) [source]

Bases: param.parameterized.Parameterized

An Archive is a means to collect and store a collection of HoloViews objects in any number of different ways. Examples of possible archives:

  • Generating tar or zip files (compressed or uncompressed).
  • Collating a report or document (e.g. PDF, HTML, LaTex).
  • Storing a collection of HoloViews objects to a database or HDF5.
param List exporters ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The exporter functions used to convert HoloViews objects into the appropriate format(s).
add ( obj , *args , **kwargs ) [source]

Add a HoloViews object to the archive.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

export ( *args , **kwargs ) [source]

Finalize and close the archive.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Archive'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Archive'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Archive'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Archive'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Archive'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Archive'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Deserializer ( **params ) [source]

Bases: holoviews.core.io.Importer

A generic importer that supports any arbitrary de-serializer.

param Callable deserializer ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The deserializer function, set to Store.load by default. The deserializer should take a file-like object that can be read from until the first object has been deserialized. If the file has not been exhausted, the deserializer should be able to continue parsing and loading objects. Any suitable deserializer may be used. For instance, pickle.load may be used although this will not load customized options.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

deserializer ( filename )

Equivalent to pickle.load except that the HoloViews trees is restored appropriately.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Deserializer'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Deserializer'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Deserializer'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Deserializer'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Deserializer'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Deserializer'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Deserializer'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Exporter ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

An Exporter is a parameterized function that accepts a HoloViews object and converts it to a new some new format. This mechanism is designed to be very general so here are a few examples:

Pickling: Native Python, supported by HoloViews. Rendering: Any plotting backend may be used (default uses matplotlib) Storage: Saving to a database (e.g SQL), HDF5 etc.

param Callable key_fn ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Function that generates the metadata key from the HoloViews object being saved. The metadata key is a single high-dimensional key of values associated with dimension labels. The returned dictionary must have string keys and simple literals that may be conviently used for dictionary-style indexing. Returns an empty dictionary by default.
param Callable info_fn ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Function that generates additional metadata information from the HoloViews object being saved. Unlike metadata keys, the information returned may be unsuitable for use as a key index and may include entries such as the object’s repr. Regardless, the info metadata should still only contain items that will be quick to load and inspect.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

classmethod encode ( entry ) [source]

Classmethod that applies conditional encoding based on mime-type. Given an entry as returned by __call__ return the data in the appropriate encoding.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Exporter'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Exporter'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Exporter'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Exporter'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Exporter'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

save = functools.partial(<function Exporter.save>, <class 'holoviews.core.io.Exporter'>) [source]
script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Exporter'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Exporter'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. FileArchive ( **params ) [source]

Bases: holoviews.core.io.Archive

A file archive stores files on disk, either unpacked in a directory or in an archive format (e.g. a zip file).

param List exporters ( allow_None=False, bounds=(0, None), constant=False, default=[<class ‘holoviews.core.io.Pickler’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The exporter functions used to convert HoloViews objects into the appropriate format(s).
param String dimension_formatter ( allow_None=False, basestring=<class ‘str’>, constant=False, default={name}_{range}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string formatter for the output file based on the supplied HoloViews objects dimension names and values. Valid fields are the {name}, {range} and {unit} of the dimensions.
param Callable object_formatter ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Callable that given an object returns a string suitable for inclusion in file and directory names. This is what generates the value used in the {obj} field of the filename formatter.
param String filename_formatter ( allow_None=False, basestring=<class ‘str’>, constant=False, default={dimensions},{obj}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string formatter for output filename based on the HoloViews object that is being rendered to disk. The available fields are the {type}, {group}, {label}, {obj} of the holoviews object added to the archive as well as {timestamp}, {obj} and {SHA}. The {timestamp} is the export timestamp using timestamp_format, {obj} is the object representation as returned by object_formatter and {SHA} is the SHA of the {obj} value used to compress it into a shorter string.
param String timestamp_format ( allow_None=False, basestring=<class ‘str’>, constant=False, default=%Y_%m_%d-%H_%M_%S, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The timestamp format that will be substituted for the {timestamp} field in the export name.
param String root ( allow_None=False, basestring=<class ‘str’>, constant=False, default=., instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The root directory in which the output directory is located. May be an absolute or relative path.
param ObjectSelector archive_format ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=zip, instantiate=False, names=None, objects=[‘zip’, ‘tar’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The archive format to use if there are multiple files and pack is set to True. Supported formats include ‘zip’ and ‘tar’.
param Boolean pack ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether or not to pack to contents into the specified archive format. If pack is False, the contents will be output to a directory. Note that if there is only a single file in the archive, no packing will occur and no directory is created. Instead, the file is treated as a single-file archive.
param String export_name ( allow_None=False, basestring=<class ‘str’>, constant=False, default={timestamp}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The name assigned to the overall export. If an archive file is used, this is the correspond filename (e.g of the exporter zip file). Alternatively, if unpack=False, this is the name of the output directory. Lastly, for archives of a single file, this is the basename of the output file. The {timestamp} field is available to include the timestamp at the time of export in the chosen timestamp format.
param Boolean unique_name ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the export name should be made unique with a numeric suffix. If set to False, any existing export of the same name will be removed and replaced.
param Integer max_filename ( allow_None=False, bounds=(0, None), constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Maximum length to enforce on generated filenames. 100 is the practical maximum for zip and tar file generation, but you may wish to use a lower value to avoid long filenames.
param Boolean flush_archive ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Flushed the contents of the archive after export.
add ( obj=None , filename=None , data=None , info={} , **kwargs ) [source]

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 automatically rendered from the object.

contents ( maxlen=70 ) [source]

Print the current (unexported) contents of the archive

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

export ( timestamp=None , info={} ) [source]

Export the archive, directory or file.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.FileArchive'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.FileArchive'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.FileArchive'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.FileArchive'>)
listing ( ) [source]

Return a list of filename entries currently in the archive

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

object_formatter ( 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 long names for the common case of a container whose element(s) share the same group and label.

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

classmethod parse_fields ( formatter ) [source]

Returns the format fields otherwise raise exception

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.FileArchive'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.FileArchive'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Importer ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

An Importer is a parameterized function that accepts some data in some format and returns a HoloViews object. This mechanism is designed to be very general so here are a few examples:

Unpickling: Native Python, supported by HoloViews. Servers: Loading data over a network connection. Storage: Loading from a database (e.g SQL), HDF5 etc.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Importer'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Importer'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Importer'>)
info = functools.partial(<function Importer.info>, <class 'holoviews.core.io.Importer'>) [source]
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Importer'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Importer'>)
key = functools.partial(<function Importer.key>, <class 'holoviews.core.io.Importer'>) [source]
load = functools.partial(<function Importer.load>, <class 'holoviews.core.io.Importer'>) [source]
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Importer'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Importer'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Pickler ( **params ) [source]

Bases: holoviews.core.io.Exporter

The recommended pickler for serializing HoloViews object to a .hvz file (a simple zip archive of pickle files). In addition to the functionality offered by Store.dump and Store.load, this file format offers three additional features:

  1. Optional (zip) compression.
  2. Ability to save and load components of a Layout independently.
  3. Support for metadata per saved component.

The output file with the .hvz file extension is simply a zip archive containing pickled HoloViews objects.

param Callable key_fn ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Function that generates the metadata key from the HoloViews object being saved. The metadata key is a single high-dimensional key of values associated with dimension labels. The returned dictionary must have string keys and simple literals that may be conviently used for dictionary-style indexing. Returns an empty dictionary by default.
param Callable info_fn ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Function that generates additional metadata information from the HoloViews object being saved. Unlike metadata keys, the information returned may be unsuitable for use as a key index and may include entries such as the object’s repr. Regardless, the info metadata should still only contain items that will be quick to load and inspect.
param Integer protocol ( allow_None=False, bounds=None, constant=False, default=2, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The pickling protocol where 0 is ASCII, 1 supports old Python versions and 2 is efficient for new style classes.
param Boolean compress ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether compression is enabled or not
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

encode ( entry )

Classmethod that applies conditional encoding based on mime-type. Given an entry as returned by __call__ return the data in the appropriate encoding.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Pickler'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Pickler'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Pickler'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Pickler'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Pickler'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Pickler'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Pickler'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Reference ( **params ) [source]

Bases: param.parameterized.Parameterized

A Reference allows access to an object to be deferred until it is needed in the appropriate context. References are used by Collector to capture the state of an object at collection time.

One particularly important property of references is that they should be pickleable. This means that you can pickle Collectors so that you can unpickle them in different environments and still collect from the required object.

A Reference only needs to have a resolved_type property and a resolve method. The constructor will take some specification of where to find the target object (may be the object itself).

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Reference'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Reference'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Reference'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Reference'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

resolve ( container=None ) [source]

Return the referenced object. Optionally, a container may be passed in from which the object is to be resolved.

resolved_type

Returns the type of the object resolved by this references. If multiple types are possible, the return is a tuple of types.

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Reference'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Reference'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Serializer ( **params ) [source]

Bases: holoviews.core.io.Exporter

A generic exporter that supports any arbitrary serializer

param Callable key_fn ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Function that generates the metadata key from the HoloViews object being saved. The metadata key is a single high-dimensional key of values associated with dimension labels. The returned dictionary must have string keys and simple literals that may be conviently used for dictionary-style indexing. Returns an empty dictionary by default.
param Callable info_fn ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Function that generates additional metadata information from the HoloViews object being saved. Unlike metadata keys, the information returned may be unsuitable for use as a key index and may include entries such as the object’s repr. Regardless, the info metadata should still only contain items that will be quick to load and inspect.
param Callable serializer ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The serializer function, set to Store.dumps by default. The serializer should take an object and output a serialization as a string or byte stream. Any suitable serializer may be used. For instance, pickle.dumps may be used although this will not save customized options.
param String mime_type ( allow_None=True, basestring=<class ‘str’>, constant=False, default=application/python-pickle, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The mime-type associated with the serializer (if applicable).
param String file_ext ( allow_None=False, basestring=<class ‘str’>, constant=False, default=pkl, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The file extension associated with the corresponding file format (if applicable).
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

encode ( entry )

Classmethod that applies conditional encoding based on mime-type. Given an entry as returned by __call__ return the data in the appropriate encoding.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Serializer'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Serializer'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Serializer'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Serializer'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Serializer'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

serializer ( obj , protocol=0 )

Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Serializer'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Serializer'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.io. Unpickler ( **params ) [source]

Bases: holoviews.core.io.Importer

The inverse of Pickler used to load the .hvz file format which is simply a zip archive of pickle objects.

Unlike a regular pickle file, info and key metadata as well as individual components of a Layout may be loaded without needing to load the entire file into memory.

The components that may be individually loaded may be found using the entries method.

collect = functools.partial(<function Unpickler.collect>, <class 'holoviews.core.io.Unpickler'>) [source]
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Unpickler'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Unpickler'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Unpickler'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Unpickler'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Unpickler'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Unpickler'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.io.Unpickler'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core.io. sanitizer ( name, replacements=[(':', '_'), ('/', '_'), ('\\', '_')] ) [source]

String sanitizer to avoid problematic characters in filenames.

holoviews.core.io. simple_name_generator ( obj ) [source]

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 container whose element(s) share the same group and label.


layout Module

Inheritance diagram of holoviews.core.layout

Supplies Pane, Layout, NdLayout and AdjointLayout. Pane extends View to allow multiple Views to be presented side-by-side in a NdLayout. An AdjointLayout allows one or two Views to be adjoined to a primary View to act as supplementary elements.

class holoviews.core.layout. ViewableTree ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.tree.AttrTree , holoviews.core.dimension.Dimensioned

A ViewableTree is an AttrTree with Viewable objects as its leaf nodes. It combines the tree like data structure of a tree while extending it with the deep indexable properties of Dimensioned and LabelledData objects.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableTree, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
classmethod from_values ( vals ) [source]

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group ) [source]

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. ViewableElement ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

A ViewableElement is a dimensioned datastructure that may be associated with a corresponding atomic visualization. An atomic visualization will display the data on a single set of axes (i.e. excludes multiple subplots that are displayed at once). The only new parameter introduced by ViewableElement is the title associated with the object for display.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. Dimensioned ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.LabelledData

Dimensioned is a base class that allows the data contents of a class to be associated with dimensions. The contents associated with dimensions may be partitioned into one of three types

  • key dimensions: These are the dimensions that can be indexed via

    the __getitem__ method. Dimension objects supporting key dimensions must support indexing over these dimensions and may also support slicing. This list ordering of dimensions describes the positional components of each multi-dimensional indexing operation.

    For instance, if the key dimension names are ‘weight’ followed by ‘height’ for Dimensioned object ‘obj’, then obj[80,175] indexes a weight of 80 and height of 175.

    Accessed using either kdims.

  • value dimensions: These dimensions correspond to any data held

    on the Dimensioned object not in the key dimensions. Indexing by value dimension is supported by dimension name (when there are multiple possible value dimensions); no slicing semantics is supported and all the data associated with that dimension will be returned at once. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either vdims.

  • deep dimensions: These are dynamically computed dimensions that

    belong to other Dimensioned objects that are nested in the data. Objects that support this should enable the _deep_indexable flag. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either ddims.

Dimensioned class support generalized methods for finding the range and type of values along a particular Dimension. The range method relies on the appropriate implementation of the dimension_values methods on subclasses.

The index of an arbitrary dimension is its positional index in the list of all dimensions, starting with the key dimensions, followed by the value dimensions and ending with the deep dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False ) [source]

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_dimension ( dimension , default=None , strict=False ) [source]

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension ) [source]

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. AdjointLayout ( data , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

An AdjointLayout provides a convenient container to lay out some marginal plots next to a primary plot. This is often useful to display the marginal distributions of a plot next to the primary plot. AdjointLayout accepts a list of up to three elements, which are laid out as follows with the names ‘main’, ‘top’ and ‘right’:

3 | |

|___________|___| | | | 1: main | | | 2: right | 1 | 2 | 3: top | | | |___________|___|

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘AdjointLayout’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Applies to the main object in the AdjointLayout.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
get ( key , default=None ) [source]

Returns the viewable corresponding to the supplied string or integer based key.

Args:
key: Numeric or string index: 0) ‘main’ 1) ‘right’ 2) ‘top’ default: Value returned if key not found
Returns:
Indexed value or supplied default
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
group

Group inherited from main element

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
label

Label inherited from main element

main

Returns the main element in the AdjointLayout

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to child up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
right

Returns the right marginal element in the AdjointLayout

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

top

Returns the top marginal element in the AdjointLayout

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. NdLayout ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping

NdLayout is a UniformNdMapping providing an n-dimensional data structure to display the contained Elements and containers in a layout. Using the cols method the NdLayout can be rearranged with the desired number of columns.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( *args , **overrides ) [source]

Clones the NdLayout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned NdLayout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
grid_items ( ) [source]

Compute a dict of {(row,column): (key, value)} elements from the current set of items and specified number of columns.

group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns another NdLayout constituted of the last views of the individual elements (if they are maps).

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.NdLayout'>)
shape

Tuple indicating the number of rows and columns in the NdLayout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. Empty [source]

Bases: holoviews.core.dimension.Dimensioned , holoviews.core.layout.Composable

Empty may be used to define an empty placeholder in a Layout. It can be placed in a Layout just like any regular Element and container type via the + operator or by passing it to the Layout constructor as a part of a list.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Empty, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Empty'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. Layout ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.dimension.ViewableTree

A Layout is an ViewableTree with ViewableElement objects as leaf values. Unlike ViewableTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual ViewableTree indexing, Layout supports indexing of items by their row and column index in the layout.

The maximum number of columns in such a layout may be controlled with the cols method.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Layout, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( *args , **overrides ) [source]

Clones the Layout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned Layout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
from_values ( vals )

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group )

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

shape

Tuple indicating the number of rows and columns in the Layout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. UniformNdMapping ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.NdMapping

A UniformNdMapping is a map of Dimensioned objects and is itself indexed over a number of specified dimensions. The dimension may be a spatial dimension (i.e., a ZStack), time (specifying a frame sequence) or any other combination of Dimensions.

UniformNdMapping objects can be sliced, sampled, reduced, overlaid and split along its and its containing Element’s dimensions. Subclasses should implement the appropriate slicing, sampling and reduction methods for their Dimensioned type.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.layout. NdMapping ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.MultiDimensionalMapping

NdMapping supports the same indexing semantics as MultiDimensionalMapping but also supports slicing semantics.

Slicing semantics on an NdMapping is dependent on the ordering semantics of the keys. As MultiDimensionalMapping sort the keys, a slice on an NdMapping is effectively a way of filtering out the keys that are outside the slice range.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( )

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


ndmapping Module

Inheritance diagram of holoviews.core.ndmapping

Supplies MultiDimensionalMapping and NdMapping which are multi-dimensional map types. The former class only allows indexing whereas the latter also enables slicing over multiple dimension ranges.

class holoviews.core.ndmapping. MultiDimensionalMapping ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

An MultiDimensionalMapping is a Dimensioned mapping (like a dictionary or array) that uses fixed-length multidimensional keys. This behaves like a sparse N-dimensional array that does not require a dense sampling over the multidimensional space.

If the underlying value for each (key, value) pair also supports indexing (such as a dictionary, array, or list), fully qualified (deep) indexing may be used from the top level, with the first N dimensions of the index selecting a particular Dimensioned object and the remaining dimensions indexing into that object.

For instance, for a MultiDimensionalMapping with dimensions “Year” and “Month” and underlying values that are 2D floating-point arrays indexed by (r,c), a 2D array may be indexed with x[2000,3] and a single floating-point number may be indexed as x[2000,3,1,9].

In practice, this class is typically only used as an abstract base class, because the NdMapping subclass extends it with a range of useful slicing methods for selecting subsets of the data. Even so, keeping the slicing support separate from the indexing and data storage methods helps make both classes easier to understand.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=MultiDimensionalMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs ) [source]

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( ) [source]

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions ) [source]

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>)
get ( key , default=None ) [source]

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs ) [source]

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>)
items ( ) [source]

Returns all elements as a list in (key,value) format.

keys ( ) [source]

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None ) [source]

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False ) [source]

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs ) [source]

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other ) [source]

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( ) [source]

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.ndmapping. NdMapping ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.MultiDimensionalMapping

NdMapping supports the same indexing semantics as MultiDimensionalMapping but also supports slicing semantics.

Slicing semantics on an NdMapping is dependent on the ordering semantics of the keys. As MultiDimensionalMapping sort the keys, a slice on an NdMapping is effectively a way of filtering out the keys that are outside the slice range.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( )

Deprecated method to convert a MultiDimensionalMapping to a pandas DataFrame. Conversion to a dataframe now only supported by specific subclasses such as UniformNdMapping types.

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.NdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.ndmapping. UniformNdMapping ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.NdMapping

A UniformNdMapping is a map of Dimensioned objects and is itself indexed over a number of specified dimensions. The dimension may be a spatial dimension (i.e., a ZStack), time (specifying a frame sequence) or any other combination of Dimensions.

UniformNdMapping objects can be sliced, sampled, reduced, overlaid and split along its and its containing Element’s dimensions. Subclasses should implement the appropriate slicing, sampling and reduction methods for their Dimensioned type.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.ndmapping. item_check ( enabled ) [source]

Bases: object

Context manager to allow creating NdMapping types without performing the usual item_checks, providing significant speedups when there are a lot of items. Should only be used when both keys and values are guaranteed to be the right type, as is the case for many internal operations.

class holoviews.core.ndmapping. sorted_context ( enabled ) [source]

Bases: object

Context manager to temporarily disable sorting on NdMapping types. Retains the current sort order, which can be useful as an optimization on NdMapping instances where sort=True but the items are already known to have been sorted.


operation Module

Inheritance diagram of holoviews.core.operation

Operations manipulate Elements, HoloMaps and Layouts, typically for the purposes of analysis or visualization.

class holoviews.core.operation. Operation ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

An Operation process an Element or HoloMap at the level of individual elements or overlays. If a holomap is passed in as input, a processed holomap is returned as output where the individual elements have been transformed accordingly. An Operation may turn overlays in new elements or vice versa.

An Operation can be set to be dynamic, which will return a DynamicMap with a callback that will apply the operation dynamically. An Operation may also supply a list of Stream classes on a streams parameter, which can allow dynamic control over the parameters on the operation.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=False, default=Operation, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The group string used to identify the output of the Operation. By default this should match the operation name.
param ObjectSelector dynamic ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=default, instantiate=False, names=None, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the operation should be applied dynamically when a specific frame is requested, specified as a Boolean. If set to ‘default’ the mode will be determined based on the input type, i.e. if the data is a DynamicMap it will stay dynamic.
param ClassSelector input_ranges ( allow_None=True, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Ranges to be used for input normalization (if applicable) in a format appropriate for the Normalization.ranges parameter. By default, no normalization is applied. If key-wise normalization is required, a 2-tuple may be supplied where the first component is a Normalization.ranges list and the second component is Normalization.keys.
param Boolean link_inputs ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If the operation is dynamic, whether or not linked streams should be transferred from the operation inputs for backends that support linked streams. For example if an operation is applied to a DynamicMap with an RangeXY, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
param List streams ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
classmethod get_overlay_bounds ( overlay ) [source]

Returns the extents if all the elements of an overlay agree on a consistent extents, otherwise raises an exception.

classmethod get_overlay_label ( overlay , default_label='' ) [source]

Returns a label if all the elements of an overlay agree on a consistent label, otherwise returns the default label.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.operation.Operation'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

process_element ( element , key , **params ) [source]

The process_element method allows a single element to be operated on given an externally supplied key.

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

classmethod search ( element , pattern ) [source]

Helper method that returns a list of elements that match the given path pattern of form {type}.{group}.{label}.

The input may be a Layout, an Overlay type or a single Element.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.Operation'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.operation. OperationCallable ( callable , **kwargs ) [source]

Bases: holoviews.core.spaces.Callable

OperationCallable allows wrapping an Operation and the objects it is processing to allow traversing the operations applied on a DynamicMap.

param Callable callable ( allow_None=True, constant=True, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The callable function being wrapped.
param List inputs ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The list of inputs the callable function is wrapping. Used to allow deep access to streams in chained Callables.
param Boolean link_inputs ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If the Callable wraps around other DynamicMaps in its inputs, determines whether linked streams attached to the inputs are transferred to the objects returned by the Callable. For example the Callable wraps a DynamicMap with an RangeXY stream, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
param Boolean memoize ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the return value of the callable should be memoized based on the call arguments and any streams attached to the inputs.
param Dict stream_mapping ( allow_None=False, constant=True, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Defines how streams should be mapped to objects returned by the Callable, e.g. when it returns a Layout.
param ClassSelector operation ( allow_None=True, constant=False, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The Operation being wrapped into an OperationCallable.
clone ( callable=None , **overrides )

Clones the Callable optionally with new settings

Args:
callable: New callable function to wrap ** overrides: Parameter overrides to apply
Returns:
Cloned Callable object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.OperationCallable'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.OperationCallable'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.OperationCallable'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.OperationCallable'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

noargs

Returns True if the callable takes no arguments

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.OperationCallable'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.operation.OperationCallable'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


options Module

Inheritance diagram of holoviews.core.options

Options and OptionTrees allow different classes of options (e.g. matplotlib-specific styles and plot specific parameters) to be defined separately from the core data structures and away from visualization specific code.

There are three classes that form the options system:

Cycle:

Used to define infinite cycles over a finite set of elements, using either an explicit list or some pre-defined collection (e.g from matplotlib rcParams). For instance, a Cycle object can be used loop a set of display colors for multiple curves on a single axis.

Options:

Containers of arbitrary keyword values, including optional keyword validation, support for Cycle objects and inheritance.

OptionTree:

A subclass of AttrTree that is used to define the inheritance relationships between a collection of Options objects. Each node of the tree supports a group of Options objects and the leaf nodes inherit their keyword values from parent nodes up to the root.

Store:

A singleton class that stores all global and custom options and links HoloViews objects, the chosen plotting backend and the IPython extension together.
exception holoviews.core.options. AbbreviatedException ( etype , value , traceback ) [source]

Bases: Exception

Raised by the abbreviate_exception context manager when it is appropriate to present an abbreviated the traceback and exception message in the notebook.

Particularly useful when processing style options supplied by the user which may not be valid.

print_traceback ( ) [source]

Print the traceback of the exception wrapped by the AbbreviatedException.

with_traceback ( )

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class holoviews.core.options. Compositor ( pattern , operation , group , mode , transfer_options=False , transfer_parameters=False , output_type=None , backends=None , **kwargs ) [source]

Bases: param.parameterized.Parameterized

A Compositor is a way of specifying an operation to be automatically applied to Overlays that match a specified pattern upon display.

Any Operation that takes an Overlay as input may be used to define a compositor.

For instance, a compositor may be defined to automatically display three overlaid monochrome matrices as an RGB image as long as the values names of those matrices match ‘R’, ‘G’ and ‘B’.

param ObjectSelector mode ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=data, instantiate=False, names=None, objects=[‘data’, ‘display’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The mode of the Compositor object which may be either ‘data’ or ‘display’.
param List backends ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Defines which backends to apply the Compositor for.
param Parameter operation ( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The Operation to apply when collapsing overlays.
param String pattern ( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The overlay pattern to be processed. An overlay pattern is a sequence of elements specified by dotted paths separated by * . For instance the following pattern specifies three overlayed matrices with values of ‘RedChannel’, ‘GreenChannel’ and ‘BlueChannel’ respectively: ‘Image.RedChannel * Image.GreenChannel * Image.BlueChannel. This pattern specification could then be associated with the RGB operation that returns a single RGB matrix for display.
param String group ( allow_None=True, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The group identifier for the output of this particular compositor
param Dict kwargs ( allow_None=True, constant=False, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Optional set of parameters to pass to the operation.
param Boolean transfer_options ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to transfer the options from the input to the output.
param Boolean transfer_parameters ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to transfer plot options which match to the operation.
apply ( value , input_ranges , backend=None ) [source]

Apply the compositor on the input with the given input ranges.

classmethod collapse ( holomap , ranges=None , mode='data' ) [source]

Given a map of Overlays, apply all applicable compositors.

classmethod collapse_element ( overlay , ranges=None , mode='data' , backend=None ) [source]

Finds any applicable compositor and applies it.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Compositor'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Compositor'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Compositor'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Compositor'>)
classmethod map ( obj , mode='data' , backend=None ) [source]

Applies compositor operations to any HoloViews element or container using the map method.

match_level ( overlay ) [source]

Given an overlay, return the match level and applicable slice of the overall overlay. The level an integer if there is a match or None if there is no match.

The level integer is the number of matching components. Higher values indicate a stronger match.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

output_type

Returns the operation output_type unless explicitly overridden in the kwargs.

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Compositor'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Compositor'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

classmethod strongest_match ( overlay , mode , backend=None ) [source]

Returns the single strongest matching compositor operation given an overlay. If no matches are found, None is returned.

The best match is defined as the compositor operation with the highest match value as returned by the match_level method.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.options. Cycle ( cycle=None , **params ) [source]

Bases: param.parameterized.Parameterized

A simple container class that specifies cyclic options. A typical example would be to cycle the curve colors in an Overlay composed of an arbitrary number of curves. The values may be supplied as an explicit list or a key to look up in the default cycles attribute.

param String key ( allow_None=True, basestring=<class ‘str’>, constant=False, default=default_colors, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The key in the default_cycles dictionary used to specify the color cycle if values is not supplied.
param List values ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The values the cycle will iterate over.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Cycle'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Cycle'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Cycle'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Cycle'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Cycle'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Cycle'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.options. Keywords ( values=[] , target=None ) [source]

Bases: param.parameterized.Parameterized

A keywords objects represents a set of Python keywords. It is list-like and ordered but it is also a set without duplicates. When passed as ** kwargs, Python keywords are not ordered but this class always lists keywords in sorted order.

In addition to containing the list of keywords, Keywords has an optional target which describes what the keywords are applicable to.

This class is for internal use only and should not be in the user namespace.

param List values ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Set of keywords as a sorted list.
param String target ( allow_None=True, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional string description of what the keywords apply to.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Keywords'>)
fuzzy_match ( kw ) [source]

Given a string, fuzzy match against the Keyword values, returning a list of close matches.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Keywords'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Keywords'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Keywords'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Keywords'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Keywords'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

exception holoviews.core.options. OptionError ( invalid_keyword , allowed_keywords , group_name=None , path=None ) [source]

Bases: Exception

Custom exception raised when there is an attempt to apply invalid options. Stores the necessary information to construct a more readable message for the user if caught and processed appropriately.

format_options_error ( ) [source]

Return a fuzzy match message based on the OptionError

with_traceback ( )

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class holoviews.core.options. OptionTree ( items=None , identifier=None , parent=None , groups=None , options=None , **kwargs ) [source]

Bases: holoviews.core.tree.AttrTree

A subclass of AttrTree that is used to define the inheritance relationships between a collection of Options objects. Each node of the tree supports a group of Options objects and the leaf nodes inherit their keyword values from parent nodes up to the root.

Supports the ability to search the tree for the closest valid path using the find method, or compute the appropriate Options value given an object and a mode. For a given node of the tree, the options method computes a Options object containing the result of inheritance for a given group up to the root of the tree.

When constructing an OptionTree, you can specify the option groups as a list (i.e empty initial option groups at the root) or as a dictionary (e.g groups={‘style’:Option()}). You can also initialize the OptionTree with the options argument together with the ** kwargs - see StoreOptions.merge_options for more information on the options specification syntax.

You can use the string specifier ‘.’ to refer to the root node in the options specification. This acts as an alternative was of specifying the options groups of the current node. Note that this approach method may only be used with the group lists format.

closest ( obj , group , defaults=True ) [source]

This method is designed to be called from the root of the tree. Given any LabelledData object, this method will return the most appropriate Options object, including inheritance.

In addition, closest supports custom options by checking the object

filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

find ( path , mode='node' ) [source]

Find the closest node or path to an the arbitrary path that is supplied down the tree from the given node. The mode argument may be either ‘node’ or ‘path’ which determines the return type.

fixed

If fixed, no new paths can be created via attribute access

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

merge ( trees )

Merge a collection of AttrTree objects.

options ( group , target=None , defaults=True ) [source]

Using inheritance up to the root, get the complete Options object for the given node and the specified group.

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

class holoviews.core.options. Options ( key=None , allowed_keywords=[] , merge_keywords=True , max_cycles=None , **kwargs ) [source]

Bases: param.parameterized.Parameterized

An Options object holds a collection of keyword options. In addition, Options support (optional) keyword validation as well as infinite indexing over the set of supplied cyclic values.

Options support inheritance of setting values via the __call__ method. By calling an Options object with additional keywords, you can create a new Options object inheriting the parent options.

param ClassSelector allowed_keywords ( allow_None=True, constant=False, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Optional list of strings corresponding to the allowed keywords.
param String key ( allow_None=True, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional specification of the options key name. For instance, key could be ‘plot’ or ‘style’.
param Boolean merge_keywords ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to merge with the existing keywords if the corresponding node already exists
param Boolean skip_invalid ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether all Options instances should skip invalid keywords or raise and exception. May only be specified at the class level.
param Boolean warn_on_skip ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether all Options instances should generate warnings when skipping over invalid keywords or not. May only be specified at the class level.
cyclic

Returns True if the options cycle, otherwise False

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

filtered ( allowed ) [source]

Return a new Options object that is filtered by the specified list of keys. Mutating self.kwargs to filter is unsafe due to the option expansion that occurs on initialization.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Options'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Options'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Options'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Options'>)
keys ( ) [source]

The keyword names across the supplied options.

keywords_target ( target ) [source]

Helper method to easily set the target on the allowed_keywords Keywords.

max_cycles ( num ) [source]

Truncates all contained Palette objects to a maximum number of samples and returns a new Options object containing the truncated or resampled Palettes.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options

Access of the options keywords when no cycles are defined.

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Options'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Options'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.options. Palette ( key , **params ) [source]

Bases: holoviews.core.options.Cycle

Palettes allow easy specifying a discrete sampling of an existing colormap. Palettes may be supplied a key to look up a function function in the colormap class attribute. The function should accept a float scalar in the specified range and return a RGB(A) tuple. The number of samples may also be specified as a parameter.

The range and samples may conveniently be overridden with the __getitem__ method.

param String key ( allow_None=False, basestring=<class ‘str’>, constant=False, default=grayscale, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Palettes look up the Palette values based on some key.
param List values ( allow_None=False, bounds=(0, None), constant=False, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The values the cycle will iterate over.
param NumericTuple range ( allow_None=False, constant=False, default=(0, 1), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The range from which the Palette values are sampled.
param Integer samples ( allow_None=False, bounds=None, constant=False, default=32, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The number of samples in the given range to supply to the sample_fn.
param Callable sample_fn ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The function to generate the samples, by default linear.
param Boolean reverse ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to reverse the palette.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Palette'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Palette'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Palette'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Palette'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

sample_fn ( start , stop , num=50 , endpoint=True , retstep=False , dtype=None )

Return evenly spaced numbers over a specified interval.

Returns num evenly spaced samples, calculated over the interval [ start , stop ].

The endpoint of the interval can optionally be excluded.

start : scalar
The starting value of the sequence.
stop : scalar
The end value of the sequence, unless endpoint is set to False. In that case, the sequence consists of all but the last of num + 1 evenly spaced samples, so that stop is excluded. Note that the step size changes when endpoint is False.
num : int, optional
Number of samples to generate. Default is 50. Must be non-negative.
endpoint : bool, optional
If True, stop is the last sample. Otherwise, it is not included. Default is True.
retstep : bool, optional
If True, return ( samples , step ), where step is the spacing between samples.
dtype : dtype, optional

The type of the output array. If dtype is not given, infer the data type from the other input arguments.

New in version 1.9.0.

samples : ndarray
There are num equally spaced samples in the closed interval [start, stop] or the half-open interval [start, stop) (depending on whether endpoint is True or False).
step : float, optional

Only returned if retstep is True

Size of spacing between samples.

arange : Similar to linspace , but uses a step size (instead of the
number of samples).

logspace : Samples uniformly distributed in log space.

>>> np.linspace(2.0, 3.0, num=5)
array([ 2.  ,  2.25,  2.5 ,  2.75,  3.  ])
>>> np.linspace(2.0, 3.0, num=5, endpoint=False)
array([ 2. ,  2.2,  2.4,  2.6,  2.8])
>>> np.linspace(2.0, 3.0, num=5, retstep=True)
(array([ 2.  ,  2.25,  2.5 ,  2.75,  3.  ]), 0.25)

Graphical illustration:

>>> import matplotlib.pyplot as plt
>>> N = 8
>>> y = np.zeros(N)
>>> x1 = np.linspace(0, 10, N, endpoint=True)
>>> x2 = np.linspace(0, 10, N, endpoint=False)
>>> plt.plot(x1, y, 'o')
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.plot(x2, y + 0.5, 'o')
[<matplotlib.lines.Line2D object at 0x...>]
>>> plt.ylim([-0.5, 1])
(-0.5, 1)
>>> plt.show()
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Palette'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.options.Palette'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

exception holoviews.core.options. SkipRendering ( message='' , warn=True ) [source]

Bases: Exception

A SkipRendering exception in the plotting code will make the display hooks fall back to a text repr. Used to skip rendering of DynamicMaps with exhausted element generators.

with_traceback ( )

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class holoviews.core.options. Store [source]

Bases: object

The Store is what links up HoloViews objects to their corresponding options and to the appropriate classes of the chosen backend (e.g for rendering).

In addition, Store supports pickle operations that automatically pickle and unpickle the corresponding options for a HoloViews object.

classmethod add_style_opts ( component , new_options , backend=None ) [source]

Given a component such as an Element (e.g. Image, Curve) or a container (e.g Layout) specify new style options to be accepted by the corresponding plotting class.

Note: This is supplied for advanced users who know which additional style keywords are appropriate for the corresponding plotting class.

classmethod dump ( obj , file , protocol=0 ) [source]

Equivalent to pickle.dump except that the HoloViews option tree is saved appropriately.

classmethod dumps ( obj , protocol=0 ) [source]

Equivalent to pickle.dumps except that the HoloViews option tree is saved appropriately.

classmethod info ( obj , ansi=True , backend='matplotlib' , visualization=True , recursive=False , pattern=None , elements=[] ) [source]

Show information about a particular object or component class including the applicable style and plot options. Returns None if the object is not parameterized.

classmethod load ( filename ) [source]

Equivalent to pickle.load except that the HoloViews trees is restored appropriately.

classmethod loaded_backends ( ) [source]

Returns a list of the backends that have been loaded, based on the available OptionTrees.

classmethod loads ( pickle_string ) [source]

Equivalent to pickle.loads except that the HoloViews trees is restored appropriately.

classmethod lookup ( backend , obj ) [source]

Given an object, lookup the corresponding customized option tree if a single custom tree is applicable.

output_settings

alias of holoviews.util.settings.OutputSettings

classmethod register ( associations , backend , style_aliases={} ) [source]

Register the supplied dictionary of associations between elements and plotting classes to the specified backend.

classmethod render ( obj ) [source]

Using any display hooks that have been registered, render the object to a dictionary of MIME types and metadata information.

classmethod set_current_backend ( backend ) [source]

Use this method to set the backend to run the switch hooks

classmethod set_display_hook ( group , objtype , hook ) [source]

Specify a display hook that will be applied to objects of type objtype. The group specifies the set to which the display hook belongs, allowing the Store to compute the precedence within each group.

classmethod transfer_options ( obj , new_obj , backend=None ) [source]

Transfers options for all backends from one object to another. Drops any options defined in the supplied drop list.

class holoviews.core.options. StoreOptions [source]

Bases: object

A collection of utilities for advanced users for creating and setting customized option trees on the Store. Designed for use by either advanced users or the %opts line and cell magics which use this machinery.

This class also holds general classmethods for working with OptionTree instances: as OptionTrees are designed for attribute access it is best to minimize the number of methods implemented on that class and implement the necessary utilities on StoreOptions instead.

Lastly this class offers a means to record all OptionErrors generated by an option specification. This is used for validation purposes.

classmethod apply_customizations ( spec , options ) [source]

Apply the given option specs to the supplied options tree.

classmethod capture_ids ( obj ) [source]

Given an list of ids, capture a list of ids that can be restored using the restore_ids.

classmethod create_custom_trees ( obj , options=None ) [source]

Returns the appropriate set of customized subtree clones for an object, suitable for merging with Store.custom_options (i.e with the ids appropriately offset). Note if an object has no integer ids a new OptionTree is built.

The id_mapping return value is a list mapping the ids that need to be matched as set to their new values.

classmethod expand_compositor_keys ( spec ) [source]

Expands compositor definition keys into {type}.{group} keys. For instance a compositor operation returning a group string ‘Image’ of element type RGB expands to ‘RGB.Image’.

classmethod id_offset ( ) [source]

Compute an appropriate offset for future id values given the set of ids currently defined across backends.

classmethod merge_options ( groups , options=None , **kwargs ) [source]

Given a full options dictionary and options groups specified as a keywords, return the full set of merged options:

>>> options={'Curve':{'style':dict(color='b')}}
>>> style={'Curve':{'linewidth':10 }}
>>> merged = StoreOptions.merge_options(['style'], options, style=style)
>>> sorted(merged['Curve']['style'].items())
[('color', 'b'), ('linewidth', 10)]
classmethod options ( obj , options=None , **kwargs ) [source]

Context-manager for temporarily setting options on an object (if options is None, no options will be set) . Once the context manager exits, both the object and the Store will be left in exactly the same state they were in before the context manager was used.

See holoviews.core.options.set_options function for more information on the options specification format.

classmethod propagate_ids ( obj , match_id , new_id , applied_keys , backend=None ) [source]

Recursively propagate an id through an object for components matching the applied_keys. This method can only be called if there is a tree with a matching id in Store.custom_options

classmethod record_skipped_option ( error ) [source]

Record the OptionError associated with a skipped option if currently recording

classmethod restore_ids ( obj , ids ) [source]

Given an list of ids as captured with capture_ids, restore the ids. Note the structure of an object must not change between the calls to capture_ids and restore_ids.

classmethod set_options ( obj , options=None , backend=None , **kwargs ) [source]

Pure Python function for customize HoloViews objects in terms of their style, plot and normalization options.

The options specification is a dictionary containing the target for customization as a {type}.{group}.{label} keys. An example of such a key is ‘Image’ which would customize all Image components in the object. The key ‘Image.Channel’ would only customize Images in the object that have the group ‘Channel’.

The corresponding value is then a list of Option objects specified with an appropriate category (‘plot’, ‘style’ or ‘norm’). For instance, using the keys described above, the specs could be:

{‘Image:[Options(‘style’, cmap=’jet’)]}

Or setting two types of option at once:

{‘Image.Channel’:[Options(‘plot’, size=50),
Options(‘style’, cmap=’Blues’)]}

This function matches the functionality supplied by the %%opts cell magic in the IPython extension. In fact, you can use the same syntax as the IPython cell magic to achieve the same customization as shown above:

from holoviews.util.parser import OptsSpec set_options(my_image, OptsSpec.parse(“Image (cmap=’jet’)”))

Then setting both plot and style options:

set_options(my_image, OptsSpec.parse(“Image [size=50] (cmap=’Blues’)”))

classmethod start_recording_skipped ( ) [source]

Start collecting OptionErrors for all skipped options recorded with the record_skipped_option method

classmethod state ( obj , state=None ) [source]

Method to capture and restore option state. When called without any state supplied, the current state is returned. Then if this state is supplied back in a later call using the same object, the original state is restored.

classmethod stop_recording_skipped ( ) [source]

Stop collecting OptionErrors recorded with the record_skipped_option method and return them

classmethod tree_to_dict ( tree ) [source]

Given an OptionTree, convert it into the equivalent dictionary format.

classmethod update_backends ( id_mapping , custom_trees , backend=None ) [source]

Given the id_mapping from previous ids to new ids and the new custom tree dictionary, update the current backend with the supplied trees and update the keys in the remaining backends to stay linked with the current object.

classmethod validate_spec ( spec , backends=None ) [source]

Given a specification, validated it against the options tree for the specified backends by raising OptionError for invalid options. If backends is None, validates against all the currently loaded backend.

Only useful when invalid keywords generate exceptions instead of skipping i.e Options.skip_invalid is False.

classmethod validation_error_message ( spec , backends=None ) [source]

Returns an options validation error message if there are any invalid keywords. Otherwise returns None.

class holoviews.core.options. abbreviated_exception [source]

Bases: object

Context manager used to to abbreviate tracebacks using an AbbreviatedException when a backend may raise an error due to incorrect style options.

holoviews.core.options. options_policy ( skip_invalid , warn_on_skip ) [source]

Context manager to temporarily set the skip_invalid and warn_on_skip class parameters on Options.


overlay Module

Inheritance diagram of holoviews.core.overlay

Supplies Layer and related classes that allow overlaying of Views, including Overlay. A Layer is the final extension of View base class that allows Views to be overlayed on top of each other.

Also supplies ViewMap which is the primary multi-dimensional Map type for indexing, slicing and animating collections of Views.

class holoviews.core.overlay. ViewableTree ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.tree.AttrTree , holoviews.core.dimension.Dimensioned

A ViewableTree is an AttrTree with Viewable objects as its leaf nodes. It combines the tree like data structure of a tree while extending it with the deep indexable properties of Dimensioned and LabelledData objects.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableTree, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
classmethod from_values ( vals ) [source]

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group ) [source]

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableTree'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. Overlay ( items=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableTree , holoviews.core.overlay.CompositeOverlay

An Overlay consists of multiple Elements (potentially of heterogeneous type) presented one on top each other with a particular z-ordering.

Overlays along with elements constitute the only valid leaf types of a Layout and in fact extend the Layout structure. Overlays are constructed using the * operator (building an identical structure to the + operator).

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableTree, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( function ) [source]

Deprecated method to collapse layers in the Overlay.

collate ( ) [source]

Collates any objects in the Overlay resolving any issues the recommended nesting structure.

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
from_values ( vals )

Deprecated method to construct tree from list of objects

get ( identifier , default=None ) [source]

Get a layer in the Overlay.

Get a particular layer in the Overlay using its path string or an integer index.

Args:
identifier: Index or path string of the item to return default: Value to return if no item is found
Returns:
The indexed layer of the Overlay
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group )

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.Overlay'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. ViewableElement ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

A ViewableElement is a dimensioned datastructure that may be associated with a corresponding atomic visualization. An atomic visualization will display the data on a single set of axes (i.e. excludes multiple subplots that are displayed at once). The only new parameter introduced by ViewableElement is the title associated with the object for display.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.ViewableElement'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. Dimensioned ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.LabelledData

Dimensioned is a base class that allows the data contents of a class to be associated with dimensions. The contents associated with dimensions may be partitioned into one of three types

  • key dimensions: These are the dimensions that can be indexed via

    the __getitem__ method. Dimension objects supporting key dimensions must support indexing over these dimensions and may also support slicing. This list ordering of dimensions describes the positional components of each multi-dimensional indexing operation.

    For instance, if the key dimension names are ‘weight’ followed by ‘height’ for Dimensioned object ‘obj’, then obj[80,175] indexes a weight of 80 and height of 175.

    Accessed using either kdims.

  • value dimensions: These dimensions correspond to any data held

    on the Dimensioned object not in the key dimensions. Indexing by value dimension is supported by dimension name (when there are multiple possible value dimensions); no slicing semantics is supported and all the data associated with that dimension will be returned at once. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either vdims.

  • deep dimensions: These are dynamically computed dimensions that

    belong to other Dimensioned objects that are nested in the data. Objects that support this should enable the _deep_indexable flag. Note that it is not possible to mix value dimensions and deep dimensions.

    Accessed using either ddims.

Dimensioned class support generalized methods for finding the range and type of values along a particular Dimension. The range method relies on the appropriate implementation of the dimension_values methods on subclasses.

The index of an arbitrary dimension is its positional index in the list of all dimensions, starting with the key dimensions, followed by the value dimensions and ending with the deep dimensions.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False ) [source]

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_dimension ( dimension , default=None , strict=False ) [source]

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension ) [source]

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim ) [source]

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True ) [source]

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.dimension.Dimensioned'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. AdjointLayout ( data , **params ) [source]

Bases: holoviews.core.dimension.Dimensioned

An AdjointLayout provides a convenient container to lay out some marginal plots next to a primary plot. This is often useful to display the marginal distributions of a plot next to the primary plot. AdjointLayout accepts a list of up to three elements, which are laid out as follows with the names ‘main’, ‘top’ and ‘right’:

3 | |

|___________|___| | | | 1: main | | | 2: right | 1 | 2 | 3: top | | | |___________|___|

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Dimensioned, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘AdjointLayout’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Applies to the main object in the AdjointLayout.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
get ( key , default=None ) [source]

Returns the viewable corresponding to the supplied string or integer based key.

Args:
key: Numeric or string index: 0) ‘main’ 1) ‘right’ 2) ‘top’ default: Value returned if key not found
Returns:
Indexed value or supplied default
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
group

Group inherited from main element

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
label

Label inherited from main element

main

Returns the main element in the AdjointLayout

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to child up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
right

Returns the right marginal element in the AdjointLayout

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.AdjointLayout'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

top

Returns the top marginal element in the AdjointLayout

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. CompositeOverlay ( data , kdims=None , vdims=None , **params ) [source]

Bases: holoviews.core.dimension.ViewableElement , holoviews.core.layout.Composable

CompositeOverlay provides a common baseclass for Overlay classes.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=ViewableElement, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True ) [source]

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.CompositeOverlay'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. Layout ( items=None , identifier=None , parent=None , **kwargs ) [source]

Bases: holoviews.core.dimension.ViewableTree

A Layout is an ViewableTree with ViewableElement objects as leaf values. Unlike ViewableTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual ViewableTree indexing, Layout supports indexing of items by their row and column index in the layout.

The maximum number of columns in such a layout may be controlled with the cols method.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=Layout, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
clone ( *args , **overrides ) [source]

Clones the Layout, overriding data and parameters.

Args:
data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to * args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor
Returns:
Cloned Layout object
cols ( ncols ) [source]

Sets the maximum number of columns in the NdLayout.

Any items beyond the set number of cols will flow onto a new row. The number of columns control the indexing and display semantics of the NdLayout.

Args:
ncols (int): Number of columns to set on the NdLayout
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Concatenates values on all nodes with requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
filter ( path_filters )

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
from_values ( vals )

Deprecated method to construct tree from list of objects

get ( identifier , default=None )

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
items ( )

Keys and nodes of the AttrTree

keys ( )

Keys of nodes in the AttrTree

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
merge ( trees )

Merge a collection of AttrTree objects.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

path

Returns the path up to the root for the current node.

pop ( identifier , default=None )

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
regroup ( group )

Deprecated method to apply new group to items.

Equivalent functionality possible using:

ViewableTree(tree.relabel(group=’Group’).values())
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.layout.Layout'>)
set_path ( path , val )

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

shape

Tuple indicating the number of rows and columns in the Layout.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
uniform

Whether items in tree have uniform dimensions

update ( other )

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( )

Nodes of the AttrTree

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. UniformNdMapping ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.NdMapping

A UniformNdMapping is a map of Dimensioned objects and is itself indexed over a number of specified dimensions. The dimension may be a spatial dimension (i.e., a ZStack), time (specifying a frame sequence) or any other combination of Dimensions.

UniformNdMapping objects can be sliced, sampled, reduced, overlaid and split along its and its containing Element’s dimensions. Subclasses should implement the appropriate slicing, sampling and reduction methods for their Dimensioned type.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False ) [source]

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.ndmapping.UniformNdMapping'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. NdOverlay ( overlays=None , kdims=None , **params ) [source]

Bases: holoviews.core.overlay.Overlayable , holoviews.core.ndmapping.UniformNdMapping , holoviews.core.overlay.CompositeOverlay

An NdOverlay allows a group of NdOverlay to be overlaid together. NdOverlay can be indexed out of an overlay and an overlay is an iterable that iterates over the contained layers.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Element’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of dimensions the NdOverlay can be indexed by.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , index=0 , **kwargs )

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram index (int, optional): Index of layer to apply hist to
Returns:
AdjointLayout of element and histogram or just the histogram
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.overlay.NdOverlay'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.overlay. Overlayable [source]

Bases: object

Overlayable provides a mix-in class to support the mul operation for overlaying multiple elements.


pprint Module

Inheritance diagram of holoviews.core.pprint

HoloViews can be used to build highly-nested data-structures containing large amounts of raw data. As a result, it is difficult to generate a readable representation that is both informative yet concise.

As a result, HoloViews does not attempt to build representations that can be evaluated with eval; such representations would typically be far too large to be practical. Instead, all HoloViews objects can be represented as tree structures, showing how to access and index into your data.

In addition, there are several different ways of

class holoviews.core.pprint. PrettyPrinter ( **params ) [source]

Bases: param.parameterized.Parameterized

The PrettyPrinter used to print all HoloView objects via the pprint method.

param Boolean show_defaults ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to show default options as part of the repr. If show_options=False this has no effect.
param Boolean show_options ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to show options as part of the repr.
component_type = functools.partial(<function PrettyPrinter.component_type>, <class 'holoviews.core.pprint.PrettyPrinter'>) [source]
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

element_info = functools.partial(<function PrettyPrinter.element_info>, <class 'holoviews.core.pprint.PrettyPrinter'>) [source]
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.pprint.PrettyPrinter'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.pprint.PrettyPrinter'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.pprint.PrettyPrinter'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.pprint.PrettyPrinter'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

node_info = functools.partial(<function PrettyPrinter.node_info>, <class 'holoviews.core.pprint.PrettyPrinter'>) [source]
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

recurse = functools.partial(<function PrettyPrinter.recurse>, <class 'holoviews.core.pprint.PrettyPrinter'>) [source]
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.pprint.PrettyPrinter'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.pprint.PrettyPrinter'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.pprint. InfoPrinter [source]

Bases: object

Class for printing other information related to an object that is of use to the user.

classmethod get_parameter_info ( obj , ansi=False , show_values=True , pattern=None , max_col_len=40 ) [source]

Get parameter information from the supplied class or object.

classmethod heading ( heading_text , char='=' , level=0 , ansi=False ) [source]

Turn the supplied heading text into a suitable heading with optional underline and color.

classmethod info ( obj , ansi=False , backend='matplotlib' , visualization=True , pattern=None , elements=[] ) [source]

Show information about an object in the given category. ANSI color codes may be enabled or disabled.

store

alias of holoviews.core.options.Store


sheetcoords Module

Inheritance diagram of holoviews.core.sheetcoords

File originally part of the Topographica project. Provides SheetCoordinateSystem, allowing conversion between continuous ‘sheet coordinates’ and integer matrix coordinates.

‘Sheet coordinates’ allow simulation parameters to be specified in units that are density-independent, whereas ‘matrix coordinates’ provide a means of realizing the continuous sheets.

Hence we can have a pair of ‘sheet coordinates’ (x,y); floating-point Cartesian coordinates indicating an arbitrary point on the sheet’s plane. We can also have a pair of ‘matrix coordinates’ (r,c), which are used to address an underlying matrix. These matrix coordinates are also floating-point numbers to allow precise conversion between the two schemes. Where it is necessary to address a specific element of the matrix (as is often the case in calculations), we also have the usual matrix index coordinates (r_idx, c_idx). We refer to these as matrixidx coordinates. SheetCoordinateSystem proxies methods for converting between sheet and matrix coordinates, as well as sheet and matrixidx coordinates.

Everyone should use these facilities for conversions between the two coordinate systems to guarantee consistency.

Example of how the matrix stores the representation of the Sheet

For the purposes of this example, assume the goal is a Sheet with density=3 that has a 1 at (-1/2,-1/2), a 5 at (0.0,0.0), and a 9 at (1/2,1/2). More precisely, for this Sheet,

the continuous area from -1/2,-1/2 to -1/6,-1/6 has value 1, the continuous area from -1/6,-1/6 to 1/6,1/6 has value 5, and the continuous area from 1/6,1/6 to 1/2,1/2 has value 9.

With the rest of the elements filled in, the Sheet would look like:

 (-1/2,1/2) -+-----+-----+-----+- (1/2,1/2)
             |     |     |     |
             |  7  |  8  |  9  |
             |     |     |     |
 (-1/2,1/6) -+-----+-----+-----+- (1/2,1/6)
             |     |     |     |
             |  4  |  5  |  6  |
             |     |     |     |
(-1/2,-1/6) -+-----+-----+-----+- (1/2,-1/6)
             |     |     |     |
             |  1  |  2  |  3  |
             |     |     |     |
(-1/2,-1/2) -+-----+-----+-----+- (1/2,-1/2)

where element 5 is centered on 0.0,0.0. A matrix that would match these Sheet coordinates is:

[[7 8 9]
 [4 5 6]
 [1 2 3]]

If we have such a matrix, we can access it in one of two ways: Sheet or matrix/matrixidx coordinates. In matrixidx coordinates, the matrix is indexed by rows and columns, and it is possible to ask for the element at location [0,2] (which returns 9 as in any normal row-major matrix). But the values can additionally be accessed in Sheet coordinates, where the matrix is indexed by a point in the Cartesian plane. In Sheet coordinates, it is possible to ask for the element at location (0.3,0.02), which returns floating-point matrix coordinates that can be cropped to give the nearest matrix element, namely the one with value 6.

Of course, it would be an error to try to pass matrix coordinates like [0,2] to the sheet2matrix calls; the result would be a value far outside of the actual matrix.

class holoviews.core.sheetcoords. SheetCoordinateSystem ( bounds , xdensity , ydensity=None ) [source]

Bases: object

Provides methods to allow conversion between sheet and matrix coordinates.

closest_cell_center ( x , y ) [source]

Given arbitrary sheet coordinates, return the sheet coordinates of the center of the closest unit.

matrix2sheet ( float_row , float_col ) [source]

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().

matrixidx2sheet ( row , col ) [source]

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 sheet2matrixidx(), because sheet2matrixidx() discards all but the integer portion of the continuous matrix coordinate.

Valid only for scalar or array row and col.

sheet2matrix ( x , y ) [source]

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,0.5))) and density=3, x=-0.5 corresponds to float_col=0.0 and x=0.5 corresponds to float_col=3.0. float_col=3.0 is not inside the matrix representing this Sheet, which has the three columns (0,1,2). That is, x=-0.5 is inside the BoundingBox but x=0.5 is outside. Similarly, y=0.5 is inside (at row 0) but y=-0.5 is outside (at row 3) (it’s the other way round for y because the matrix row index increases as y decreases).

sheet2matrixidx ( x , y ) [source]

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 coordinate of the boundary will be just outside the matrix, because the right and bottom boundaries are exclusive.

Valid for scalar or array x and y.

sheetcoordinates_of_matrixidx ( ) [source]

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.

xdensity

The spacing between elements in an underlying matrix representation, in the x direction.

ydensity

The spacing between elements in an underlying matrix representation, in the y direction.

class holoviews.core.sheetcoords. Slice [source]

Bases: numpy.ndarray

Represents a slice of a SheetCoordinateSystem; i.e., an array specifying the row and column start and end points for a submatrix of the SheetCoordinateSystem.

The slice is created from the supplied bounds by calculating the slice that corresponds most closely to the specified bounds. Therefore, the slice does not necessarily correspond exactly to the specified bounds. The bounds that do exactly correspond to the slice are available via the ‘bounds’ attribute.

Note that the slice does not respect the bounds of the SheetCoordinateSystem, and that actions such as translate() also do not respect the bounds. To ensure that the slice is within the SheetCoordinateSystem’s bounds, use crop_to_sheet().

T

Same as self.transpose(), except that self is returned if self.ndim < 2.

>>> x = np.array([[1.,2.],[3.,4.]])
>>> x
array([[ 1.,  2.],
       [ 3.,  4.]])
>>> x.T
array([[ 1.,  3.],
       [ 2.,  4.]])
>>> x = np.array([1.,2.,3.,4.])
>>> x
array([ 1.,  2.,  3.,  4.])
>>> x.T
array([ 1.,  2.,  3.,  4.])
all ( axis=None , out=None , keepdims=False )

Returns True if all elements evaluate to True.

Refer to numpy.all for full documentation.

numpy.all : equivalent function

any ( axis=None , out=None , keepdims=False )

Returns True if any of the elements of a evaluate to True.

Refer to numpy.any for full documentation.

numpy.any : equivalent function

argmax ( axis=None , out=None )

Return indices of the maximum values along the given axis.

Refer to numpy.argmax for full documentation.

numpy.argmax : equivalent function

argmin ( axis=None , out=None )

Return indices of the minimum values along the given axis of a .

Refer to numpy.argmin for detailed documentation.

numpy.argmin : equivalent function

argpartition ( kth , axis=-1 , kind='introselect' , order=None )

Returns the indices that would partition this array.

Refer to numpy.argpartition for full documentation.

New in version 1.8.0.

numpy.argpartition : equivalent function

argsort ( axis=-1 , kind='quicksort' , order=None )

Returns the indices that would sort this array.

Refer to numpy.argsort for full documentation.

numpy.argsort : equivalent function

astype ( dtype , order='K' , casting='unsafe' , subok=True , copy=True )

Copy of the array, cast to a specified type.

dtype : str or dtype
Typecode or data-type to which the array is cast.
order : {‘C’, ‘F’, ‘A’, ‘K’}, optional
Controls the memory layout order of the result. ‘C’ means C order, ‘F’ means Fortran order, ‘A’ means ‘F’ order if all the arrays are Fortran contiguous, ‘C’ order otherwise, and ‘K’ means as close to the order the array elements appear in memory as possible. Default is ‘K’.
casting : {‘no’, ‘equiv’, ‘safe’, ‘same_kind’, ‘unsafe’}, optional

Controls what kind of data casting may occur. Defaults to ‘unsafe’ for backwards compatibility.

  • ‘no’ means the data types should not be cast at all.
  • ‘equiv’ means only byte-order changes are allowed.
  • ‘safe’ means only casts which can preserve values are allowed.
  • ‘same_kind’ means only safe casts or casts within a kind, like float64 to float32, are allowed.
  • ‘unsafe’ means any data conversions may be done.
subok : bool, optional
If True, then sub-classes will be passed-through (default), otherwise the returned array will be forced to be a base-class array.
copy : bool, optional
By default, astype always returns a newly allocated array. If this is set to false, and the dtype , order , and subok requirements are satisfied, the input array is returned instead of a copy.
arr_t : ndarray
Unless copy is False and the other conditions for returning the input array are satisfied (see description for copy input parameter), arr_t is a new array of the same shape as the input array, with dtype, order given by dtype , order .

Starting in NumPy 1.9, astype method now returns an error if the string dtype to cast to is not long enough in ‘safe’ casting mode to hold the max value of integer/float array that is being casted. Previously the casting was allowed even if the result was truncated.

ComplexWarning
When casting from complex to float or int. To avoid this, one should use a.real.astype(t) .
>>> x = np.array([1, 2, 2.5])
>>> x
array([ 1. ,  2. ,  2.5])
>>> x.astype(int)
array([1, 2, 2])
base

Base object if memory is from some other object.

The base of an array that owns its memory is None:

>>> x = np.array([1,2,3,4])
>>> x.base is None
True

Slicing creates a view, whose memory is shared with x:

>>> y = x[2:]
>>> y.base is x
True
byteswap ( inplace=False )

Swap the bytes of the array elements

Toggle between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place.

inplace : bool, optional
If True , swap bytes in-place, default is False .
out : ndarray
The byteswapped array. If inplace is True , this is a view to self.
>>> A = np.array([1, 256, 8755], dtype=np.int16)
>>> map(hex, A)
['0x1', '0x100', '0x2233']
>>> A.byteswap(inplace=True)
array([  256,     1, 13090], dtype=int16)
>>> map(hex, A)
['0x100', '0x1', '0x3322']

Arrays of strings are not swapped

>>> A = np.array(['ceg', 'fac'])
>>> A.byteswap()
array(['ceg', 'fac'],
      dtype='|S3')
choose ( choices , out=None , mode='raise' )

Use an index array to construct a new array from a set of choices.

Refer to numpy.choose for full documentation.

numpy.choose : equivalent function

clip ( min=None , max=None , out=None )

Return an array whose values are limited to [min, max] . One of max or min must be given.

Refer to numpy.clip for full documentation.

numpy.clip : equivalent function

compress ( condition , axis=None , out=None )

Return selected slices of this array along given axis.

Refer to numpy.compress for full documentation.

numpy.compress : equivalent function

conj ( )

Complex-conjugate all elements.

Refer to numpy.conjugate for full documentation.

numpy.conjugate : equivalent function

conjugate ( )

Return the complex conjugate, element-wise.

Refer to numpy.conjugate for full documentation.

numpy.conjugate : equivalent function

copy ( order='C' )

Return a copy of the array.

order : {‘C’, ‘F’, ‘A’, ‘K’}, optional
Controls the memory layout of the copy. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ means match the layout of a as closely as possible. (Note that this function and numpy.copy() are very similar, but have different default values for their order= arguments.)

numpy.copy numpy.copyto

>>> x = np.array([[1,2,3],[4,5,6]], order='F')
>>> y = x.copy()
>>> x.fill(0)
>>> x
array([[0, 0, 0],
       [0, 0, 0]])
>>> y
array([[1, 2, 3],
       [4, 5, 6]])
>>> y.flags['C_CONTIGUOUS']
True
crop_to_sheet ( sheet_coord_system ) [source]

Crop the slice to the SheetCoordinateSystem’s bounds.

ctypes

An object to simplify the interaction of the array with the ctypes module.

This attribute creates an object that makes it easier to use arrays when calling shared libraries with the ctypes module. The returned object has, among others, data, shape, and strides attributes (see Notes below) which themselves return ctypes objects that can be used as arguments to a shared library.

None

c : Python object
Possessing attributes data, shape, strides, etc.

numpy.ctypeslib

Below are the public attributes of this object which were documented in “Guide to NumPy” (we have omitted undocumented public attributes, as well as documented private attributes):

  • data: A pointer to the memory area of the array as a Python integer. This memory area may contain data that is not aligned, or not in correct byte-order. The memory area may not even be writeable. The array flags and data-type of this array should be respected when passing this attribute to arbitrary C-code to avoid trouble that can include Python crashing. User Beware! The value of this attribute is exactly the same as self._array_interface_[‘data’][0].
  • shape (c_intp*self.ndim): A ctypes array of length self.ndim where the basetype is the C-integer corresponding to dtype(‘p’) on this platform. This base-type could be c_int, c_long, or c_longlong depending on the platform. The c_intp type is defined accordingly in numpy.ctypeslib. The ctypes array contains the shape of the underlying array.
  • strides (c_intp*self.ndim): A ctypes array of length self.ndim where the basetype is the same as for the shape attribute. This ctypes array contains the strides information from the underlying array. This strides information is important for showing how many bytes must be jumped to get to the next element in the array.
  • data_as(obj): Return the data pointer cast to a particular c-types object. For example, calling self._as_parameter_ is equivalent to self.data_as(ctypes.c_void_p). Perhaps you want to use the data as a pointer to a ctypes array of floating-point data: self.data_as(ctypes.POINTER(ctypes.c_double)).
  • shape_as(obj): Return the shape tuple as an array of some other c-types type. For example: self.shape_as(ctypes.c_short).
  • strides_as(obj): Return the strides tuple as an array of some other c-types type. For example: self.strides_as(ctypes.c_longlong).

Be careful using the ctypes attribute - especially on temporary arrays or arrays constructed on the fly. For example, calling (a+b).ctypes.data_as(ctypes.c_void_p) returns a pointer to memory that is invalid because the array created as (a+b) is deallocated before the next Python statement. You can avoid this problem using either c=a+b or ct=(a+b).ctypes . In the latter case, ct will hold a reference to the array until ct is deleted or re-assigned.

If the ctypes module is not available, then the ctypes attribute of array objects still returns something useful, but ctypes objects are not returned and errors may be raised instead. In particular, the object will still have the as parameter attribute which will return an integer equal to the data attribute.

>>> import ctypes
>>> x
array([[0, 1],
       [2, 3]])
>>> x.ctypes.data
30439712
>>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_long))
<ctypes.LP_c_long object at 0x01F01300>
>>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_long)).contents
c_long(0)
>>> x.ctypes.data_as(ctypes.POINTER(ctypes.c_longlong)).contents
c_longlong(4294967296L)
>>> x.ctypes.shape
<numpy.core._internal.c_long_Array_2 object at 0x01FFD580>
>>> x.ctypes.shape_as(ctypes.c_long)
<numpy.core._internal.c_long_Array_2 object at 0x01FCE620>
>>> x.ctypes.strides
<numpy.core._internal.c_long_Array_2 object at 0x01FCE620>
>>> x.ctypes.strides_as(ctypes.c_longlong)
<numpy.core._internal.c_longlong_Array_2 object at 0x01F01300>
cumprod ( axis=None , dtype=None , out=None )

Return the cumulative product of the elements along the given axis.

Refer to numpy.cumprod for full documentation.

numpy.cumprod : equivalent function

cumsum ( axis=None , dtype=None , out=None )

Return the cumulative sum of the elements along the given axis.

Refer to numpy.cumsum for full documentation.

numpy.cumsum : equivalent function

data

Python buffer object pointing to the start of the array’s data.

diagonal ( offset=0 , axis1=0 , axis2=1 )

Return specified diagonals. In NumPy 1.9 the returned array is a read-only view instead of a copy as in previous NumPy versions. In a future version the read-only restriction will be removed.

Refer to numpy.diagonal() for full documentation.

numpy.diagonal : equivalent function

dot ( b , out=None )

Dot product of two arrays.

Refer to numpy.dot for full documentation.

numpy.dot : equivalent function

>>> a = np.eye(2)
>>> b = np.ones((2, 2)) * 2
>>> a.dot(b)
array([[ 2.,  2.],
       [ 2.,  2.]])

This array method can be conveniently chained:

>>> a.dot(b).dot(b)
array([[ 8.,  8.],
       [ 8.,  8.]])
dtype

Data-type of the array’s elements.

None

d : numpy dtype object

numpy.dtype

>>> x
array([[0, 1],
       [2, 3]])
>>> x.dtype
dtype('int32')
>>> type(x.dtype)
<type 'numpy.dtype'>
dump ( file )

Dump a pickle of the array to the specified file. The array can be read back with pickle.load or numpy.load.

file : str
A string naming the dump file.
dumps ( )

Returns the pickle of the array as a string. pickle.loads or numpy.loads will convert the string back to an array.

None

fill ( value )

Fill the array with a scalar value.

value : scalar
All elements of a will be assigned this value.
>>> a = np.array([1, 2])
>>> a.fill(0)
>>> a
array([0, 0])
>>> a = np.empty(2)
>>> a.fill(1)
>>> a
array([ 1.,  1.])
static findinputslice ( coord , sliceshape , sheetshape ) [source]

Gets the matrix indices of a slice within an array of size sheetshape from a sliceshape, positioned at coord.

flags

Information about the memory layout of the array.

C_CONTIGUOUS (C)
The data is in a single, C-style contiguous segment.
F_CONTIGUOUS (F)
The data is in a single, Fortran-style contiguous segment.
OWNDATA (O)
The array owns the memory it uses or borrows it from another object.
WRITEABLE (W)
The data area can be written to. Setting this to False locks the data, making it read-only. A view (slice, etc.) inherits WRITEABLE from its base array at creation time, but a view of a writeable array may be subsequently locked while the base array remains writeable. (The opposite is not true, in that a view of a locked array may not be made writeable. However, currently, locking a base object does not lock any views that already reference it, so under that circumstance it is possible to alter the contents of a locked array via a previously created writeable view onto it.) Attempting to change a non-writeable array raises a RuntimeError exception.
ALIGNED (A)
The data and all elements are aligned appropriately for the hardware.
WRITEBACKIFCOPY (X)
This array is a copy of some other array. The C-API function PyArray_ResolveWritebackIfCopy must be called before deallocating to the base array will be updated with the contents of this array.
UPDATEIFCOPY (U)
(Deprecated, use WRITEBACKIFCOPY) This array is a copy of some other array. When this array is deallocated, the base array will be updated with the contents of this array.
FNC
F_CONTIGUOUS and not C_CONTIGUOUS.
FORC
F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
BEHAVED (B)
ALIGNED and WRITEABLE.
CARRAY (CA)
BEHAVED and C_CONTIGUOUS.
FARRAY (FA)
BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS.

The flags object can be accessed dictionary-like (as in a.flags['WRITEABLE'] ), or by using lowercased attribute names (as in a.flags.writeable ). Short flag names are only supported in dictionary access.

Only the WRITEBACKIFCOPY, UPDATEIFCOPY, WRITEABLE, and ALIGNED flags can be changed by the user, via direct assignment to the attribute or dictionary entry, or by calling ndarray.setflags .

The array flags cannot be set arbitrarily:

  • UPDATEIFCOPY can only be set False .
  • WRITEBACKIFCOPY can only be set False .
  • ALIGNED can only be set True if the data is truly aligned.
  • WRITEABLE can only be set True if the array owns its own memory or the ultimate owner of the memory exposes a writeable buffer interface or is a string.

Arrays can be both C-style and Fortran-style contiguous simultaneously. This is clear for 1-dimensional arrays, but can also be true for higher dimensional arrays.

Even for contiguous arrays a stride for a given dimension arr.strides[dim] may be arbitrary if arr.shape[dim] == 1 or the array has no elements. It does not generally hold that self.strides[-1] == self.itemsize for C-style contiguous arrays or self.strides[0] == self.itemsize for Fortran-style contiguous arrays is true.

flat

A 1-D iterator over the array.

This is a numpy.flatiter instance, which acts similarly to, but is not a subclass of, Python’s built-in iterator object.

flatten : Return a copy of the array collapsed into one dimension.

flatiter

>>> x = np.arange(1, 7).reshape(2, 3)
>>> x
array([[1, 2, 3],
       [4, 5, 6]])
>>> x.flat[3]
4
>>> x.T
array([[1, 4],
       [2, 5],
       [3, 6]])
>>> x.T.flat[3]
5
>>> type(x.flat)
<type 'numpy.flatiter'>

An assignment example:

>>> x.flat = 3; x
array([[3, 3, 3],
       [3, 3, 3]])
>>> x.flat[[1,4]] = 1; x
array([[3, 1, 3],
       [3, 1, 3]])
flatten ( order='C' )

Return a copy of the array collapsed into one dimension.

order : {‘C’, ‘F’, ‘A’, ‘K’}, optional
‘C’ means to flatten in row-major (C-style) order. ‘F’ means to flatten in column-major (Fortran- style) order. ‘A’ means to flatten in column-major order if a is Fortran contiguous in memory, row-major order otherwise. ‘K’ means to flatten a in the order the elements occur in memory. The default is ‘C’.
y : ndarray
A copy of the input array, flattened to one dimension.

ravel : Return a flattened array. flat : A 1-D flat iterator over the array.

>>> a = np.array([[1,2], [3,4]])
>>> a.flatten()
array([1, 2, 3, 4])
>>> a.flatten('F')
array([1, 3, 2, 4])
getfield ( dtype , offset=0 )

Returns a field of the given array as a certain type.

A field is a view of the array data with a given data-type. The values in the view are determined by the given type and the offset into the current array in bytes. The offset needs to be such that the view dtype fits in the array dtype; for example an array of dtype complex128 has 16-byte elements. If taking a view with a 32-bit integer (4 bytes), the offset needs to be between 0 and 12 bytes.

dtype : str or dtype
The data type of the view. The dtype size of the view can not be larger than that of the array itself.
offset : int
Number of bytes to skip before beginning the element view.
>>> x = np.diag([1.+1.j]*2)
>>> x[1, 1] = 2 + 4.j
>>> x
array([[ 1.+1.j,  0.+0.j],
       [ 0.+0.j,  2.+4.j]])
>>> x.getfield(np.float64)
array([[ 1.,  0.],
       [ 0.,  2.]])

By choosing an offset of 8 bytes we can select the complex part of the array for our view:

>>> x.getfield(np.float64, offset=8)
array([[ 1.,  0.],
   [ 0.,  4.]])
imag

The imaginary part of the array.

>>> x = np.sqrt([1+0j, 0+1j])
>>> x.imag
array([ 0.        ,  0.70710678])
>>> x.imag.dtype
dtype('float64')
item ( *args )

Copy an element of an array to a standard Python scalar and return it.

*args : Arguments (variable number and type)

  • none: in this case, the method only works for arrays with one element ( a.size == 1 ), which element is copied into a standard Python scalar object and returned.
  • int_type: this argument is interpreted as a flat index into the array, specifying which element to copy and return.
  • tuple of int_types: functions as does a single int_type argument, except that the argument is interpreted as an nd-index into the array.
z : Standard Python scalar object
A copy of the specified element of the array as a suitable Python scalar

When the data type of a is longdouble or clongdouble, item() returns a scalar array object because there is no available Python scalar that would not lose information. Void arrays return a buffer object for item(), unless fields are defined, in which case a tuple is returned.

item is very similar to a[args], except, instead of an array scalar, a standard Python scalar is returned. This can be useful for speeding up access to elements of the array and doing arithmetic on elements of the array using Python’s optimized math.

>>> x = np.random.randint(9, size=(3, 3))
>>> x
array([[3, 1, 7],
       [2, 8, 3],
       [8, 5, 3]])
>>> x.item(3)
2
>>> x.item(7)
5
>>> x.item((0, 1))
1
>>> x.item((2, 2))
3
itemset ( *args )

Insert scalar into an array (scalar is cast to array’s dtype, if possible)

There must be at least 1 argument, and define the last argument as item . Then, a.itemset(*args) is equivalent to but faster than a[args] = item . The item should be a scalar value and args must select a single item in the array a .

\*args : Arguments
If one argument: a scalar, only used in case a is of size 1. If two arguments: the last argument is the value to be set and must be a scalar, the first argument specifies a single array element location. It is either an int or a tuple.

Compared to indexing syntax, itemset provides some speed increase for placing a scalar into a particular location in an ndarray , if you must do this. However, generally this is discouraged: among other problems, it complicates the appearance of the code. Also, when using itemset (and item ) inside a loop, be sure to assign the methods to a local variable to avoid the attribute look-up at each loop iteration.

>>> x = np.random.randint(9, size=(3, 3))
>>> x
array([[3, 1, 7],
       [2, 8, 3],
       [8, 5, 3]])
>>> x.itemset(4, 0)
>>> x.itemset((2, 2), 9)
>>> x
array([[3, 1, 7],
       [2, 0, 3],
       [8, 5, 9]])
itemsize

Length of one array element in bytes.

>>> x = np.array([1,2,3], dtype=np.float64)
>>> x.itemsize
8
>>> x = np.array([1,2,3], dtype=np.complex128)
>>> x.itemsize
16
max ( axis=None , out=None , keepdims=False )

Return the maximum along a given axis.

Refer to numpy.amax for full documentation.

numpy.amax : equivalent function

mean ( axis=None , dtype=None , out=None , keepdims=False )

Returns the average of the array elements along given axis.

Refer to numpy.mean for full documentation.

numpy.mean : equivalent function

min ( axis=None , out=None , keepdims=False )

Return the minimum along a given axis.

Refer to numpy.amin for full documentation.

numpy.amin : equivalent function

nbytes

Total bytes consumed by the elements of the array.

Does not include memory consumed by non-element attributes of the array object.

>>> x = np.zeros((3,5,2), dtype=np.complex128)
>>> x.nbytes
480
>>> np.prod(x.shape) * x.itemsize
480
ndim

Number of array dimensions.

>>> x = np.array([1, 2, 3])
>>> x.ndim
1
>>> y = np.zeros((2, 3, 4))
>>> y.ndim
3
newbyteorder ( new_order='S' )

Return the array with the same data viewed with a different byte order.

Equivalent to:

arr.view(arr.dtype.newbytorder(new_order))

Changes are also made in all fields and sub-arrays of the array data type.

new_order : string, optional

Byte order to force; a value from the byte order specifications below. new_order codes can be any of:

  • ‘S’ - swap dtype from current to opposite endian
  • {‘<’, ‘L’} - little endian
  • {‘>’, ‘B’} - big endian
  • {‘=’, ‘N’} - native order
  • {‘|’, ‘I’} - ignore (no change to byte order)

The default value (‘S’) results in swapping the current byte order. The code does a case-insensitive check on the first letter of new_order for the alternatives above. For example, any of ‘B’ or ‘b’ or ‘biggish’ are valid to specify big-endian.

new_arr : array
New array object with the dtype reflecting given change to the byte order.
nonzero ( )

Return the indices of the elements that are non-zero.

Refer to numpy.nonzero for full documentation.

numpy.nonzero : equivalent function

partition ( kth , axis=-1 , kind='introselect' , order=None )

Rearranges the elements in the array in such a way that the value of the element in kth position is in the position it would be in a sorted array. All elements smaller than the kth element are moved before this element and all equal or greater are moved behind it. The ordering of the elements in the two partitions is undefined.

New in version 1.8.0.

kth : int or sequence of ints
Element index to partition by. The kth element value will be in its final sorted position and all smaller elements will be moved before it and all equal or greater elements behind it. The order of all elements in the partitions is undefined. If provided with a sequence of kth it will partition all elements indexed by kth of them into their sorted position at once.
axis : int, optional
Axis along which to sort. Default is -1, which means sort along the last axis.
kind : {‘introselect’}, optional
Selection algorithm. Default is ‘introselect’.
order : str or list of str, optional
When a is an array with fields defined, this argument specifies which fields to compare first, second, etc. A single field can be specified as a string, and not all fields need to be specified, but unspecified fields will still be used, in the order in which they come up in the dtype, to break ties.

numpy.partition : Return a parititioned copy of an array. argpartition : Indirect partition. sort : Full sort.

See np.partition for notes on the different algorithms.

>>> a = np.array([3, 4, 2, 1])
>>> a.partition(3)
>>> a
array([2, 1, 3, 4])
>>> a.partition((1, 3))
array([1, 2, 3, 4])
positionedcrop ( x , y , sheet_coord_system ) [source]

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.

positionlesscrop ( x , y , sheet_coord_system ) [source]

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).

prod ( axis=None , dtype=None , out=None , keepdims=False )

Return the product of the array elements over the given axis

Refer to numpy.prod for full documentation.

numpy.prod : equivalent function

ptp ( axis=None , out=None , keepdims=False )

Peak to peak (maximum - minimum) value along a given axis.

Refer to numpy.ptp for full documentation.

numpy.ptp : equivalent function

put ( indices , values , mode='raise' )

Set a.flat[n] = values[n] for all n in indices.

Refer to numpy.put for full documentation.

numpy.put : equivalent function

ravel ( [ order ] )

Return a flattened array.

Refer to numpy.ravel for full documentation.

numpy.ravel : equivalent function

ndarray.flat : a flat iterator on the array.

real

The real part of the array.

>>> x = np.sqrt([1+0j, 0+1j])
>>> x.real
array([ 1.        ,  0.70710678])
>>> x.real.dtype
dtype('float64')

numpy.real : equivalent function

repeat ( repeats , axis=None )

Repeat elements of an array.

Refer to numpy.repeat for full documentation.

numpy.repeat : equivalent function

reshape ( shape , order='C' )

Returns an array containing the same data with a new shape.

Refer to numpy.reshape for full documentation.

numpy.reshape : equivalent function

Unlike the free function numpy.reshape , this method on ndarray allows the elements of the shape parameter to be passed in as separate arguments. For example, a.reshape(10, 11) is equivalent to a.reshape((10, 11)) .

resize ( new_shape , refcheck=True )

Change shape and size of array in-place.

new_shape : tuple of ints, or n ints
Shape of resized array.
refcheck : bool, optional
If False, reference count will not be checked. Default is True.

None

ValueError
If a does not own its own data or references or views to it exist, and the data memory must be changed. PyPy only: will always raise if the data memory must be changed, since there is no reliable way to determine if references or views to it exist.
SystemError
If the order keyword argument is specified. This behaviour is a bug in NumPy.

resize : Return a new array with the specified shape.

This reallocates space for the data area if necessary.

Only contiguous arrays (data elements consecutive in memory) can be resized.

The purpose of the reference count check is to make sure you do not use this array as a buffer for another Python object and then reallocate the memory. However, reference counts can increase in other ways so if you are sure that you have not shared the memory for this array with another Python object, then you may safely set refcheck to False.

Shrinking an array: array is flattened (in the order that the data are stored in memory), resized, and reshaped:

>>> a = np.array([[0, 1], [2, 3]], order='C')
>>> a.resize((2, 1))
>>> a
array([[0],
       [1]])
>>> a = np.array([[0, 1], [2, 3]], order='F')
>>> a.resize((2, 1))
>>> a
array([[0],
       [2]])

Enlarging an array: as above, but missing entries are filled with zeros:

>>> b = np.array([[0, 1], [2, 3]])
>>> b.resize(2, 3) # new_shape parameter doesn't have to be a tuple
>>> b
array([[0, 1, 2],
       [3, 0, 0]])

Referencing an array prevents resizing…

>>> c = a
>>> a.resize((1, 1))
Traceback (most recent call last):
...
ValueError: cannot resize an array that has been referenced ...

Unless refcheck is False:

>>> a.resize((1, 1), refcheck=False)
>>> a
array([[0]])
>>> c
array([[0]])
round ( decimals=0 , out=None )

Return a with each element rounded to the given number of decimals.

Refer to numpy.around for full documentation.

numpy.around : equivalent function

searchsorted ( v , side='left' , sorter=None )

Find indices where elements of v should be inserted in a to maintain order.

For full documentation, see numpy.searchsorted

numpy.searchsorted : equivalent function

set ( slice_specification ) [source]

Set this slice from some iterable that specifies (r1,r2,c1,c2).

setfield ( val , dtype , offset=0 )

Put a value into a specified place in a field defined by a data-type.

Place val into a ’s field defined by dtype and beginning offset bytes into the field.

val : object
Value to be placed in field.
dtype : dtype object
Data-type of the field in which to place val .
offset : int, optional
The number of bytes into the field at which to place val .

None

getfield

>>> x = np.eye(3)
>>> x.getfield(np.float64)
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
>>> x.setfield(3, np.int32)
>>> x.getfield(np.int32)
array([[3, 3, 3],
       [3, 3, 3],
       [3, 3, 3]])
>>> x
array([[  1.00000000e+000,   1.48219694e-323,   1.48219694e-323],
       [  1.48219694e-323,   1.00000000e+000,   1.48219694e-323],
       [  1.48219694e-323,   1.48219694e-323,   1.00000000e+000]])
>>> x.setfield(np.eye(3), np.int32)
>>> x
array([[ 1.,  0.,  0.],
       [ 0.,  1.,  0.],
       [ 0.,  0.,  1.]])
setflags ( write=None , align=None , uic=None )

Set array flags WRITEABLE, ALIGNED, (WRITEBACKIFCOPY and UPDATEIFCOPY), respectively.

These Boolean-valued flags affect how numpy interprets the memory area used by a (see Notes below). The ALIGNED flag can only be set to True if the data is actually aligned according to the type. The WRITEBACKIFCOPY and (deprecated) UPDATEIFCOPY flags can never be set to True. The flag WRITEABLE can only be set to True if the array owns its own memory, or the ultimate owner of the memory exposes a writeable buffer interface, or is a string. (The exception for string is made so that unpickling can be done without copying memory.)

write : bool, optional
Describes whether or not a can be written to.
align : bool, optional
Describes whether or not a is aligned properly for its type.
uic : bool, optional
Describes whether or not a is a copy of another “base” array.

Array flags provide information about how the memory area used for the array is to be interpreted. There are 7 Boolean flags in use, only four of which can be changed by the user: WRITEBACKIFCOPY, UPDATEIFCOPY, WRITEABLE, and ALIGNED.

WRITEABLE (W) the data area can be written to;

ALIGNED (A) the data and strides are aligned appropriately for the hardware (as determined by the compiler);

UPDATEIFCOPY (U) (deprecated), replaced by WRITEBACKIFCOPY;

WRITEBACKIFCOPY (X) this array is a copy of some other array (referenced by .base). When the C-API function PyArray_ResolveWritebackIfCopy is called, the base array will be updated with the contents of this array.

All flags can be accessed using the single (upper case) letter as well as the full name.

>>> y
array([[3, 1, 7],
       [2, 0, 0],
       [8, 5, 9]])
>>> y.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : True
  WRITEABLE : True
  ALIGNED : True
  WRITEBACKIFCOPY : False
  UPDATEIFCOPY : False
>>> y.setflags(write=0, align=0)
>>> y.flags
  C_CONTIGUOUS : True
  F_CONTIGUOUS : False
  OWNDATA : True
  WRITEABLE : False
  ALIGNED : False
  WRITEBACKIFCOPY : False
  UPDATEIFCOPY : False
>>> y.setflags(uic=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: cannot set WRITEBACKIFCOPY flag to True
shape

Tuple of array dimensions.

The shape property is usually used to get the current shape of an array, but may also be used to reshape the array in-place by assigning a tuple of array dimensions to it. As with numpy.reshape , one of the new shape dimensions can be -1, in which case its value is inferred from the size of the array and the remaining dimensions. Reshaping an array in-place will fail if a copy is required.

>>> x = np.array([1, 2, 3, 4])
>>> x.shape
(4,)
>>> y = np.zeros((2, 3, 4))
>>> y.shape
(2, 3, 4)
>>> y.shape = (3, 8)
>>> y
array([[ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.],
       [ 0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.]])
>>> y.shape = (3, 6)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: total size of new array must be unchanged
>>> np.zeros((4,2))[::2].shape = (-1,)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: incompatible shape for a non-contiguous array

numpy.reshape : similar function ndarray.reshape : similar method

shape_on_sheet ( ) [source]

Return the shape of the array of the Slice on its sheet.

size

Number of elements in the array.

Equal to np.prod(a.shape) , i.e., the product of the array’s dimensions.

a.size returns a standard arbitrary precision Python integer. This may not be the case with other methods of obtaining the same value (like the suggested np.prod(a.shape) , which returns an instance of np.int_ ), and may be relevant if the value is used further in calculations that may overflow a fixed size integer type.

>>> x = np.zeros((3, 5, 2), dtype=np.complex128)
>>> x.size
30
>>> np.prod(x.shape)
30
sort ( axis=-1 , kind='quicksort' , order=None )

Sort an array, in-place.

axis : int, optional
Axis along which to sort. Default is -1, which means sort along the last axis.
kind : {‘quicksort’, ‘mergesort’, ‘heapsort’, ‘stable’}, optional
Sorting algorithm. Default is ‘quicksort’.
order : str or list of str, optional
When a is an array with fields defined, this argument specifies which fields to compare first, second, etc. A single field can be specified as a string, and not all fields need be specified, but unspecified fields will still be used, in the order in which they come up in the dtype, to break ties.

numpy.sort : Return a sorted copy of an array. argsort : Indirect sort. lexsort : Indirect stable sort on multiple keys. searchsorted : Find elements in sorted array. partition: Partial sort.

See sort for notes on the different sorting algorithms.

>>> a = np.array([[1,4], [3,1]])
>>> a.sort(axis=1)
>>> a
array([[1, 4],
       [1, 3]])
>>> a.sort(axis=0)
>>> a
array([[1, 3],
       [1, 4]])

Use the order keyword to specify a field to use when sorting a structured array:

>>> a = np.array([('a', 2), ('c', 1)], dtype=[('x', 'S1'), ('y', int)])
>>> a.sort(order='y')
>>> a
array([('c', 1), ('a', 2)],
      dtype=[('x', '|S1'), ('y', '<i4')])
squeeze ( axis=None )

Remove single-dimensional entries from the shape of a .

Refer to numpy.squeeze for full documentation.

numpy.squeeze : equivalent function

std ( axis=None , dtype=None , out=None , ddof=0 , keepdims=False )

Returns the standard deviation of the array elements along given axis.

Refer to numpy.std for full documentation.

numpy.std : equivalent function

strides

Tuple of bytes to step in each dimension when traversing an array.

The byte offset of element (i[0], i[1], ..., i[n]) in an array a is:

offset = sum(np.array(i) * a.strides)

A more detailed explanation of strides can be found in the “ndarray.rst” file in the NumPy reference guide.

Imagine an array of 32-bit integers (each 4 bytes):

x = np.array([[0, 1, 2, 3, 4],
              [5, 6, 7, 8, 9]], dtype=np.int32)

This array is stored in memory as 40 bytes, one after the other (known as a contiguous block of memory). The strides of an array tell us how many bytes we have to skip in memory to move to the next position along a certain axis. For example, we have to skip 4 bytes (1 value) to move to the next column, but 20 bytes (5 values) to get to the same position in the next row. As such, the strides for the array x will be (20, 4) .

numpy.lib.stride_tricks.as_strided

>>> y = np.reshape(np.arange(2*3*4), (2,3,4))
>>> y
array([[[ 0,  1,  2,  3],
        [ 4,  5,  6,  7],
        [ 8,  9, 10, 11]],
       [[12, 13, 14, 15],
        [16, 17, 18, 19],
        [20, 21, 22, 23]]])
>>> y.strides
(48, 16, 4)
>>> y[1,1,1]
17
>>> offset=sum(y.strides * np.array((1,1,1)))
>>> offset/y.itemsize
17
>>> x = np.reshape(np.arange(5*6*7*8), (5,6,7,8)).transpose(2,3,1,0)
>>> x.strides
(32, 4, 224, 1344)
>>> i = np.array([3,5,2,2])
>>> offset = sum(i * x.strides)
>>> x[3,5,2,2]
813
>>> offset / x.itemsize
813
submatrix ( matrix ) [source]

Return the submatrix of the given matrix specified by this slice.

Equivalent to computing the intersection between the SheetCoordinateSystem’s bounds and the bounds, and returning the corresponding submatrix of the given matrix.

The submatrix is just a view into the sheet_matrix; it is not an independent copy.

sum ( axis=None , dtype=None , out=None , keepdims=False )

Return the sum of the array elements over the given axis.

Refer to numpy.sum for full documentation.

numpy.sum : equivalent function

swapaxes ( axis1 , axis2 )

Return a view of the array with axis1 and axis2 interchanged.

Refer to numpy.swapaxes for full documentation.

numpy.swapaxes : equivalent function

take ( indices , axis=None , out=None , mode='raise' )

Return an array formed from the elements of a at the given indices.

Refer to numpy.take for full documentation.

numpy.take : equivalent function

tobytes ( order='C' )

Construct Python bytes containing the raw data bytes in the array.

Constructs Python bytes showing a copy of the raw contents of data memory. The bytes object can be produced in either ‘C’ or ‘Fortran’, or ‘Any’ order (the default is ‘C’-order). ‘Any’ order means C-order unless the F_CONTIGUOUS flag in the array is set, in which case it means ‘Fortran’ order.

New in version 1.9.0.

order : {‘C’, ‘F’, None}, optional
Order of the data for multidimensional arrays: C, Fortran, or the same as for the original array.
s : bytes
Python bytes exhibiting a copy of a ’s raw data.
>>> x = np.array([[0, 1], [2, 3]])
>>> x.tobytes()
b'\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00'
>>> x.tobytes('C') == x.tobytes()
True
>>> x.tobytes('F')
b'\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00'
tofile ( fid , sep="" , format="%s" )

Write array to a file as text or binary (default).

Data is always written in ‘C’ order, independent of the order of a . The data produced by this method can be recovered using the function fromfile().

fid : file or str
An open file object, or a string containing a filename.
sep : str
Separator between array items for text output. If “” (empty), a binary file is written, equivalent to file.write(a.tobytes()) .
format : str
Format string for text file output. Each entry in the array is formatted to text by first converting it to the closest Python type, and then using “format” % item.

This is a convenience function for quick storage of array data. Information on endianness and precision is lost, so this method is not a good choice for files intended to archive data or transport data between machines with different endianness. Some of these problems can be overcome by outputting the data as text files, at the expense of speed and file size.

When fid is a file object, array contents are directly written to the file, bypassing the file object’s write method. As a result, tofile cannot be used with files objects supporting compression (e.g., GzipFile) or file-like objects that do not support fileno() (e.g., BytesIO).

tolist ( )

Return the array as a (possibly nested) list.

Return a copy of the array data as a (nested) Python list. Data items are converted to the nearest compatible Python type.

none

y : list
The possibly nested list of array elements.

The array may be recreated, a = np.array(a.tolist()) .

>>> a = np.array([1, 2])
>>> a.tolist()
[1, 2]
>>> a = np.array([[1, 2], [3, 4]])
>>> list(a)
[array([1, 2]), array([3, 4])]
>>> a.tolist()
[[1, 2], [3, 4]]
tostring ( order='C' )

Construct Python bytes containing the raw data bytes in the array.

Constructs Python bytes showing a copy of the raw contents of data memory. The bytes object can be produced in either ‘C’ or ‘Fortran’, or ‘Any’ order (the default is ‘C’-order). ‘Any’ order means C-order unless the F_CONTIGUOUS flag in the array is set, in which case it means ‘Fortran’ order.

This function is a compatibility alias for tobytes. Despite its name it returns bytes not strings.

order : {‘C’, ‘F’, None}, optional
Order of the data for multidimensional arrays: C, Fortran, or the same as for the original array.
s : bytes
Python bytes exhibiting a copy of a ’s raw data.
>>> x = np.array([[0, 1], [2, 3]])
>>> x.tobytes()
b'\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00'
>>> x.tobytes('C') == x.tobytes()
True
>>> x.tobytes('F')
b'\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\x00\x00\x00'
trace ( offset=0 , axis1=0 , axis2=1 , dtype=None , out=None )

Return the sum along diagonals of the array.

Refer to numpy.trace for full documentation.

numpy.trace : equivalent function

translate ( r , c ) [source]

Translate the slice by the given number of rows and columns.

transpose ( *axes )

Returns a view of the array with axes transposed.

For a 1-D array, this has no effect. (To change between column and row vectors, first cast the 1-D array into a matrix object.) For a 2-D array, this is the usual matrix transpose. For an n-D array, if axes are given, their order indicates how the axes are permuted (see Examples). If axes are not provided and a.shape = (i[0], i[1], ... i[n-2], i[n-1]) , then a.transpose().shape = (i[n-1], i[n-2], ... i[1], i[0]) .

axes : None, tuple of ints, or n ints

  • None or no argument: reverses the order of the axes.
  • tuple of ints: i in the j -th place in the tuple means a ’s i -th axis becomes a.transpose() ’s j -th axis.
  • n ints: same as an n-tuple of the same ints (this form is intended simply as a “convenience” alternative to the tuple form)
out : ndarray
View of a , with axes suitably permuted.

ndarray.T : Array property returning the array transposed.

>>> a = np.array([[1, 2], [3, 4]])
>>> a
array([[1, 2],
       [3, 4]])
>>> a.transpose()
array([[1, 3],
       [2, 4]])
>>> a.transpose((1, 0))
array([[1, 3],
       [2, 4]])
>>> a.transpose(1, 0)
array([[1, 3],
       [2, 4]])
var ( axis=None , dtype=None , out=None , ddof=0 , keepdims=False )

Returns the variance of the array elements, along given axis.

Refer to numpy.var for full documentation.

numpy.var : equivalent function

view ( dtype=None , type=None )

New view of array with the same data.

dtype : data-type or ndarray sub-class, optional
Data-type descriptor of the returned view, e.g., float32 or int16. The default, None, results in the view having the same data-type as a . This argument can also be specified as an ndarray sub-class, which then specifies the type of the returned object (this is equivalent to setting the type parameter).
type : Python type, optional
Type of the returned view, e.g., ndarray or matrix. Again, the default None results in type preservation.

a.view() is used two different ways:

a.view(some_dtype) or a.view(dtype=some_dtype) constructs a view of the array’s memory with a different data-type. This can cause a reinterpretation of the bytes of memory.

a.view(ndarray_subclass) or a.view(type=ndarray_subclass) just returns an instance of ndarray_subclass that looks at the same array (same shape, dtype, etc.) This does not cause a reinterpretation of the memory.

For a.view(some_dtype) , if some_dtype has a different number of bytes per entry than the previous dtype (for example, converting a regular array to a structured array), then the behavior of the view cannot be predicted just from the superficial appearance of a (shown by print(a) ). It also depends on exactly how a is stored in memory. Therefore if a is C-ordered versus fortran-ordered, versus defined as a slice or transpose, etc., the view may give different results.

>>> x = np.array([(1, 2)], dtype=[('a', np.int8), ('b', np.int8)])

Viewing array data using a different type and dtype:

>>> y = x.view(dtype=np.int16, type=np.matrix)
>>> y
matrix([[513]], dtype=int16)
>>> print(type(y))
<class 'numpy.matrixlib.defmatrix.matrix'>

Creating a view on a structured array so it can be used in calculations

>>> x = np.array([(1, 2),(3,4)], dtype=[('a', np.int8), ('b', np.int8)])
>>> xv = x.view(dtype=np.int8).reshape(-1,2)
>>> xv
array([[1, 2],
       [3, 4]], dtype=int8)
>>> xv.mean(0)
array([ 2.,  3.])

Making changes to the view changes the underlying array

>>> xv[0,1] = 20
>>> print(x)
[(1, 20) (3, 4)]

Using a view to convert an array to a recarray:

>>> z = x.view(np.recarray)
>>> z.a
array([1], dtype=int8)

Views share data:

>>> x[0] = (9, 10)
>>> z[0]
(9, 10)

Views that change the dtype size (bytes per entry) should normally be avoided on arrays defined by slices, transposes, fortran-ordering, etc.:

>>> x = np.array([[1,2,3],[4,5,6]], dtype=np.int16)
>>> y = x[:, 0:2]
>>> y
array([[1, 2],
       [4, 5]], dtype=int16)
>>> y.view(dtype=[('width', np.int16), ('length', np.int16)])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: new type not compatible with array.
>>> z = y.copy()
>>> z.view(dtype=[('width', np.int16), ('length', np.int16)])
array([[(1, 2)],
       [(4, 5)]], dtype=[('width', '<i2'), ('length', '<i2')])

spaces Module

Inheritance diagram of holoviews.core.spaces
class holoviews.core.spaces. Callable ( callable , **params ) [source]

Bases: param.parameterized.Parameterized

Callable allows wrapping callbacks on one or more DynamicMaps allowing their inputs (and in future outputs) to be defined. This makes it possible to wrap DynamicMaps with streams and makes it possible to traverse the graph of operations applied to a DynamicMap.

Additionally, if the memoize attribute is True, a Callable will memoize the last returned value based on the arguments to the function and the state of all streams on its inputs, to avoid calling the function unnecessarily. Note that because memoization includes the streams found on the inputs it may be disabled if the stream requires it and is triggering.

A Callable may also specify a stream_mapping which specifies the objects that are associated with interactive (i.e linked) streams when composite objects such as Layouts are returned from the callback. This is required for building interactive, linked visualizations (for the backends that support them) when returning Layouts, NdLayouts or GridSpace objects. When chaining multiple DynamicMaps into a pipeline, the link_inputs parameter declares whether the visualization generated using this Callable will inherit the linked streams. This parameter is used as a hint by the applicable backend.

The mapping should map from an appropriate key to a list of streams associated with the selected object. The appropriate key may be a type[.group][.label] specification for Layouts, an integer index or a suitable NdLayout/GridSpace key. For more information see the DynamicMap tutorial at holoviews.org.

param Callable callable ( allow_None=True, constant=True, default=None, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The callable function being wrapped.
param List inputs ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The list of inputs the callable function is wrapping. Used to allow deep access to streams in chained Callables.
param Boolean link_inputs ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If the Callable wraps around other DynamicMaps in its inputs, determines whether linked streams attached to the inputs are transferred to the objects returned by the Callable. For example the Callable wraps a DynamicMap with an RangeXY stream, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
param Boolean memoize ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the return value of the callable should be memoized based on the call arguments and any streams attached to the inputs.
param Dict stream_mapping ( allow_None=False, constant=True, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Defines how streams should be mapped to objects returned by the Callable, e.g. when it returns a Layout.
clone ( callable=None , **overrides ) [source]

Clones the Callable optionally with new settings

Args:
callable: New callable function to wrap ** overrides: Parameter overrides to apply
Returns:
Cloned Callable object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Callable'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Callable'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Callable'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Callable'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

noargs

Returns True if the callable takes no arguments

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Callable'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Callable'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.spaces. DynamicMap ( callback , initial_items=None , streams=None , **params ) [source]

Bases: holoviews.core.spaces.HoloMap

A DynamicMap is a type of HoloMap where the elements are dynamically generated by a callable. The callable is invoked with values associated with the key dimensions or with values supplied by stream parameters.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions of a DynamicMap map to the arguments of the callback. This mapping can be by position or by name.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
param ClassSelector callback ( allow_None=True, constant=True, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The callable used to generate the elements. The arguments to the callable includes any number of declared key dimensions as well as any number of stream parameters defined on the input streams. If the callable is an instance of Callable it will be used directly, otherwise it will be automatically wrapped in one.
param List streams ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of Stream instances to associate with the DynamicMap. The set of parameter values across these streams will be supplied as keyword arguments to the callback when the events are received, updating the streams.
param Integer cache_size ( allow_None=False, bounds=None, constant=False, default=500, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The number of entries to cache for fast access. This is an LRU cache where the least recently used item is overwritten once the cache is full.
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides ) [source]

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( dimensions=None , function=None , spreadfn=None , **kwargs )

Concatenates and aggregates along supplied dimensions

Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves.

Args:
dimensions: Dimension(s) to collapse
Defaults to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the collapsed element or HoloMap of collapsed elements
collate ( ) [source]

Unpacks DynamicMap into container of DynamicMaps

Collation allows unpacking DynamicMaps which return Layout, NdLayout or GridSpace objects into a single such object containing DynamicMaps. Assumes that the items in the layout or grid that is returned do not change.

Returns:
Collated container containing DynamicMaps
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
event ( **kwargs ) [source]

Updates attached streams and triggers events

Automatically find streams matching the supplied kwargs to update and trigger events on them.

Args:
** kwargs: Events to update streams with
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
grid ( dimensions=None , **kwargs ) [source]

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by

Returns: grid: GridSpace

GridSpace with supplied dimensions
group

Group inherited from items

groupby ( dimensions=None , container_type=None , group_type=None , **kwargs ) [source]

Groups DynamicMap by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of DynamicMap and adjoined histogram if adjoin=True, otherwise just the histogram
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

layout ( dimensions=None , **kwargs ) [source]

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by

Returns: layout: NdLayout

NdLayout with supplied dimensions
map ( map_fn , specs=None , clone=True , link_inputs=True ) [source]

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object.

Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects returned by the DynamicMap a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})
Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
overlay ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and overlay each group

Groups data by supplied dimension(s) overlaying the groups along the dimension(s).

Args:
dimensions: Dimension(s) of dimensions to group by
Returns:
NdOverlay object(s) with supplied dimensions
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=None , function=None , spread_fn=None , **reduce_map )

Applies reduction to elements along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=[] , force=False ) [source]

Reorders key dimensions on DynamicMap

Create a new object with a reordered set of key dimensions. Dropping dimensions is not allowed on a DynamicMap.

Args:
kdims: List of dimensions to reindex the mapping with force: Not applicable to a DynamicMap
Returns:
Reindexed DynamicMap
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
reset ( ) [source]

Clear the DynamicMap cache

sample ( samples=[] , bounds=None , **sample_values )

Samples element values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
A Table containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs ) [source]

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.DynamicMap'>)
split_overlays ( ) [source]

Deprecated method to split overlays inside the DynamicMap.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

unbounded

Returns a list of key dimensions that are unbounded, excluding stream parameters. If any of theses key dimensions are unbounded, the DynamicMap as a whole is also unbounded.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.spaces. Generator ( callable , **params ) [source]

Bases: holoviews.core.spaces.Callable

Generators are considered a special case of Callable that accept no arguments and never memoize.

param ClassSelector callable ( allow_None=True, constant=True, default=None, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The generator that is wrapped by this Generator.
param List inputs ( allow_None=False, bounds=(0, None), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The list of inputs the callable function is wrapping. Used to allow deep access to streams in chained Callables.
param Boolean link_inputs ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If the Callable wraps around other DynamicMaps in its inputs, determines whether linked streams attached to the inputs are transferred to the objects returned by the Callable. For example the Callable wraps a DynamicMap with an RangeXY stream, this switch determines whether the corresponding visualization should update this stream with range changes originating from the newly generated axes.
param Boolean memoize ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the return value of the callable should be memoized based on the call arguments and any streams attached to the inputs.
param Dict stream_mapping ( allow_None=False, constant=True, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Defines how streams should be mapped to objects returned by the Callable, e.g. when it returns a Layout.
clone ( callable=None , **overrides )

Clones the Callable optionally with new settings

Args:
callable: New callable function to wrap ** overrides: Parameter overrides to apply
Returns:
Cloned Callable object
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Generator'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Generator'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Generator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Generator'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

noargs

Returns True if the callable takes no arguments

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Generator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.Generator'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.spaces. GridMatrix ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.spaces.GridSpace

GridMatrix is container type for heterogeneous Element types laid out in a grid. Unlike a GridSpace the axes of the Grid must not represent an actual coordinate space, but may be used to plot various dimensions against each other. The GridMatrix is usually constructed using the gridmatrix operation, which will generate a GridMatrix plotting each dimension in an Element against each other.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘X’), Dimension(‘Y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( full_grid=False )

Returns the keys of the GridSpace

Args:
full_grid (bool, optional): Return full cross-product of keys
Returns:
List of keys
label

Label inherited from items

last

The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridMatrix'>)
shape

Returns the 2D shape of the GridSpace as (rows, cols).

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.spaces. GridSpace ( initial_items=None , kdims=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping

Grids are distinct from Layouts as they ensure all contained elements to be of the same type. Unlike Layouts, which have integer keys, Grids usually have floating point keys, which correspond to a grid sampling in some two-dimensional space. This two-dimensional space may have to arbitrary dimensions, e.g. for 2D parameter spaces.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(1, 2), constant=False, default=[Dimension(‘X’), Dimension(‘Y’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( full_grid=False ) [source]

Returns the keys of the GridSpace

Args:
full_grid (bool, optional): Return full cross-product of keys
Returns:
List of keys
label

Label inherited from items

last

The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.

last_key

Returns the last key value.

map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs )

Applies simplified option definition returning a new object.

Applies options on an object or nested group of objects in a flat format returning a new object with the options applied. If the options are to be set directly on the object a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})

Identical to the .opts method but returns a clone of the object by default.

Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=0 )

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.GridSpace'>)
shape

Returns the 2D shape of the GridSpace as (rows, cols).

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.spaces. HoloMap ( initial_items=None , kdims=None , group=None , label=None , **params ) [source]

Bases: holoviews.core.ndmapping.UniformNdMapping , holoviews.core.overlay.Overlayable

A HoloMap is an n-dimensional mapping of viewable elements or overlays. Each item in a HoloMap has an tuple key defining the values along each of the declared key dimensions, defining the discretely sampled space of values.

The visual representation of a HoloMap consists of the viewable objects inside the HoloMap which can be explored by varying one or more widgets mapping onto the key dimensions of the HoloMap.

param String group ( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string describing the data wrapped by the object.
param String label ( allow_None=False, basestring=<class ‘str’>, constant=True, default=, instantiate=True, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional label describing the data, typically reflecting where or how it was measured. The label should allow a specific measurement or dataset to be referenced for a given group.
param Dict cdims ( allow_None=False, constant=False, default=OrderedDict(), instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The constant dimensions defined as a dictionary of Dimension:value pairs providing additional dimension information about the object. Aliased with constant_dimensions.
param List kdims ( allow_None=False, bounds=(0, None), constant=True, default=[Dimension(‘Default’)], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The key dimensions defined as list of dimensions that may be used in indexing (and potential slicing) semantics. The order of the dimensions listed here determines the semantics of each component of a multi-dimensional indexing operation. Aliased with key_dimensions.
param List vdims ( allow_None=False, bounds=(0, 0), constant=True, default=[], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The value dimensions defined as the list of dimensions used to describe the components of the data. If multiple value dimensions are supplied, a particular value dimension may be indexed by name after the key dimensions. Aliased with value_dimensions.
param Boolean sort ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the items should be sorted in the constructor.
add_dimension ( dimension , dim_pos , dim_val , vdim=False , **kwargs )

Adds a dimension and its values to the object

Requires the dimension name or object, the desired position in the key dimensions and a key value scalar or sequence of the same length as the existing keys.

Args:
dimension: Dimension or dimension spec to add dim_pos (int) Integer index to insert dimension at dim_val (scalar or ndarray): Dimension value(s) to add vdim: Disabled, this type does not have value dimensions ** kwargs: Keyword arguments passed to the cloned element
Returns:
Cloned object containing the new dimension
clone ( data=None , shared_data=True , new_type=None , link=True , *args , **overrides )

Clones the object, overriding data and parameters.

Args:

data: New data replacing the existing data shared_data (bool, optional): Whether to use existing data new_type (optional): Type to cast object to link (bool, optional): Whether clone should be linked

Determines whether Streams and Links attached to original object will be inherited.

* args: Additional arguments to pass to constructor ** overrides: New keyword arguments to pass to constructor

Returns:
Cloned object
collapse ( dimensions=None , function=None , spreadfn=None , **kwargs ) [source]

Concatenates and aggregates along supplied dimensions

Useful to collapse stacks of objects into a single object, e.g. to average a stack of Images or Curves.

Args:
dimensions: Dimension(s) to collapse
Defaults to all key dimensions

function: Aggregation function to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.

** kwargs: Keyword arguments passed to the aggregation function

Returns:
Returns the collapsed element or HoloMap of collapsed elements
collate ( merge_type=None , drop=[] , drop_constant=False ) [source]

Collate allows reordering nested containers

Collation allows collapsing nested mapping types by merging their dimensions. In simple terms in merges nested containers into a single merged type.

In the simple case a HoloMap containing other HoloMaps can easily be joined in this way. However collation is particularly useful when the objects being joined are deeply nested, e.g. you want to join multiple Layouts recorded at different times, collation will return one Layout containing HoloMaps indexed by Time. Changing the merge_type will allow merging the outer Dimension into any other UniformNdMapping type.

Args:
merge_type: Type of the object to merge with drop: List of dimensions to drop drop_constant: Drop constant dimensions automatically
Returns:
Collated Layout or HoloMap
ddims

The list of deep dimensions

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

dframe ( dimensions=None , multi_index=False )

Convert dimension values to DataFrame.

Returns a pandas dataframe of columns along each dimension, either completely flat or indexed by key dimensions.

Args:
dimensions: Dimensions to return as columns multi_index: Convert key dimensions to (multi-)index
Returns:
DataFrame of columns corresponding to each dimension
dimension_values ( dimension , expanded=True , flat=True )

Return the values along the requested dimension.

Args:

dimension: The dimension to return values for expanded (bool, optional): Whether to expand values

Whether to return the expanded values, behavior depends on the type of data:

  • Columnar: If false returns unique values
  • Geometry: If false returns scalar values per geometry
  • Gridded: If false returns 1D coordinates

flat (bool, optional): Whether to flatten array

Returns:
NumPy array of values along the requested dimension
dimensions ( selection='all' , label=False )

Lists the available dimensions on the object

Provides convenient access to Dimensions on nested Dimensioned objects. Dimensions can be selected by their type, i.e. ‘key’ or ‘value’ dimensions. By default ‘all’ dimensions are returned.

Args:
selection: Type of dimensions to return
The type of dimension, i.e. one of ‘key’, ‘value’, ‘constant’ or ‘all’.
label: Whether to return the name, label or Dimension
Whether to return the Dimension objects (False), the Dimension names (True/’name’) or labels (‘label’).
Returns:
List of Dimension objects or their names or labels
drop_dimension ( dimensions )

Drops dimension(s) from keys

Args:
dimensions: Dimension(s) to drop
Returns:
Clone of object with with dropped dimension(s)
force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
get ( key , default=None )

Standard get semantics for all mapping types

get_dimension ( dimension , default=None , strict=False )

Get a Dimension object by name or index.

Args:
dimension: Dimension to look up by name or integer index default (optional): Value returned if Dimension not found strict (bool, optional): Raise a KeyError if not found
Returns:
Dimension object for the requested dimension or default
get_dimension_index ( dimension )

Get the index of the requested dimension.

Args:
dimension: Dimension to look up by name or by index
Returns:
Integer index of the requested dimension
get_dimension_type ( dim )

Get the type of the requested dimension.

Type is determined by Dimension.type attribute or common type of the dimension values, otherwise None.

Args:
dimension: Dimension to look up by name or by index
Returns:
Declared type of values along the dimension
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
grid ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and lay out groups in grid

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a GridSpace.

Args: dimensions: Dimension/str or list

Dimension or list of dimensions to group by
Returns:
GridSpace with supplied dimensions
group

Group inherited from items

groupby ( dimensions , container_type=None , group_type=None , **kwargs )

Groups object by one or more dimensions

Applies groupby operation over the specified dimensions returning an object of type container_type (expected to be dictionary-like) containing the groups.

Args:
dimensions: Dimension(s) to group by container_type: Type to cast group container to group_type: Type to cast each group to dynamic: Whether to return a DynamicMap ** kwargs: Keyword arguments to pass to each group
Returns:
Returns object of supplied container_type containing the groups. If dynamic=True returns a DynamicMap instead.
hist ( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source]

Computes and adjoins histogram along specified dimension(s).

Defaults to first value dimension if present otherwise falls back to first key dimension.

Args:
dimension: Dimension(s) to compute histogram on num_bins (int, optional): Number of bins bin_range (tuple optional): Lower and upper bounds of bins adjoin (bool, optional): Whether to adjoin histogram
Returns:
AdjointLayout of HoloMap and histograms or just the histograms
info

Prints information about the Dimensioned object, including the number and type of objects contained within it and information about its dimensions.

inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
items ( )

Returns all elements as a list in (key,value) format.

keys ( )

Returns the keys of all the elements.

label

Label inherited from items

last

Returns the item highest data item along the map dimensions.

last_key

Returns the last key value.

layout ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and lay out groups

Groups data by supplied dimension(s) laying the groups along the dimension(s) out in a NdLayout.

Args:
dimensions: Dimension(s) to group by
Returns:
NdLayout with supplied dimensions
map ( map_fn , specs=None , clone=True )

Map a function to all objects matching the specs

Recursively replaces elements using a map function when the specs apply, by default applies to all objects, e.g. to apply the function to all contained Curve objects:

dmap.map(fn, hv.Curve)
Args:

map_fn: Function to apply to each object specs: List of specs to match

List of types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.

clone: Whether to clone the object or transform inplace

Returns:
Returns the object after the map_fn has been applied
matches ( spec )

Whether the spec applies to this object.

Args:
spec: A function, spec or type to check for a match
  • A ‘type[[.group].label]’ string which is compared against the type, group and label of this object
  • A function which is given the object and returns a boolean.
  • An object type matched using isinstance.
Returns:
bool: Whether the spec matched this object.
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

options ( *args , **kwargs ) [source]

Applies simplified option definition returning a new object

Applies options defined in a flat format to the objects returned by the DynamicMap. If the options are to be set directly on the objects in the HoloMap a simple format may be used, e.g.:

obj.options(cmap=’viridis’, show_title=False)

If the object is nested the options must be qualified using a type[.group][.label] specification, e.g.:

obj.options(‘Image’, cmap=’viridis’, show_title=False)

or using:

obj.options({‘Image’: dict(cmap=’viridis’, show_title=False)})
Args:
* args: Sets of options to apply to object
Supports a number of formats including lists of Options objects, a type[.group][.label] followed by a set of keyword options to apply and a dictionary indexed by type[.group][.label] specs.
backend (optional): Backend to apply options to
Defaults to current selected backend
clone (bool, optional): Whether to clone object
Options can be applied inplace with clone=False
** kwargs: Keywords of options
Set of options to apply to the object
Returns:
Returns the cloned object with the options applied
overlay ( dimensions=None , **kwargs ) [source]

Group by supplied dimension(s) and overlay each group

Groups data by supplied dimension(s) overlaying the groups along the dimension(s).

Args:
dimensions: Dimension(s) of dimensions to group by
Returns:
NdOverlay object(s) with supplied dimensions
params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pop ( key , default=None )

Standard pop semantics for all mapping types

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

range ( dimension , data_range=True , dimension_range=True )

Return the lower and upper bounds of values along dimension.

Args:

dimension: The dimension to compute the range on. data_range (bool): Compute range from data values dimension_range (bool): Include Dimension ranges

Whether to include Dimension range and soft_range in range calculation
Returns:
Tuple containing the lower and upper bound
reduce ( dimensions=None , function=None , spread_fn=None , **reduce_map ) [source]

Applies reduction to elements along the specified dimension(s).

Allows reducing the values along one or more key dimension with the supplied function. Supports two signatures:

Reducing with a list of dimensions, e.g.:

ds.reduce([‘x’], np.mean)

Defining a reduction using keywords, e.g.:

ds.reduce(x=np.mean)
Args:
dimensions: Dimension(s) to apply reduction on
Defaults to all key dimensions

function: Reduction operation to apply, e.g. numpy.mean spreadfn: Secondary reduction to compute value spread

Useful for computing a confidence interval, spread, or standard deviation.
** reductions: Keyword argument defining reduction
Allows reduction to be defined as keyword pair of dimension and function
Returns:
The Dataset after reductions have been applied.
reindex ( kdims=[] , force=False )

Reindexes object dropping static or supplied kdims

Creates a new object with a reordered or reduced set of key dimensions. By default drops all non-varying key dimensions.

Reducing the number of key dimensions will discard information from the keys. All data values are accessible in the newly created object as the new labels must be sufficient to address each value uniquely.

Args:
kdims (optional): New list of key dimensions after reindexing force (bool, optional): Whether to drop non-unique items
Returns:
Reindexed object
relabel ( label=None , group=None , depth=1 ) [source]

Clone object and apply new group and/or label.

Applies relabeling to children up to the supplied depth.

Args:

label (str, optional): New label to apply to returned object group (str, optional): New group to apply to returned object depth (int, optional): Depth to which relabel will be applied

If applied to container allows applying relabeling to contained objects up to the specified depth
Returns:
Returns relabelled object
sample ( samples=[] , bounds=None , **sample_values ) [source]

Samples element values at supplied coordinates.

Allows sampling of element with a list of coordinates matching the key dimensions, returning a new object containing just the selected samples. Supports multiple signatures:

Sampling with a list of coordinates, e.g.:

ds.sample([(0, 0), (0.1, 0.2), …])

Sampling a range or grid of coordinates, e.g.:

1D: ds.sample(3) 2D: ds.sample((3, 3))

Sampling by keyword, e.g.:

ds.sample(x=0)
Args:

samples: List of nd-coordinates to sample bounds: Bounds of the region to sample

Defined as two-tuple for 1D sampling and four-tuple for 2D sampling.

closest: Whether to snap to closest coordinates ** kwargs: Coordinates specified as keyword pairs

Keywords of dimensions and scalar coordinates
Returns:
A Table containing the sampled coordinates
script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

select ( selection_specs=None , **kwargs )

Applies selection by dimension name

Applies a selection along the dimensions of the object using keyword arguments. The selection may be narrowed to certain objects using selection_specs. For container objects the selection will be applied to all children as well.

Selections may select a specific value, slice or set of values:

  • value: Scalar values will select rows along with an exact

    match, e.g.:

    ds.select(x=3)

  • slice: Slices may be declared as tuples of the upper and

    lower bound, e.g.:

    ds.select(x=(0, 3))

  • values: A list of values may be selected using a list or

    set, e.g.:

    ds.select(x=[0, 1, 2])

Args:
selection_specs: List of specs to match on
A list of types, functions, or type[.group][.label] strings specifying which objects to apply the selection on.
** selection: Dictionary declaring selections by dimension
Selections can be scalar values, tuple ranges, lists of discrete values and boolean arrays
Returns:
Returns an Dimensioned object containing the selected data or a scalar if a single value was selected
set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.spaces.HoloMap'>)
split_overlays ( ) [source]

Deprecated method to split overlays inside the HoloMap.

state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

table ( datatype=None , **kwargs )

Deprecated method to convert an MultiDimensionalMapping of Elements to a Table.

traverse ( fn=None , specs=None , full_breadth=True )

Traverses object returning matching items

Traverses the set of children of the object, collecting the all objects matching the defined specs. Each object can be processed with the supplied function.

Args:

fn (function, optional): Function applied to matched objects specs: List of specs to match

Specs must be types, functions or type[.group][.label] specs to select objects to return, by default applies to all objects.
full_breadth: Whether to traverse all objects
Whether to traverse the full set of objects on each container or only the first.
Returns:
list: List of objects that matched
type

The type of elements stored in the mapping.

update ( other )

Merges other item with this object

Args:
other: Object containing items to merge into this object
Must be a dictionary or NdMapping type
values ( )

Returns the values of all the elements.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core.spaces. dynamicmap_memoization ( callable_obj , streams ) [source]

Determine whether the Callable should have memoization enabled based on the supplied streams (typically by a DynamicMap). Memoization is disabled if any of the streams require it it and are currently in a triggered state.

holoviews.core.spaces. get_nested_dmaps ( dmap ) [source]

Recurses DynamicMap to find DynamicMaps inputs

Args:
dmap: DynamicMap to recurse to look for DynamicMap inputs
Returns:
List of DynamicMap instances that were found
holoviews.core.spaces. get_nested_streams ( dmap ) [source]

Recurses supplied DynamicMap to find all streams

Args:
dmap: DynamicMap to recurse to look for streams
Returns:
List of streams that were found
class holoviews.core.spaces. periodic ( dmap ) [source]

Bases: object

Implements the utility of the same name on DynamicMap.

Used to defined periodic event updates that can be started and stopped.

stop ( ) [source]

Stop the periodic process.


traversal Module

Advanced utilities for traversing nesting/hierarchical Dimensioned objects either to inspect the structure of their declared dimensions or mutate the matching elements.

holoviews.core.traversal. hierarchical ( keys ) [source]

Iterates over dimension values in keys, taking two sets of dimension values at a time to determine whether two consecutive dimensions have a one-to-many relationship. If they do a mapping between the first and second dimension values is returned. Returns a list of n-1 mappings, between consecutive dimensions.

holoviews.core.traversal. uniform ( obj ) [source]

Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned.

holoviews.core.traversal. unique_dimkeys ( obj , default_dim='Frame' ) [source]

Finds all common dimension keys in the object including subsets of dimensions. If there are is no common subset of dimensions, None is returned.

Returns the list of dimensions followed by the list of unique keys.


tree Module

Inheritance diagram of holoviews.core.tree
class holoviews.core.tree. AttrTree ( items=None , identifier=None , parent=None , dir_mode='default' ) [source]

Bases: object

An AttrTree offers convenient, multi-level attribute access for collections of objects. AttrTree objects may also be combined together using the update method or merge classmethod. Here is an example of adding a ViewableElement to an AttrTree and accessing it:

>>> t = AttrTree()
>>> t.Example.Path = 1
>>> t.Example.Path                             
1
filter ( path_filters ) [source]

Filters the loaded AttrTree using the supplied path_filters.

fixed

If fixed, no new paths can be created via attribute access

get ( identifier , default=None ) [source]

Get a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The indexed node of the AttrTree
items ( ) [source]

Keys and nodes of the AttrTree

keys ( ) [source]

Keys of nodes in the AttrTree

classmethod merge ( trees ) [source]

Merge a collection of AttrTree objects.

path

Returns the path up to the root for the current node.

pop ( identifier , default=None ) [source]

Pop a node of the AttrTree using its path string.

Args:
identifier: Path string of the node to return default: Value to return if no node is found
Returns:
The node that was removed from the AttrTree
set_path ( path , val ) [source]

Set the given value at the supplied path where path is either a tuple of strings or a string in A.B.C format.

update ( other ) [source]

Updated the contents of the current AttrTree with the contents of a second AttrTree.

values ( ) [source]

Nodes of the AttrTree


util Module

Inheritance diagram of holoviews.core.util
class holoviews.core.util. Aliases ( **kwargs ) [source]

Bases: object

Helper class useful for defining a set of alias tuples on a single object.

For instance, when defining a group or label with an alias, instead of setting tuples in the constructor, you could use aliases.water if you first define:

>>> aliases = Aliases(water='H_2O', glucose='C_6H_{12}O_6')
>>> aliases.water
('water', 'H_2O')

This may be used to conveniently define aliases for groups, labels or dimension names.

class holoviews.core.util. Config ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

Set of boolean configuration values to change HoloViews’ global behavior. Typically used to control warnings relating to deprecations or set global parameter such as style ‘themes’.

param Boolean future_deprecations ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to warn about future deprecations
param Boolean style_17 ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Switch to the default style options used up to (and including) the HoloViews 1.7 release.
param Boolean warn_options_call ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to warn when the deprecated __call__ options syntax is used (the opts method should now be used instead). It is recommended that users switch this on to update any uses of __call__ as it will be deprecated in future.
param Number image_rtol ( allow_None=False, bounds=None, constant=False, default=0.001, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The tolerance used to enforce regular sampling for regular, gridded data where regular sampling is expected. Expressed as the maximal allowable sampling difference between sample locations.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.Config'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.Config'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.Config'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.Config'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.util.Config'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.Config'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.Config'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.core.util. HashableJSON ( * , skipkeys=False , ensure_ascii=True , check_circular=True , allow_nan=True , sort_keys=False , indent=None , separators=None , default=None ) [source]

Bases: json.encoder.JSONEncoder

Extends JSONEncoder to generate a hashable string for as many types of object as possible including nested objects and objects that are not normally hashable. The purpose of this class is to generate unique strings that once hashed are suitable for use in memoization and other cases where deep equality must be tested without storing the entire object.

By default JSONEncoder supports booleans, numbers, strings, lists, tuples and dictionaries. In order to support other types such as sets, datetime objects and mutable objects such as pandas Dataframes or numpy arrays, HashableJSON has to convert these types to datastructures that can normally be represented as JSON.

Support for other object types may need to be introduced in future. By default, unrecognized object types are represented by their id.

One limitation of this approach is that dictionaries with composite keys (e.g tuples) are not supported due to the JSON spec.

encode ( o )

Return a JSON string representation of a Python data structure.

>>> from json.encoder import JSONEncoder
>>> JSONEncoder().encode({"foo": ["bar", "baz"]})
'{"foo": ["bar", "baz"]}'
iterencode ( o , _one_shot=False )

Encode the given object and yield each string representation as available.

For example:

for chunk in JSONEncoder().iterencode(bigobject):
    mysocket.write(chunk)
class holoviews.core.util. ProgressIndicator ( **params ) [source]

Bases: param.parameterized.Parameterized

Baseclass for any ProgressIndicator that indicates progress as a completion percentage.

param NumericTuple percent_range ( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
param String label ( allow_None=True, basestring=<class ‘str’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The label of the current progress bar.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ProgressIndicator'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ProgressIndicator'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ProgressIndicator'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ProgressIndicator'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' )

(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ProgressIndicator'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ProgressIndicator'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

exception holoviews.core.util. VersionError ( msg , version=None , min_version=None , **kwargs ) [source]

Bases: Exception

Raised when there is a library version mismatch.

with_traceback ( )

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

holoviews.core.util. arglexsort ( arrays ) [source]

Returns the indices of the lexicographical sorting order of the supplied arrays.

holoviews.core.util. argspec ( callable_obj ) [source]

Returns an ArgSpec object for functions, staticmethods, instance methods, classmethods and partials.

Note that the args list for instance and class methods are those as seen by the user. In other words, the first argument which is conventionally called ‘self’ or ‘cls’ is omitted in these cases.

holoviews.core.util. asarray ( arraylike , strict=True ) [source]

Converts arraylike objects to NumPy ndarray types. Errors if object is not arraylike and strict option is enabled.

holoviews.core.util. bound_range ( vals , density , time_unit='us' ) [source]

Computes a bounding range and density from a number of samples assumed to be evenly spaced. Density is rounded to machine precision using significant digits reported by sys.float_info.dig.

holoviews.core.util. bytes_to_unicode ( value ) [source]

Safely casts bytestring to unicode

holoviews.core.util. callable_name ( callable_obj ) [source]

Attempt to return a meaningful name identifying a callable or generator

holoviews.core.util. capitalize ( string ) [source]

Capitalizes the first letter of a string.

holoviews.core.util. capitalize_unicode_name ( s ) [source]

Turns a string such as ‘capital delta’ into the shortened, capitalized version, in this case simply ‘Delta’. Used as a transform in sanitize_identifier.

holoviews.core.util. cartesian_product ( arrays , flat=True , copy=False ) [source]

Efficient cartesian product of a list of 1D arrays returning the expanded array views for each dimensions. By default arrays are flattened, which may be controlled with the flat flag. The array views can be turned into regular arrays with the copy flag.

holoviews.core.util. cftime_to_timestamp ( date , time_unit='us' ) [source]

Converts cftime to timestamp since epoch in milliseconds

Non-standard calendars (e.g. Julian or no leap calendars) are converted to standard Gregorian calendar. This can cause extra space to be added for dates that don’t exist in the original calendar. In order to handle these dates correctly a custom bokeh model with support for other calendars would have to be defined.

Args:
date: cftime datetime object (or array)
Returns:
Milliseconds since 1970-01-01 00:00:00
holoviews.core.util. closest_match ( match , specs , depth=0 ) [source]

Recursively iterates over type, group, label and overlay key, finding the closest matching spec.

holoviews.core.util. compute_density ( start , end , length , time_unit='us' ) [source]

Computes a grid density given the edges and number of samples. Handles datetime grids correctly by computing timedeltas and computing a density for the given time_unit.

holoviews.core.util. compute_edges ( edges ) [source]

Computes edges as midpoints of the bin centers. The first and last boundaries are equidistant from the first and last midpoints respectively.

holoviews.core.util. cross_index ( values , index ) [source]

Allows efficiently indexing into a cartesian product without expanding it. The values should be defined as a list of iterables making up the cartesian product and a linear index, returning the cross product of the values at the supplied index.

holoviews.core.util. date_range ( start , end , length , time_unit='us' ) [source]

Computes a date range given a start date, end date and the number of samples.

holoviews.core.util. deephash ( obj ) [source]

Given an object, return a hash using HashableJSON. This hash is not architecture, Python version or platform independent.

holoviews.core.util. deprecated_opts_signature ( args , kwargs ) [source]

Utility to help with the deprecation of the old .opts method signature

Returns whether opts.apply_groups should be used (as a bool) and the corresponding options.

holoviews.core.util. dimension_range ( lower , upper , hard_range , soft_range , padding=None , log=False ) [source]

Computes the range along a dimension by combining the data range with the Dimension soft_range and range.

holoviews.core.util. dimension_sort ( odict , kdims , vdims , key_index ) [source]

Sorts data by key using usual Python tuple sorting semantics or sorts in categorical order for any categorical Dimensions.

holoviews.core.util. dimensioned_streams ( dmap ) [source]

Given a DynamicMap return all streams that have any dimensioned parameters i.e parameters also listed in the key dimensions.

holoviews.core.util. dimensionless_contents ( streams , kdims , no_duplicates=True ) [source]

Return a list of stream parameters that have not been associated with any of the key dimensions.

holoviews.core.util. disable_constant ( parameterized ) [source]

Temporarily set parameters on Parameterized object to constant=False.

holoviews.core.util. drop_streams ( streams , kdims , keys ) [source]

Drop any dimensioned streams from the keys and kdims.

holoviews.core.util. dt64_to_dt ( dt64 ) [source]

Safely converts NumPy datetime64 to a datetime object.

holoviews.core.util. dt_to_int ( value , time_unit='us' ) [source]

Converts a datetime type to an integer with the supplied time unit.

holoviews.core.util. expand_grid_coords ( dataset , dim ) [source]

Expand the coordinates along a dimension of the gridded dataset into an ND-array matching the dimensionality of the dataset.

holoviews.core.util. find_file ( folder , filename ) [source]

Find a file given folder and filename. If the filename can be resolved directly returns otherwise walks the supplied folder.

holoviews.core.util. find_minmax ( lims , olims ) [source]

Takes (a1, a2) and (b1, b2) as input and returns (np.nanmin(a1, b1), np.nanmax(a2, b2)). Used to calculate min and max values of a number of items.

holoviews.core.util. find_range ( values , soft_range=[] ) [source]

Safely finds either the numerical min and max of a set of values, falling back to the first and the last value in the sorted list of values.

holoviews.core.util. get_method_owner ( method ) [source]

Gets the instance that owns the supplied method

holoviews.core.util. get_ndmapping_label ( ndmapping , attr ) [source]

Function to get the first non-auxiliary object label attribute from an NdMapping.

holoviews.core.util. get_overlay_spec ( o , k , v ) [source]

Gets the type.group.label + key spec from an Element in an Overlay.

holoviews.core.util. get_path ( item ) [source]

Gets a path from an Labelled object or from a tuple of an existing path and a labelled object. The path strings are sanitized and capitalized.

holoviews.core.util. get_spec ( obj ) [source]

Gets the spec from any labeled data object.

holoviews.core.util. group_select ( selects , length=None , depth=None ) [source]

Given a list of key tuples to select, groups them into sensible chunks to avoid duplicating indexing operations.

holoviews.core.util. int_to_alpha ( n , upper=True ) [source]

Generates alphanumeric labels of form A-Z, AA-ZZ etc.

holoviews.core.util. is_cyclic ( graph ) [source]

Return True if the directed graph g has a cycle. The directed graph should be represented as a dictionary mapping of edges for each node.

holoviews.core.util. is_dataframe ( data ) [source]

Checks whether the supplied data is of DataFrame type.

holoviews.core.util. is_nan ( x ) [source]

Checks whether value is NaN on arbitrary types

holoviews.core.util. is_param_method ( obj ) [source]

Whether the object is a method on a parameterized object.

holoviews.core.util. is_series ( data ) [source]

Checks whether the supplied data is of Series type.

holoviews.core.util. isfinite ( val ) [source]

Helper function to determine if scalar or array value is finite extending np.isfinite with support for None, string, datetime types.

holoviews.core.util. isnat ( val ) [source]

Checks if the value is a NaT. Should only be called on datetimelike objects.

holoviews.core.util. isscalar ( val ) [source]

Value is scalar or None

holoviews.core.util. iterative_select ( obj , dimensions , selects , depth=None ) [source]

Takes the output of group_select selecting subgroups iteratively, avoiding duplicating select operations.

holoviews.core.util. iterkeys ( obj ) [source]

Get key iterator from dictionary for Python 2 and 3

holoviews.core.util. itervalues ( obj ) [source]

Get value iterator from dictionary for Python 2 and 3

holoviews.core.util. layer_groups ( ordering , length=2 ) [source]

Splits a global ordering of Layers into groups based on a slice of the spec. The grouping behavior can be modified by changing the length of spec the entries are grouped by.

holoviews.core.util. layer_sort ( hmap ) [source]

Find a global ordering for layers in a HoloMap of CompositeOverlay types.

holoviews.core.util. make_path_unique ( path , counts , new ) [source]

Given a path, a list of existing paths and counts for each of the existing paths.

holoviews.core.util. match_spec ( element , specification ) [source]

Matches the group.label specification of the supplied element against the supplied specification dictionary returning the value of the best match.

holoviews.core.util. max_extents ( extents , zrange=False ) [source]

Computes the maximal extent in 2D and 3D space from list of 4-tuples or 6-tuples. If zrange is enabled all extents are converted to 6-tuples to compute x-, y- and z-limits.

holoviews.core.util. max_range ( ranges , combined=True ) [source]

Computes the maximal lower and upper bounds from a list bounds.

holoviews.core.util. merge_dimensions ( dimensions_list ) [source]

Merges lists of fully or partially overlapping dimensions by merging their values.

>>> from holoviews import Dimension
>>> dim_list = [[Dimension('A', values=[1, 2, 3]), Dimension('B')],
...             [Dimension('A', values=[2, 3, 4])]]
>>> dimensions = merge_dimensions(dim_list)
>>> dimensions
[Dimension('A'), Dimension('B')]
>>> dimensions[0].values
[1, 2, 3, 4]
holoviews.core.util. merge_option_dicts ( old_opts , new_opts ) [source]

Update the old_opts option dictionary with the options defined in new_opts. Instead of a shallow update as would be performed by calling old_opts.update(new_opts), this updates the dictionaries of all option types separately.

Given two dictionaries
old_opts = {‘a’: {‘x’: ‘old’, ‘y’: ‘old’}}
and
new_opts = {‘a’: {‘y’: ‘new’, ‘z’: ‘new’}, ‘b’: {‘k’: ‘new’}}
this returns a dictionary
{‘a’: {‘x’: ‘old’, ‘y’: ‘new’, ‘z’: ‘new’}, ‘b’: {‘k’: ‘new’}}
holoviews.core.util. merge_options_to_dict ( options ) [source]

Given a collection of Option objects or partial option dictionaries, merge everything to a single dictionary.

holoviews.core.util. mimebundle_to_html ( bundle ) [source]

Converts a MIME bundle into HTML.

class holoviews.core.util. ndmapping_groupby ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

Apply a groupby operation to an NdMapping, using pandas to improve performance (if available).

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ndmapping_groupby'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ndmapping_groupby'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ndmapping_groupby'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ndmapping_groupby'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.util.ndmapping_groupby'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ndmapping_groupby'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.ndmapping_groupby'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core.util. numpy_scalar_to_python ( scalar ) [source]

Converts a NumPy scalar to a regular python type.

holoviews.core.util. one_to_one ( graph , nodes ) [source]

Return True if graph contains only one to one mappings. The directed graph should be represented as a dictionary mapping of edges for each node. Nodes should be passed a simple list.

class holoviews.core.util. periodic ( period , count , callback , timeout=None , block=False ) [source]

Bases: threading.Thread

Run a callback count times with a given period without blocking.

If count is None, will run till timeout (which may be forever if None).

daemon

A boolean value indicating whether this thread is a daemon thread.

This must be set before start() is called, otherwise RuntimeError is raised. Its initial value is inherited from the creating thread; the main thread is not a daemon thread and therefore all threads created in the main thread default to daemon = False.

The entire Python program exits when no alive non-daemon threads are left.

ident

Thread identifier of this thread or None if it has not been started.

This is a nonzero integer. See the get_ident() function. Thread identifiers may be recycled when a thread exits and another thread is created. The identifier is available even after the thread has exited.

isAlive ( )

Return whether the thread is alive.

This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.

is_alive ( )

Return whether the thread is alive.

This method returns True just before the run() method starts until just after the run() method terminates. The module function enumerate() returns a list of all alive threads.

join ( timeout=None )

Wait until the thread terminates.

This blocks the calling thread until the thread whose join() method is called terminates – either normally or through an unhandled exception or until the optional timeout occurs.

When the timeout argument is present and not None, it should be a floating point number specifying a timeout for the operation in seconds (or fractions thereof). As join() always returns None, you must call isAlive() after join() to decide whether a timeout happened – if the thread is still alive, the join() call timed out.

When the timeout argument is not present or None, the operation will block until the thread terminates.

A thread can be join()ed many times.

join() raises a RuntimeError if an attempt is made to join the current thread as that would cause a deadlock. It is also an error to join() a thread before it has been started and attempts to do so raises the same exception.

name

A string used for identification purposes only.

It has no semantics. Multiple threads may be given the same name. The initial name is set by the constructor.

holoviews.core.util. process_ellipses ( obj , key , vdim_selection=False ) [source]

Helper function to pad a __getitem__ key with the right number of empty slices (i.e :) when the key contains an Ellipsis (…).

If the vdim_selection flag is true, check if the end of the key contains strings or Dimension objects in obj. If so, extra padding will not be applied for the value dimensions (i.e the resulting key will be exactly one longer than the number of kdims). Note: this flag should not be used for composite types.

holoviews.core.util. range_pad ( lower , upper , padding=None , log=False ) [source]

Pads the range by a fraction of the interval

holoviews.core.util. rename_stream_kwargs ( stream , kwargs , reverse=False ) [source]

Given a stream and a kwargs dictionary of parameter values, map to the corresponding dictionary where the keys are substituted with the appropriately renamed string.

If reverse, the output will be a dictionary using the original parameter names given a dictionary using the renamed equivalents.

class holoviews.core.util. sanitize_identifier_fn ( **params ) [source]

Bases: param.parameterized.ParameterizedFunction

Sanitizes group/label values for use in AttrTree attribute access. Depending on the version parameter, either sanitization appropriate for Python 2 (no unicode gn identifiers allowed) or Python 3 (some unicode allowed) is used.

Note that if you are using Python 3, you can switch to version 2 for compatibility but you cannot enable relaxed sanitization if you are using Python 2.

Special characters are sanitized using their (lowercase) unicode name using the unicodedata module. For instance:

>>> unicodedata.name(u'$').lower()
'dollar sign'

As these names are often very long, this parameterized function allows filtered, substitutions and transforms to help shorten these names appropriately.

param ObjectSelector version ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=3, instantiate=False, names=None, objects=[2, 3], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The sanitization version. If set to 2, more aggressive sanitization appropriate for Python 2 is applied. Otherwise, if set to 3, more relaxed, Python 3 sanitization is used.
param Boolean capitalize ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the first letter should be converted to uppercase. Note, this will only be applied to ASCII characters in order to make sure paths aren’t confused with method names.
param List eliminations ( allow_None=False, bounds=(0, None), constant=False, default=[‘extended’, ‘accent’, ‘small’, ‘letter’, ‘sign’, ‘digit’, ‘latin’, ‘greek’, ‘arabic-indic’, ‘with’, ‘dollar’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Lowercase strings to be eliminated from the unicode names in order to shorten the sanitized name ( lowercase). Redundant strings should be removed but too much elimination could cause two unique strings to map to the same sanitized output.
param Dict substitutions ( allow_None=False, constant=False, default={‘circumflex’: ‘power’, ‘asterisk’: ‘times’, ‘solidus’: ‘over’}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Lowercase substitutions of substrings in unicode names. For instance the ^ character has the name ‘circumflex accent’ even though it is more typically used for exponentiation. Note that substitutions occur after filtering and that there should be no ordering dependence between substitutions.
param List transforms ( allow_None=False, bounds=(0, None), constant=False, default=[<function capitalize_unicode_name at 0x118cfc6a8>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
List of string transformation functions to apply after filtering and substitution in order to further compress the unicode name. For instance, the default capitalize_unicode_name function will turn the string “capital delta” into “Delta”.
param List disallowed ( allow_None=False, bounds=(0, None), constant=False, default=[‘trait_names’, ‘_ipython_display_’, ‘_getAttributeNames’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
An explicit list of name that should not be allowed as attribute names on Tree objects. By default, prevents IPython from creating an entry called Trait_names due to an inconvenient getattr check (during tab-completion).
param Boolean disable_leading_underscore ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether leading underscores should be allowed to be sanitized with the leading prefix.
param Dict aliases ( allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A dictionary of aliases mapping long strings to their short, sanitized equivalents
param Dict _lookup_table ( allow_None=False, constant=False, default={}, instantiate=True, is_instance=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Cache of previously computed sanitizations
add_aliases = functools.partial(<function sanitize_identifier_fn.add_aliases>, <class 'holoviews.core.util.sanitize_identifier_fn'>) [source]
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

pprint ( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' )

Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y

prefixed = functools.partial(<function sanitize_identifier_fn.prefixed>, <class 'holoviews.core.util.sanitize_identifier_fn'>) [source]
print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

remove_aliases = functools.partial(<function sanitize_identifier_fn.remove_aliases>, <class 'holoviews.core.util.sanitize_identifier_fn'>) [source]
remove_diacritics = functools.partial(<function sanitize_identifier_fn.remove_diacritics>, <class 'holoviews.core.util.sanitize_identifier_fn'>) [source]
sanitize ( name , valid_fn ) [source]

Accumulate blocks of hex and separate blocks by underscores

script_repr ( imports=[] , prefix=' ' )

Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.core.util.sanitize_identifier_fn'>)
shortened_character_name = functools.partial(<function sanitize_identifier_fn.shortened_character_name>, <class 'holoviews.core.util.sanitize_identifier_fn'>) [source]
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

For Parameterized instances, this includes the state of dynamically generated values.

Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().

Generally, this method is used by operations that need to test something without permanently altering the objects’ state.

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.core.util. search_indices ( values , source ) [source]

Given a set of values returns the indices of each of those values in the source array.

holoviews.core.util. sort_topologically ( graph ) [source]

Stackless topological sorting.

graph = {
3: [1], 5: [3], 4: [2], 6: [4],

}

sort_topologically(graph) [[1, 2], [3, 4], [5, 6]]

holoviews.core.util. stream_name_mapping ( stream, exclude_params=['name'], reverse=False ) [source]

Return a complete dictionary mapping between stream parameter names to their applicable renames, excluding parameters listed in exclude_params.

If reverse is True, the mapping is from the renamed strings to the original stream parameter names.

holoviews.core.util. stream_parameters ( streams, no_duplicates=True, exclude=['name'] ) [source]

Given a list of streams, return a flat list of parameter name, excluding those listed in the exclude list.

If no_duplicates is enabled, a KeyError will be raised if there are parameter name clashes across the streams.

holoviews.core.util. unbound_dimensions ( streams , kdims , no_duplicates=True ) [source]

Return a list of dimensions that have not been associated with any streams.

holoviews.core.util. unique_array ( arr ) [source]

Returns an array of unique values in the input order

holoviews.core.util. unique_iterator ( seq ) [source]

Returns an iterator containing all non-duplicate elements in the input sequence.

holoviews.core.util. validate_dynamic_argspec ( callback , kdims , streams ) [source]

Utility used by DynamicMap to ensure the supplied callback has an appropriate signature.

If validation succeeds, returns a list of strings to be zipped with the positional arguments i.e kdim values. The zipped values can then be merged with the stream values to pass everything to the Callable as keywords.

If the callbacks use * args, None is returned to indicate that kdim values must be passed to the Callable by position. In this situation, Callable passes * args and ** kwargs directly to the callback.

If the callback doesn’t use ** kwargs, the accepted keywords are validated against the stream parameter names.

holoviews.core.util. validate_regular_sampling ( values , rtol=1e-05 ) [source]

Validates regular sampling of a 1D array ensuring that the difference in sampling steps is at most rtol times the smallest sampling step. Returns a boolean indicating whether the sampling is regular.

holoviews.core.util. wrap_tuple ( unwrapped ) [source]

Wraps any non-tuple types in a tuple

holoviews.core.util. wrap_tuple_streams ( unwrapped , kdims , streams ) [source]

Fills in tuple keys with dimensioned stream values as appropriate.