holoviews.core Package ¶
core
Package
¶
-
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
-
fixed
¶ -
If fixed, no new paths can be created via attribute access
-
path
¶ -
Returns the path up to the root for the current node.
-
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Creates a pandas DataFrame from the stored keys and data.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 baseclass for all ViewableElement types, with an x- and y-dimension. Subclasses should define the data storage in the constructor, as well as methods and properties, which define how the data maps onto the x- and y- and value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) [source] ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
classmethod
collapse_data
( data , function=None , kdims=None , **kwargs ) [source] ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Element'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Element'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source] ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.element.Element'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) [source] ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) [source] ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Element'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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] ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 )-
param Callable
value_transform
( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Creates a pandas DataFrame from the stored keys and data.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Collator'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Collator'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Collator'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.Empty'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.Empty'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.Empty'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.Empty'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.
NdOverlay
( overlays=None , kdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.ndmapping.UniformNdMapping
,holoviews.core.overlay.CompositeOverlay
,holoviews.core.overlay.Overlayable
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( full_grid=False ) [source] ¶ -
Returns a complete set of keys on a GridSpace, even when GridSpace isn’t fully populated. This makes it easier to identify missing elements in the GridSpace.
-
last
¶ -
The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.
-
last_key
¶ -
Returns the last key value.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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.
HoloMap
( initial_items=None , kdims=None , group=None , label=None , **params ) [source] ¶ -
Bases:
holoviews.core.ndmapping.UniformNdMapping
,holoviews.core.overlay.Overlayable
A HoloMap can hold any number of DataLayers indexed by a list of dimension values. It also has a number of properties, which can find the x- and y-dimension limits and labels.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
collapse
( dimensions=None , function=None , spreadfn=None , **kwargs ) [source] ¶ -
Allows collapsing one of any number of key dimensions on the HoloMap. Homogeneous Elements may be collapsed by supplying a function, inhomogeneous elements are merged.
-
collate
( merge_type=None , drop=[] , drop_constant=False ) [source] ¶ -
Collation allows collapsing nested HoloMaps by merging their dimensions. 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.
Specific dimensions may be dropped if they are redundant by supplying them in a list. Enabling drop_constant allows ignoring any non-varying dimensions during collation.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
grid
( dimensions=None , **kwargs ) [source] ¶ -
GridSpace takes a list of one or two dimensions, and lays out the containing Views along these axes in a GridSpace.
Shows all HoloMap data When no dimensions are specified.
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
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.
-
layout
( dimensions=None , **kwargs ) [source] ¶ -
GridSpace takes a list of one or two dimensions, and lays out the containing Views along these axes in a GridSpace.
Shows all HoloMap data When no dimensions are specified.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
overlay
( dimensions=None , **kwargs ) [source] ¶ -
Splits the UniformNdMapping along a specified number of dimensions and overlays items in the split out Maps.
Shows all HoloMap data When no dimensions are specified.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=None , function=None , **reduce_map ) [source] ¶ -
Reduce each Element in the HoloMap using a function supplied via the kwargs, where the keyword has to match a particular dimension in the Elements.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
sample
( samples=[] , bounds=None , **sample_values ) [source] ¶ -
Sample each Element in the UniformNdMapping by passing either a list of samples or a tuple specifying the number of regularly spaced samples per dimension. Alternatively, a single sample may be requested using dimension-value pairs. Optionally, the bounds argument can be used to specify the bounding extent from which the coordinates are to regularly sampled. Regular sampling assumes homogeneous and regularly sampled data.
For 1D sampling, the shape is simply as the desired number of samples (and not a tuple). The bounds format for 1D sampling is the tuple (lower, upper) and the tuple (left, bottom, right, top) for 2D sampling.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
split_overlays
( ) [source] ¶ -
Given a UniformNdMapping of Overlays of N layers, split out the layers into N separate Maps.
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 or key_dimensions.
-
- 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 or value_dimensions.
-
- 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 or deep_dimensions.
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) [source] ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) [source] ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) [source] ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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=[‘array’, ‘dataframe’, ‘dictionary’, ‘grid’, ‘ndelement’, ‘xarray’, ‘dask’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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] ¶ -
Create a new object with an additional key dimensions. 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.
-
aggregate
( dimensions=None , function=None , spreadfn=None , **kwargs ) [source] ¶ -
Aggregates over the supplied key dimensions with the defined function.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords=[] , **kwargs ) [source] ¶ -
Given a single coordinate or multiple coordinates as a tuple or list of tuples or keyword arguments matching the dimension closest will find the closest actual x/y coordinates. Different Element types should implement this appropriately depending on the space they represent, if the Element does not support snapping raise NotImplementedError.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( dimensions=None ) [source] ¶ -
Returns the data in the form of a DataFrame. Supplying a list of dimensions filters the dataframe. If the data is already a DataFrame a copy is returned.
-
dimension_values
( dim , expanded=True , flat=True ) [source] ¶ -
Returns the values along a particular dimension. If unique values are requested will return only unique values.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.data.Dataset'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.data.Dataset'>) ¶
-
groupby
( dimensions=[] , container_type=<class 'holoviews.core.spaces.HoloMap'> , group_type=None , dynamic=False , **kwargs ) [source] ¶ -
Return the results of a groupby operation over the specified dimensions as an object of type container_type (expected to be dictionary-like).
Keys vary over the columns (dimensions) and the corresponding values are collections of group_type (e.g an Element, list, tuple) constructed with kwargs (if supplied).
If dynamic is requested container_type is automatically set to a DynamicMap, allowing dynamic exploration of large datasets. If the data does not represent a full cartesian grid of the requested dimensions some Elements will be empty.
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
iloc
¶ -
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 Parameterized.inspect_value>, <class 'holoviews.core.data.Dataset'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
ndloc
¶ -
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]
, whereiy
andix
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]]
-
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dim , data_range=True ) [source] ¶ -
Computes the range of values along a supplied dimension, taking into account the range and soft_range defined on the Dimension object.
-
reduce
( dimensions=[] , function=None , spreadfn=None , **reduce_map ) [source] ¶ -
Allows reducing the values along one or more key dimension with the supplied function. The dimensions may be supplied as a list and a function to apply or a mapping between the dimensions and functions to apply along each dimension.
-
reindex
( kdims=None , vdims=None ) [source] ¶ -
Create a new object with a re-ordered set of dimensions. Allows converting key dimensions to value dimensions and vice versa.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , closest=True , **kwargs ) [source] ¶ -
Allows sampling of Dataset as an iterator of coordinates matching the key dimensions, returning a new object containing just the selected samples. Alternatively may supply kwargs to sample a coordinate on an object. By default it will attempt to snap to the nearest coordinate if the Element supports it, snapping may be disabled with the closest argument.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **selection ) [source] ¶ -
Allows selecting data by the slices, sets and scalar values along a particular dimension. The indices should be supplied as keywords mapping between the selected dimension and value. Additionally selection_specs (taking the form of a list of type.group.label strings, types or functions) may be supplied, which will ensure the selection is only applied if the specs match the selected object.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.data.Dataset'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.data.Dataset'>) ¶
-
shape
¶ -
Returns the shape of the data.
-
sort
( by=[] , reverse=False ) [source] ¶ -
Sorts the data by the values along the supplied dimensions.
-
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 ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
to
¶ -
Property to create a conversion interface with methods to convert to other Element types.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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.
-
-
class
holoviews.core.
DynamicMap
( callback , initial_items=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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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> ) - 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_inputs=True , *args , **overrides ) [source] ¶ -
Clone method to adapt the slightly different signature of DynamicMap that also overrides Dimensioned clone to avoid checking items if data is unchanged.
-
collapse
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Allows collapsing one of any number of key dimensions on the HoloMap. Homogeneous Elements may be collapsed by supplying a function, inhomogeneous elements are merged.
-
collate
( ) [source] ¶ -
Collation allows reorganizing DynamicMaps with invalid nesting hierarchies. This is particularly useful when defining DynamicMaps returning an (Nd)Layout or GridSpace types. Collating will split the DynamicMap into individual DynamicMaps for each item in the container. Note that the composite object has to be of consistent length and types for this to work correctly.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
event
( **kwargs ) [source] ¶ -
This method allows any of the available stream parameters (renamed as appropriate) to be updated in an event.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
groupby
( dimensions=None , container_type=None , group_type=None , **kwargs ) [source] ¶ -
Implements a dynamic version of a groupby, which will intelligently expand either the inner or outer dimensions depending on whether the container_type or group_type is dynamic.
To apply a groupby to a DynamicMap the dimensions, which are expanded into a non-dynamic type must define a fixed sampling via the values attribute.
Using the dynamic groupby makes it incredibly easy to generate dynamic views into a high-dimensional space while taking advantage of the capabilities of NdOverlay, GridSpace and NdLayout types to visualize more than one Element at a time.
-
hist
( num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source] ¶ -
Computes a histogram from the object and adjoins it by default. By default the histogram is computed for the bottom layer, which can be overriden by supplying an
index
and for the first value dimension, which may be overridden by supplying an explicitdimension
.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
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 , link_inputs=True ) [source] ¶ -
Recursively replaces elements using a map function when the specification applies. Extends regular map with functionality to dynamically apply functions. By default all streams are still linked to the mapped object, to disable linked streams set linked_inputs=False.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the DynamicMap which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=None , function=None , **reduce_map ) ¶ -
Reduce each Element in the HoloMap using a function supplied via the kwargs, where the keyword has to match a particular dimension in the Elements.
-
reindex
( kdims=[] , force=False ) [source] ¶ -
Reindexing a DynamicMap allows reordering the dimensions but not dropping an individual dimension. The force argument which usually allows dropping non-constant dimensions is therefore ignored and only for API consistency.
-
relabel
( label=None , group=None , depth=1 ) [source] ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , bounds=None , **sample_values ) ¶ -
Sample each Element in the UniformNdMapping by passing either a list of samples or a tuple specifying the number of regularly spaced samples per dimension. Alternatively, a single sample may be requested using dimension-value pairs. Optionally, the bounds argument can be used to specify the bounding extent from which the coordinates are to regularly sampled. Regular sampling assumes homogeneous and regularly sampled data.
For 1D sampling, the shape is simply as the desired number of samples (and not a tuple). The bounds format for 1D sampling is the tuple (lower, upper) and the tuple (left, bottom, right, top) for 2D sampling.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the DynamicMap objects by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection and applies to dynamically generated items by wrapping the callback.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
split_overlays
( ) ¶ -
Given a UniformNdMapping of Overlays of N layers, split out the layers into N separate Maps.
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
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 ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( full_grid=False ) ¶ -
Returns a complete set of keys on a GridSpace, even when GridSpace isn’t fully populated. This makes it easier to identify missing elements in the GridSpace.
-
last
¶ -
The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.
-
last_key
¶ -
Returns the last key value.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( *args , **overrides ) [source] ¶ -
Clone method for NdLayout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <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.
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( ) ¶ -
Returns the keys of all the elements.
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.layout.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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <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
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.operation.Operation'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.operation.Operation'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.operation.Operation'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
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
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.operation.Operation'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 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> ) - Optional floating point step specifying how frequently the underlying space should be sampled. May be used to define a discrete sampling of 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 ) - 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 ) - 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] ¶ -
Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint_label
¶ -
The pretty-printed label string for the Dimension
-
pprint_value_string
( value ) [source] ¶ -
Pretty prints the dimension name and value using the global title_format variable, including the unit string (if set). Numeric types are printed to the stated rounding level.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
spec
¶ -
Returns the corresponding 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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.
Layout
( items=None , identifier=None , parent=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.tree.AttrTree
,holoviews.core.dimension.Dimensioned
A Layout is an AttrTree with ViewableElement objects as leaf values. Unlike AttrTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual AttrTree 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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] ¶ -
Clone method for Layout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
classmethod
from_values
( vals ) [source] ¶ -
Returns a Layout given a list (or tuple) of viewable elements or just a single viewable element.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.Layout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
path
¶ -
Returns the path up to the root for the current node.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.Layout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updated the contents of the current AttrTree with the contents of a second AttrTree.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.
Overlay
( items=None , group=None , label=None , **params ) [source] ¶ -
Bases:
holoviews.core.layout.Layout
,holoviews.core.overlay.CompositeOverlay
An Overlay consists of multiple Views (potentially of heterogeneous type) presented one on top each other with a particular z-ordering.
Overlays along with Views 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) and are the only objects that inherit both from Layout and CompositeOverlay.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Layout, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) ¶ -
Clone method for Layout matches Dimensioned.clone except the display mode is also propagated.
-
collapse
( function ) [source] ¶ -
Collapses all the Elements in the Overlay using the supplied function if they share a common type and group.
-
collate
( ) [source] ¶ -
Collates any objects in the Overlay resolving any issues the recommended nesting structure.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
display
( option ) ¶ -
Sets the display policy of the Layout before returning self
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
from_values
( vals ) ¶ -
Returns a Layout given a list (or tuple) of viewable elements or just a single viewable element.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
path
¶ -
Returns the path up to the root for the current node.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
regroup
( group ) ¶ -
Assign a new group string to all the elements and return a new Layout.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updated the contents of the current AttrTree with the contents of a second AttrTree.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.
Tabular
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element
Baseclass to give an NdMapping objects an API to generate a table representation.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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.
-
cell_type
( row , col ) [source] ¶ -
Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Tabular'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Tabular'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.element.Tabular'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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] ¶ -
Get the formatted cell value for the given row and column indices.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Tabular'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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.
AdjointLayout
( data , **params ) [source] ¶ -
Bases:
holoviews.core.dimension.Dimensioned
A AdjointLayout provides a convenient container to lay out a primary plot with some additional supplemental plots, e.g. an image in a Image annotated with a luminance histogram. AdjointLayout accepts a list of three ViewableElement 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 Views 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) [source] ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) [source] ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
boundingregion
Module
¶
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) )
-
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.
-
-
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.
-
dimension
Module
¶
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=False, basestring=<class ‘str’>, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 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> ) - Optional floating point step specifying how frequently the underlying space should be sampled. May be used to define a discrete sampling of 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 ) - 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 ) - 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] ¶ -
Derive a new Dimension that inherits existing parameters except for the supplied, explicit overrides
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint_label
¶ -
The pretty-printed label string for the Dimension
-
pprint_value_string
( value ) [source] ¶ -
Pretty prints the dimension name and value using the global title_format variable, including the unit string (if set). Numeric types are printed to the stated rounding level.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.dimension.Dimension'>) ¶
-
spec
¶ -
Returns the corresponding 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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 or key_dimensions.
-
- 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 or value_dimensions.
-
- 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 or deep_dimensions.
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) [source] ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) [source] ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) [source] ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 ) - 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 ) - 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 , *args , **overrides ) [source] ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.LabelledData'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.LabelledData'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.LabelledData'>) ¶
-
map
( map_fn , specs=None , clone=True ) [source] ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) [source] ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
relabel
( label=None , group=None , depth=0 ) [source] ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.LabelledData'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) [source] ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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] ¶ -
Processes kdims and vdims specifications into a dictionary of dimensions which can be passed to params.
-
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 a list with a dictionary of overrides. Overrides should be indexed by the dimension name with values that is either a Dimension object, a string name or a dictionary specifying the dimension parameters to override.
-
classmethod
element
Module
¶
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 )-
param Callable
value_transform
( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Creates a pandas DataFrame from the stored keys and data.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Collator'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Collator'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Collator'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.element.
NdOverlay
( overlays=None , kdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.ndmapping.UniformNdMapping
,holoviews.core.overlay.CompositeOverlay
,holoviews.core.overlay.Overlayable
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.element.
Tabular
( data , kdims=None , vdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.element.Element
Baseclass to give an NdMapping objects an API to generate a table representation.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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.
-
cell_type
( row , col ) [source] ¶ -
Returns the cell type given a row and column index. The common basic cell types are ‘data’ and ‘heading’.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
collapse_data
( data , function=None , kdims=None , **kwargs ) ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Tabular'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Tabular'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.element.Tabular'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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] ¶ -
Get the formatted cell value for the given row and column indices.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Tabular'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( *args , **overrides ) [source] ¶ -
Clone method for NdLayout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <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.
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( ) ¶ -
Returns the keys of all the elements.
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.layout.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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.element.
Layout
( items=None , identifier=None , parent=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.tree.AttrTree
,holoviews.core.dimension.Dimensioned
A Layout is an AttrTree with ViewableElement objects as leaf values. Unlike AttrTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual AttrTree 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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] ¶ -
Clone method for Layout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
classmethod
from_values
( vals ) [source] ¶ -
Returns a Layout given a list (or tuple) of viewable elements or just a single viewable element.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.Layout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
path
¶ -
Returns the path up to the root for the current node.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.Layout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updated the contents of the current AttrTree with the contents of a second AttrTree.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( full_grid=False ) [source] ¶ -
Returns a complete set of keys on a GridSpace, even when GridSpace isn’t fully populated. This makes it easier to identify missing elements in the GridSpace.
-
last
¶ -
The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.
-
last_key
¶ -
Returns the last key value.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 can hold any number of DataLayers indexed by a list of dimension values. It also has a number of properties, which can find the x- and y-dimension limits and labels.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
collapse
( dimensions=None , function=None , spreadfn=None , **kwargs ) [source] ¶ -
Allows collapsing one of any number of key dimensions on the HoloMap. Homogeneous Elements may be collapsed by supplying a function, inhomogeneous elements are merged.
-
collate
( merge_type=None , drop=[] , drop_constant=False ) [source] ¶ -
Collation allows collapsing nested HoloMaps by merging their dimensions. 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.
Specific dimensions may be dropped if they are redundant by supplying them in a list. Enabling drop_constant allows ignoring any non-varying dimensions during collation.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
grid
( dimensions=None , **kwargs ) [source] ¶ -
GridSpace takes a list of one or two dimensions, and lays out the containing Views along these axes in a GridSpace.
Shows all HoloMap data When no dimensions are specified.
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
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.
-
layout
( dimensions=None , **kwargs ) [source] ¶ -
GridSpace takes a list of one or two dimensions, and lays out the containing Views along these axes in a GridSpace.
Shows all HoloMap data When no dimensions are specified.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
overlay
( dimensions=None , **kwargs ) [source] ¶ -
Splits the UniformNdMapping along a specified number of dimensions and overlays items in the split out Maps.
Shows all HoloMap data When no dimensions are specified.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=None , function=None , **reduce_map ) [source] ¶ -
Reduce each Element in the HoloMap using a function supplied via the kwargs, where the keyword has to match a particular dimension in the Elements.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
sample
( samples=[] , bounds=None , **sample_values ) [source] ¶ -
Sample each Element in the UniformNdMapping by passing either a list of samples or a tuple specifying the number of regularly spaced samples per dimension. Alternatively, a single sample may be requested using dimension-value pairs. Optionally, the bounds argument can be used to specify the bounding extent from which the coordinates are to regularly sampled. Regular sampling assumes homogeneous and regularly sampled data.
For 1D sampling, the shape is simply as the desired number of samples (and not a tuple). The bounds format for 1D sampling is the tuple (lower, upper) and the tuple (left, bottom, right, top) for 2D sampling.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
split_overlays
( ) [source] ¶ -
Given a UniformNdMapping of Overlays of N layers, split out the layers into N separate Maps.
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 or key_dimensions.
-
- 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 or value_dimensions.
-
- 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 or deep_dimensions.
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) [source] ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) [source] ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) [source] ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Creates a pandas DataFrame from the stored keys and data.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 baseclass for all ViewableElement types, with an x- and y-dimension. Subclasses should define the data storage in the constructor, as well as methods and properties, which define how the data maps onto the x- and y- and value dimensions.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Element, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
closest
( coords ) [source] ¶ -
Class method that returns the exact keys for a given list of coordinates. The supplied bounds defines the extent within which the samples are drawn and the optional shape argument is the shape of the numpy array (typically the shape of the .data attribute) when applicable.
-
classmethod
collapse_data
( data , function=None , kdims=None , **kwargs ) [source] ¶ -
Class method to collapse a list of data matching the data format of the Element type. By implementing this method HoloMap can collapse multiple Elements of the same type. The kwargs are passed to the collapse function. The collapse function must support the numpy style axis selection. Valid function include: np.mean, np.sum, np.product, np.std, scipy.stats.kurtosis etc. Some data backends also require the key dimensions to aggregate over.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.element.Element'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.element.Element'>) ¶
-
hist
( dimension=None , num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source] ¶ -
The hist method generates a histogram to be adjoined to the Element in an AdjointLayout. By default the histogram is computed along the first value dimension of the Element, however any dimension may be selected. The number of bins and the bin_ranges and any kwargs to be passed to the histogram operation may also be supplied.
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.element.Element'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=[] , function=None , **reduce_map ) [source] ¶ -
Base class signature to demonstrate API for reducing Elements, using some reduce function, e.g. np.mean, which is applied along a particular Dimension. The dimensions and reduce functions should be passed as keyword arguments or as a list of dimensions and a single function.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , **sample_values ) [source] ¶ -
Base class signature to demonstrate API for sampling Elements. To sample an Element supply either a list of samples or keyword arguments, where the key should match an existing key dimension on the Element.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.element.Element'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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] ¶ -
Converts the data Element to a Table, optionally may specify a supported data type. The default data types are ‘numpy’ (for homogeneous data), ‘dataframe’, and ‘dictionary’.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
io
Module
¶
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 ) - The exporter functions used to convert HoloViews objects into the appropriate format(s).
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Archive'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Archive'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Archive'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Archive'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
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 ) - 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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
deserializer
( filename ) ¶ -
Equivalent to pickle.load except that the HoloViews trees is restored appropriately.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Deserializer'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Deserializer'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Deserializer'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Deserializer'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Deserializer'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Callable
-
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 ) - 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 ) - 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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Exporter'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Exporter'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Exporter'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Exporter'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Exporter'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Callable
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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, objects=[‘zip’, ‘tar’], pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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> ) - 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 ) - 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.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.FileArchive'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.FileArchive'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.FileArchive'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
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
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.FileArchive'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param List
-
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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Importer'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Importer'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Importer'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Importer'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Importer'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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:
- Optional (zip) compression.
- Ability to save and load components of a Layout independently.
- 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 ) - 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 ) - 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> ) - 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 ) - Whether compression is enabled or not
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Pickler'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Pickler'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Pickler'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Pickler'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Pickler'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Reference'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Reference'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Reference'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
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
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Reference'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - The file extension associated with the corresponding file format (if applicable).
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Serializer'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Serializer'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Serializer'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Serializer'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
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
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Serializer'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Callable
-
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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.io.Unpickler'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.io.Unpickler'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.io.Unpickler'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.io.Unpickler'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.io.Unpickler'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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
¶
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.
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( *args , **overrides ) [source] ¶ -
Clone method for NdLayout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <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.
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( ) ¶ -
Returns the keys of all the elements.
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.NdLayout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.layout.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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.layout.
Layout
( items=None , identifier=None , parent=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.tree.AttrTree
,holoviews.core.dimension.Dimensioned
A Layout is an AttrTree with ViewableElement objects as leaf values. Unlike AttrTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual AttrTree 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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] ¶ -
Clone method for Layout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
classmethod
from_values
( vals ) [source] ¶ -
Returns a Layout given a list (or tuple) of viewable elements or just a single viewable element.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.Layout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
path
¶ -
Returns the path up to the root for the current node.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.Layout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updated the contents of the current AttrTree with the contents of a second AttrTree.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.layout.
AdjointLayout
( data , **params ) [source] ¶ -
Bases:
holoviews.core.dimension.Dimensioned
A AdjointLayout provides a convenient container to lay out a primary plot with some additional supplemental plots, e.g. an image in a Image annotated with a luminance histogram. AdjointLayout accepts a list of three ViewableElement 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 or key_dimensions.
-
- 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 or value_dimensions.
-
- 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 or deep_dimensions.
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) [source] ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) [source] ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) [source] ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 Views 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) [source] ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) [source] ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Creates a pandas DataFrame from the stored keys and data.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.Empty'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.Empty'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.Empty'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.Empty'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
ndmapping
Module
¶
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) [source] ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) [source] ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) [source] ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) [source] ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.MultiDimensionalMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) [source] ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , *args , **overrides ) ¶ -
Overrides Dimensioned clone to avoid checking items if data is unchanged.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Creates a pandas DataFrame from the stored keys and data.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.NdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 Views 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) [source] ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) [source] ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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
¶
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 ) - 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, objects=[‘default’, True, False], pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - List of streams that are applied if dynamic=True, allowing for dynamic interaction with the plot.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <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
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.operation.Operation'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.operation.Operation'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.operation.Operation'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
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
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.operation.Operation'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - The Operation being wrapped into an OperationCallable.
-
clone
( callable=None , **overrides ) ¶ -
Allows making a copy of the Callable optionally overriding the callable and other parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.operation.OperationCallable'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.operation.OperationCallable'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.operation.OperationCallable'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
noargs
¶ -
Returns True if the callable takes no arguments
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.operation.OperationCallable'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Callable
options
Module
¶
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 , **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, objects=[‘data’, ‘display’], pickle_default_value=True, precedence=None, readonly=False ) - The mode of the Compositor object which may be either ‘data’ or ‘display’.
-
param Parameter
operation
( allow_None=True, constant=False, default=None, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.options.Compositor'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.options.Compositor'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
output_type
¶ -
Returns the operation output_type unless explicitly overridden in the kwargs.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.options.Compositor'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) [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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param ObjectSelector
-
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=False, basestring=<class ‘str’>, constant=False, default=default_colors, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - The values the cycle will iterate over.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.options.Cycle'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.options.Cycle'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.options.Cycle'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.options.Cycle'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - Optional string description of what the keywords apply to.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <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
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.options.Keywords'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.options.Keywords'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.options.Keywords'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param List
-
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.
-
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 ) [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
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
options
( group , target=None ) [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.
-
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.
-
-
class
holoviews.core.options.
Options
( key=None , allowed_keywords=[] , merge_keywords=True , **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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether all Options instances should generate warnings when skipping over invalid keywords or not. May only be specified at the class level.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.options.Options'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.options.Options'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.options.Options'>) ¶
-
keywords_target
( target ) [source] ¶ -
Helper method to easily set the target on the allowed_keywords Keywords.
-
max_cycles
( num ) [source] ¶ -
Truncates all contained Cycle objects to a maximum number of Cycles and returns a new Options object with the truncated or resampled Cycles.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
options
¶ -
Access of the options keywords when no cycles are defined.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.options.Options'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param ClassSelector
-
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 ) - 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 ) - 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 ) - 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> ) - 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 ) - 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 ) - Whether to reverse the palette.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.options.Palette'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.options.Palette'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.options.Palette'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
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
-
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
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.options.Palette'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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
OutputSettings
-
classmethod
-
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 ) [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
overlay
Module
¶
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.
NdOverlay
( overlays=None , kdims=None , **params ) [source] ¶ -
Bases:
holoviews.core.ndmapping.UniformNdMapping
,holoviews.core.overlay.CompositeOverlay
,holoviews.core.overlay.Overlayable
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.NdOverlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.overlay.
Layout
( items=None , identifier=None , parent=None , **kwargs ) [source] ¶ -
Bases:
holoviews.core.tree.AttrTree
,holoviews.core.dimension.Dimensioned
A Layout is an AttrTree with ViewableElement objects as leaf values. Unlike AttrTree, a Layout supports a rich display, displaying leaf items in a grid style layout. In addition to the usual AttrTree 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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] ¶ -
Clone method for Layout matches Dimensioned.clone except the display mode is also propagated.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
classmethod
from_values
( vals ) [source] ¶ -
Returns a Layout given a list (or tuple) of viewable elements or just a single viewable element.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.Layout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.Layout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
path
¶ -
Returns the path up to the root for the current node.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.Layout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updated the contents of the current AttrTree with the contents of a second AttrTree.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.overlay.
Overlay
( items=None , group=None , label=None , **params ) [source] ¶ -
Bases:
holoviews.core.layout.Layout
,holoviews.core.overlay.CompositeOverlay
An Overlay consists of multiple Views (potentially of heterogeneous type) presented one on top each other with a particular z-ordering.
Overlays along with Views 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) and are the only objects that inherit both from Layout and CompositeOverlay.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=Layout, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) ¶ -
Clone method for Layout matches Dimensioned.clone except the display mode is also propagated.
-
collapse
( function ) [source] ¶ -
Collapses all the Elements in the Overlay using the supplied function if they share a common type and group.
-
collate
( ) [source] ¶ -
Collates any objects in the Overlay resolving any issues the recommended nesting structure.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
display
( option ) ¶ -
Sets the display policy of the Layout before returning self
-
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 Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
from_values
( vals ) ¶ -
Returns a Layout given a list (or tuple) of viewable elements or just a single viewable element.
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
merge
( trees ) ¶ -
Merge a collection of AttrTree objects.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
path
¶ -
Returns the path up to the root for the current node.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
regroup
( group ) ¶ -
Assign a new group string to all the elements and return a new Layout.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.Overlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
update
( other ) ¶ -
Updated the contents of the current AttrTree with the contents of a second AttrTree.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
class
holoviews.core.overlay.
AdjointLayout
( data , **params ) [source] ¶ -
Bases:
holoviews.core.dimension.Dimensioned
A AdjointLayout provides a convenient container to lay out a primary plot with some additional supplemental plots, e.g. an image in a Image annotated with a luminance histogram. AdjointLayout accepts a list of three ViewableElement 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.layout.AdjointLayout'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 or key_dimensions.
-
- 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 or value_dimensions.
-
- 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 or deep_dimensions.
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) [source] ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) [source] ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) [source] ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_type
( dim ) [source] ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) [source] ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.Dimensioned'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 Views 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) [source] ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) [source] ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
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 ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.ndmapping.UniformNdMapping'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension. This method must be implemented for all Dimensioned type.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.dimension.ViewableElement'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original. May also supply a new_type, which will inherit all shared parameters.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.overlay.CompositeOverlay'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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 , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
pprint
Module
¶
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
[source] ¶ -
Bases:
object
The PrettyPrinter used to print all HoloView objects via the pprint classmethod.
-
classmethod
element_info
( node , siblings , level , value_dims ) [source] ¶ -
Return the information summary for an Element. This consists of the dotted name followed by an value dimension names.
-
classmethod
-
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
Store
-
classmethod
sheetcoords
Module
¶
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 ) ¶ -
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 isFalse
.
- 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(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 :func: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 eitherc=a+b
orct=(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.
- UPDATEIFCOPY (U)
- 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 ina.flags.writeable
). Short flag names are only supported in dictionary access.Only the 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
. -
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 ifarr.shape[dim] == 1
or the array has no elements. It does not generally hold thatself.strides[-1] == self.itemsize
for C-style contiguous arrays orself.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 thana[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 ) ¶ -
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 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 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 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(a, 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 ) ¶ -
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
-
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.
- 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, 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 UPDATEIFCOPY flag 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 6 Boolean flags in use, only three of which can be changed by the user: 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) this array is a copy of some other array (referenced by .base). When this array is deallocated, the base array will be updated with the contents of this array.
All flags can be accessed using their first (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 UPDATEIFCOPY : False >>> y.setflags(write=0, align=0) >>> y.flags C_CONTIGUOUS : True F_CONTIGUOUS : False OWNDATA : True WRITEABLE : False ALIGNED : False UPDATEIFCOPY : False >>> y.setflags(uic=1) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: cannot set UPDATEIFCOPY flag to True
-
shape
¶ -
Tuple of array dimensions.
May be used to “reshape” the array, as long as this would not require a change in the total number of elements
>>> 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
-
size
¶ -
Number of elements in the array.
Equivalent to
np.prod(a.shape)
, i.e., the product of the array’s dimensions.>>> 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’}, 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.
-
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
-
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])
, thena.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)
ora.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)
ora.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)
, ifsome_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 ofa
(shown byprint(a)
). It also depends on exactly howa
is stored in memory. Therefore ifa
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
¶
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Defines how streams should be mapped to objects returned by the Callable, e.g. when it returns a Layout.
-
clone
( callable=None , **overrides ) [source] ¶ -
Allows making a copy of the Callable optionally overriding the callable and other parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.Callable'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.Callable'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.spaces.Callable'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
noargs
¶ -
Returns True if the callable takes no arguments
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.Callable'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Callable
-
class
holoviews.core.spaces.
DynamicMap
( callback , initial_items=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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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> ) - 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_inputs=True , *args , **overrides ) [source] ¶ -
Clone method to adapt the slightly different signature of DynamicMap that also overrides Dimensioned clone to avoid checking items if data is unchanged.
-
collapse
( dimensions=None , function=None , spreadfn=None , **kwargs ) ¶ -
Allows collapsing one of any number of key dimensions on the HoloMap. Homogeneous Elements may be collapsed by supplying a function, inhomogeneous elements are merged.
-
collate
( ) [source] ¶ -
Collation allows reorganizing DynamicMaps with invalid nesting hierarchies. This is particularly useful when defining DynamicMaps returning an (Nd)Layout or GridSpace types. Collating will split the DynamicMap into individual DynamicMaps for each item in the container. Note that the composite object has to be of consistent length and types for this to work correctly.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
event
( **kwargs ) [source] ¶ -
This method allows any of the available stream parameters (renamed as appropriate) to be updated in an event.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
groupby
( dimensions=None , container_type=None , group_type=None , **kwargs ) [source] ¶ -
Implements a dynamic version of a groupby, which will intelligently expand either the inner or outer dimensions depending on whether the container_type or group_type is dynamic.
To apply a groupby to a DynamicMap the dimensions, which are expanded into a non-dynamic type must define a fixed sampling via the values attribute.
Using the dynamic groupby makes it incredibly easy to generate dynamic views into a high-dimensional space while taking advantage of the capabilities of NdOverlay, GridSpace and NdLayout types to visualize more than one Element at a time.
-
hist
( num_bins=20 , bin_range=None , adjoin=True , individually=True , **kwargs ) [source] ¶ -
Computes a histogram from the object and adjoins it by default. By default the histogram is computed for the bottom layer, which can be overriden by supplying an
index
and for the first value dimension, which may be overridden by supplying an explicitdimension
.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
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 , link_inputs=True ) [source] ¶ -
Recursively replaces elements using a map function when the specification applies. Extends regular map with functionality to dynamically apply functions. By default all streams are still linked to the mapped object, to disable linked streams set linked_inputs=False.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) [source] ¶ -
Apply the supplied options to a clone of the DynamicMap which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=None , function=None , **reduce_map ) ¶ -
Reduce each Element in the HoloMap using a function supplied via the kwargs, where the keyword has to match a particular dimension in the Elements.
-
reindex
( kdims=[] , force=False ) [source] ¶ -
Reindexing a DynamicMap allows reordering the dimensions but not dropping an individual dimension. The force argument which usually allows dropping non-constant dimensions is therefore ignored and only for API consistency.
-
relabel
( label=None , group=None , depth=1 ) [source] ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
sample
( samples=[] , bounds=None , **sample_values ) ¶ -
Sample each Element in the UniformNdMapping by passing either a list of samples or a tuple specifying the number of regularly spaced samples per dimension. Alternatively, a single sample may be requested using dimension-value pairs. Optionally, the bounds argument can be used to specify the bounding extent from which the coordinates are to regularly sampled. Regular sampling assumes homogeneous and regularly sampled data.
For 1D sampling, the shape is simply as the desired number of samples (and not a tuple). The bounds format for 1D sampling is the tuple (lower, upper) and the tuple (left, bottom, right, top) for 2D sampling.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) [source] ¶ -
Allows slicing or indexing into the DynamicMap objects by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection and applies to dynamically generated items by wrapping the callback.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.DynamicMap'>) ¶
-
split_overlays
( ) ¶ -
Given a UniformNdMapping of Overlays of N layers, split out the layers into N separate Maps.
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
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 ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Defines how streams should be mapped to objects returned by the Callable, e.g. when it returns a Layout.
-
clone
( callable=None , **overrides ) ¶ -
Allows making a copy of the Callable optionally overriding the callable and other parameters.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.Generator'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.Generator'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.spaces.Generator'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
noargs
¶ -
Returns True if the callable takes no arguments
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.Generator'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param ClassSelector
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( full_grid=False ) ¶ -
Returns a complete set of keys on a GridSpace, even when GridSpace isn’t fully populated. This makes it easier to identify missing elements in the GridSpace.
-
last
¶ -
The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.
-
last_key
¶ -
Returns the last key value.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.GridMatrix'>) ¶
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
items
( ) ¶ -
Returns all elements as a list in (key,value) format.
-
keys
( full_grid=False ) [source] ¶ -
Returns a complete set of keys on a GridSpace, even when GridSpace isn’t fully populated. This makes it easier to identify missing elements in the GridSpace.
-
last
¶ -
The last of a GridSpace is another GridSpace constituted of the last of the individual elements. To access the elements by their X,Y position, either index the position directly or use the items() method.
-
last_key
¶ -
Returns the last key value.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
relabel
( label=None , group=None , depth=0 ) ¶ -
Assign a new label and/or group to an existing LabelledData object, creating a clone of the object with the new settings.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.GridSpace'>) ¶
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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 can hold any number of DataLayers indexed by a list of dimension values. It also has a number of properties, which can find the x- and y-dimension limits and labels.
-
param String
group
( allow_None=False, basestring=<class ‘str’>, constant=True, default=NdMapping, instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - 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 ) - Whether the items should be sorted in the constructor.
-
add_dimension
( dimension , dim_pos , dim_val , vdim=False , **kwargs ) ¶ -
Create a new object with an additional key dimensions. 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.
-
clone
( data=None , shared_data=True , new_type=None , *args , **overrides ) ¶ -
Returns a clone of the object with matching parameter values containing the specified args and kwargs.
If shared_data is set to True and no data explicitly supplied, the clone will share data with the original.
-
collapse
( dimensions=None , function=None , spreadfn=None , **kwargs ) [source] ¶ -
Allows collapsing one of any number of key dimensions on the HoloMap. Homogeneous Elements may be collapsed by supplying a function, inhomogeneous elements are merged.
-
collate
( merge_type=None , drop=[] , drop_constant=False ) [source] ¶ -
Collation allows collapsing nested HoloMaps by merging their dimensions. 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.
Specific dimensions may be dropped if they are redundant by supplying them in a list. Enabling drop_constant allows ignoring any non-varying dimensions during collation.
-
ddims
¶ -
The list of deep dimensions
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
dframe
( ) ¶ -
Gets a dframe for each Element in the HoloMap, appends the dimensions of the HoloMap as series and concatenates the dframes.
-
dimension_values
( dimension , expanded=True , flat=True ) ¶ -
Returns the values along the specified dimension.
-
dimensions
( selection='all' , label=False ) ¶ -
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.
-
drop_dimension
( dimensions ) ¶ -
Returns a new mapping with the named dimension(s) removed.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
get
( key , default=None ) ¶ -
Standard get semantics for all mapping types
-
get_dimension
( dimension , default=None , strict=False ) ¶ -
Access a Dimension object by name or index. Returns the default value if the dimension is not found and strict is False. If strict is True, a KeyError is raised instead.
-
get_dimension_index
( dim ) ¶ -
Returns the index of the requested dimension.
-
get_dimension_type
( dim ) ¶ -
Returns the specified Dimension type if specified or if the dimension_values types are consistent otherwise None is returned.
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
grid
( dimensions=None , **kwargs ) [source] ¶ -
GridSpace takes a list of one or two dimensions, and lays out the containing Views along these axes in a GridSpace.
Shows all HoloMap data When no dimensions are specified.
-
groupby
( dimensions , container_type=None , group_type=None , **kwargs ) ¶ -
Splits the mapping into groups by key dimension which are then returned together in a mapping of class container_type. The individual groups are of the same type as the original map. This operation will always sort the groups and the items in each group.
-
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 Parameterized.inspect_value>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
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.
-
layout
( dimensions=None , **kwargs ) [source] ¶ -
GridSpace takes a list of one or two dimensions, and lays out the containing Views along these axes in a GridSpace.
Shows all HoloMap data When no dimensions are specified.
-
map
( map_fn , specs=None , clone=True ) ¶ -
Recursively replaces elements using a map function when the specification applies.
-
matches
( spec ) ¶ -
A specification may be a class, a tuple or a string. Equivalent to isinstance if a class is supplied, otherwise matching occurs on type, group and label. These may be supplied as a tuple of strings or as a single string of the form “{type}.{group}.{label}”. Matching may be done on {type} alone, {type}.{group}, or {type}.{group}.{label}. The strings for the type, group, and label will each be sanitized before the match, and so the sanitized versions of those values will need to be provided if the match is to succeed.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
opts
( options=None , **kwargs ) ¶ -
Apply the supplied options to a clone of the object which is then returned. Note that if no options are supplied at all, all ids are reset.
-
overlay
( dimensions=None , **kwargs ) [source] ¶ -
Splits the UniformNdMapping along a specified number of dimensions and overlays items in the split out Maps.
Shows all HoloMap data When no dimensions are specified.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
range
( dimension , data_range=True ) ¶ -
Returns the range of values along the specified dimension.
If data_range is True, the data may be used to try and infer the appropriate range. Otherwise, (None,None) is returned to indicate that no range is defined.
-
reduce
( dimensions=None , function=None , **reduce_map ) [source] ¶ -
Reduce each Element in the HoloMap using a function supplied via the kwargs, where the keyword has to match a particular dimension in the Elements.
-
reindex
( kdims=[] , force=False ) ¶ -
Create a new object with a re-ordered or reduced set of 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.
-
sample
( samples=[] , bounds=None , **sample_values ) [source] ¶ -
Sample each Element in the UniformNdMapping by passing either a list of samples or a tuple specifying the number of regularly spaced samples per dimension. Alternatively, a single sample may be requested using dimension-value pairs. Optionally, the bounds argument can be used to specify the bounding extent from which the coordinates are to regularly sampled. Regular sampling assumes homogeneous and regularly sampled data.
For 1D sampling, the shape is simply as the desired number of samples (and not a tuple). The bounds format for 1D sampling is the tuple (lower, upper) and the tuple (left, bottom, right, top) for 2D sampling.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
select
( selection_specs=None , **kwargs ) ¶ -
Allows slicing or indexing into the Dimensioned object by supplying the dimension and index/slice as key value pairs. Select descends recursively through the data structure applying the key dimension selection. The ‘value’ keyword allows selecting the value dimensions on objects which have any declared.
The selection may also be selectively applied to specific objects by supplying the selection_specs as an iterable of type.group.label specs, types or functions.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <class 'holoviews.core.spaces.HoloMap'>) ¶
-
split_overlays
( ) [source] ¶ -
Given a UniformNdMapping of Overlays of N layers, split out the layers into N separate Maps.
-
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 ) ¶ -
Creates a table from the stored keys and data.
-
traverse
( fn , specs=None , full_breadth=True ) ¶ -
Traverses any nested LabelledData object (i.e LabelledData objects containing LabelledData objects), applying the supplied function to each constituent element if the supplied specifications. The output of these function calls are collected and returned in the accumulator list.
If specs is None, all constituent elements are processed. Otherwise, specs must be a list of type.group.label specs, types, and functions.
-
type
¶ -
The type of elements stored in the map.
-
update
( other ) ¶ -
Updates the current mapping with some other mapping or OrderedDict instance, making sure that they are indexed along the same set of dimensions. The order of key dimensions remains unchanged after the update.
-
values
( ) ¶ -
Returns the values of all the elements.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param String
-
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] ¶ -
Get all DynamicMaps referenced by the supplied DynamicMap’s callback.
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.
tree
Module
¶
-
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
-
fixed
¶ -
If fixed, no new paths can be created via attribute access
-
path
¶ -
Returns the path up to the root for the current node.
-
util
Module
¶
-
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
style_17
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.util.Config'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.util.Config'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.util.Config'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.util.Config'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.util.Config'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Boolean
-
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 ) - 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 ) - The label of the current progress bar.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.util.ProgressIndicator'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.util.ProgressIndicator'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.util.ProgressIndicator'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.util.ProgressIndicator'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param NumericTuple
-
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.
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.
callable_name
( callable_obj ) [source] ¶ -
Attempt to return a meaningful name identifying a callable or generator
-
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.
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.
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.
dimension_range
( lower , upper , dimension ) [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_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.
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 DataFrame type.
-
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 ) [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]
-
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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.util.ndmapping_groupby'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.util.ndmapping_groupby'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.util.ndmapping_groupby'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.util.ndmapping_groupby'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.util.ndmapping_groupby'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
-
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 thread.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.
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, objects=[2, 3], pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 0x7ff457797e18>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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 ) - 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 ) - 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 ) - 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 ) - Cache of previously computed sanitizations
-
add_aliases
= functools.partial(<function sanitize_identifier_fn.add_aliases>, <class 'holoviews.core.util.sanitize_identifier_fn'>) [source] ¶
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= functools.partial(<function Parameterized.force_new_dynamic_value>, <class 'holoviews.core.util.sanitize_identifier_fn'>) ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= functools.partial(<function Parameterized.get_value_generator>, <class 'holoviews.core.util.sanitize_identifier_fn'>) ¶
-
inspect_value
= functools.partial(<function Parameterized.inspect_value>, <class 'holoviews.core.util.sanitize_identifier_fn'>) ¶
-
instance
= functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.core.util.sanitize_identifier_fn'>) ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
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] ¶
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= functools.partial(<function Parameterized.set_dynamic_time_fn>, <class 'holoviews.core.util.sanitize_identifier_fn'>) ¶
-
set_param
= functools.partial(<function Parameterized.set_param>, <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
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param ObjectSelector
-
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.