holoviews.ipython Package


ipython Package

Inheritance diagram of holoviews.ipython
class holoviews.ipython. IPTestCase ( *args , **kwargs ) [source]

Bases: holoviews.element.comparison.ComparisonTestCase

This class extends ComparisonTestCase to handle IPython specific objects and support the execution of cells and magic.

addCleanup ( function , *args , **kwargs )

Add a function, with arguments, to be called when the test is completed. Functions added are called on a LIFO basis and are called after tearDown on test failure or success.

Cleanup items are called even if setUp fails (unlike tearDown).

addTypeEqualityFunc ( typeobj , function )

Add a type specific assertEqual style function to compare a type.

This method is for use by TestCase subclasses that need to register their own type equality functions to provide nicer error messages.

Args:
typeobj: The data type to call this function on when both values
are of the same type in assertEqual().
function: The callable taking two arguments and an optional
msg= argument that raises self.failureException with a useful error message when the two arguments are not equal.
assertAlmostEqual ( first , second , places=None , msg=None , delta=None )

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is more than the given delta.

Note that decimal places (from zero) are usually not the same as significant digits (measured from the most significant digit).

If the two objects compare equal then they will automatically compare almost equal.

assertCountEqual ( first , second , msg=None )

An unordered sequence comparison asserting that the same elements, regardless of order. If the same element occurs more than once, it verifies that the elements occur the same number of times.

self.assertEqual(Counter(list(first)),
Counter(list(second)))
Example:
  • [0, 1, 1] and [1, 0, 1] compare equal.
  • [0, 0, 1] and [0, 1] compare unequal.
assertDictContainsSubset ( subset , dictionary , msg=None )

Checks whether dictionary is a superset of subset.

assertEqual ( first , second , msg=None )

Classmethod equivalent to unittest.TestCase method

assertFalse ( expr , msg=None )

Check that the expression is false.

assertGreater ( a , b , msg=None )

Just like self.assertTrue(a > b), but with a nicer default message.

assertGreaterEqual ( a , b , msg=None )

Just like self.assertTrue(a >= b), but with a nicer default message.

assertIn ( member , container , msg=None )

Just like self.assertTrue(a in b), but with a nicer default message.

assertIs ( expr1 , expr2 , msg=None )

Just like self.assertTrue(a is b), but with a nicer default message.

assertIsInstance ( obj , cls , msg=None )

Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.

assertIsNone ( obj , msg=None )

Same as self.assertTrue(obj is None), with a nicer default message.

assertIsNot ( expr1 , expr2 , msg=None )

Just like self.assertTrue(a is not b), but with a nicer default message.

assertIsNotNone ( obj , msg=None )

Included for symmetry with assertIsNone.

assertLess ( a , b , msg=None )

Just like self.assertTrue(a < b), but with a nicer default message.

assertLessEqual ( a , b , msg=None )

Just like self.assertTrue(a <= b), but with a nicer default message.

assertListEqual ( list1 , list2 , msg=None )

A list-specific equality assertion.

Args:

list1: The first list to compare. list2: The second list to compare. msg: Optional message to use on failure instead of a list of

differences.
assertLogs ( logger=None , level=None )

Fail unless a log message of level level or higher is emitted on logger_name or its children. If omitted, level defaults to INFO and logger defaults to the root logger.

This method must be used as a context manager, and will yield a recording object with two attributes: output and records . At the end of the context manager, the output attribute will be a list of the matching formatted log messages and the records attribute will be a list of the corresponding LogRecord objects.

Example:

with self.assertLogs('foo', level='INFO') as cm:
    logging.getLogger('foo').info('first message')
    logging.getLogger('foo.bar').error('second message')
self.assertEqual(cm.output, ['INFO:foo:first message',
                             'ERROR:foo.bar:second message'])
assertMultiLineEqual ( first , second , msg=None )

Assert that two multi-line strings are equal.

assertNotAlmostEqual ( first , second , places=None , msg=None , delta=None )

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the difference between the two objects is less than the given delta.

Note that decimal places (from zero) are usually not the same as significant digits (measured from the most significant digit).

Objects that are equal automatically fail.

assertNotEqual ( first , second , msg=None )

Fail if the two objects are equal as determined by the ‘!=’ operator.

assertNotIn ( member , container , msg=None )

Just like self.assertTrue(a not in b), but with a nicer default message.

assertNotIsInstance ( obj , cls , msg=None )

Included for symmetry with assertIsInstance.

assertNotRegex ( text , unexpected_regex , msg=None )

Fail the test if the text matches the regular expression.

assertRaises ( expected_exception , *args , **kwargs )

Fail unless an exception of class expected_exception is raised by the callable when invoked with specified positional and keyword arguments. If a different type of exception is raised, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.

If called with the callable and arguments omitted, will return a context object used like this:

with self.assertRaises(SomeException):
    do_something()

An optional keyword argument ‘msg’ can be provided when assertRaises is used as a context object.

The context manager keeps a reference to the exception as the ‘exception’ attribute. This allows you to inspect the exception after the assertion:

with self.assertRaises(SomeException) as cm:
    do_something()
the_exception = cm.exception
self.assertEqual(the_exception.error_code, 3)
assertRaisesRegex ( expected_exception , expected_regex , *args , **kwargs )

Asserts that the message in a raised exception matches a regex.

Args:

expected_exception: Exception class expected to be raised. expected_regex: Regex (re pattern object or string) expected

to be found in error message.

args: Function to be called and extra positional args. kwargs: Extra kwargs. msg: Optional message used in case of failure. Can only be used

when assertRaisesRegex is used as a context manager.
assertRegex ( text , expected_regex , msg=None )

Fail the test unless the text matches the regular expression.

assertSequenceEqual ( seq1 , seq2 , msg=None , seq_type=None )

An equality assertion for ordered sequences (like lists and tuples).

For the purposes of this function, a valid ordered sequence type is one which can be indexed, has a length, and has an equality operator.

Args:

seq1: The first sequence to compare. seq2: The second sequence to compare. seq_type: The expected datatype of the sequences, or None if no

datatype should be enforced.
msg: Optional message to use on failure instead of a list of
differences.
assertSetEqual ( set1 , set2 , msg=None )

A set-specific equality assertion.

Args:

set1: The first set to compare. set2: The second set to compare. msg: Optional message to use on failure instead of a list of

differences.

assertSetEqual uses ducktyping to support different types of sets, and is optimized for sets specifically (parameters must support a difference method).

assertTrue ( expr , msg=None )

Check that the expression is true.

assertTupleEqual ( tuple1 , tuple2 , msg=None )

A tuple-specific equality assertion.

Args:

tuple1: The first tuple to compare. tuple2: The second tuple to compare. msg: Optional message to use on failure instead of a list of

differences.
assertWarns ( expected_warning , *args , **kwargs )

Fail unless a warning of class warnClass is triggered by the callable when invoked with specified positional and keyword arguments. If a different type of warning is triggered, it will not be handled: depending on the other warning filtering rules in effect, it might be silenced, printed out, or raised as an exception.

If called with the callable and arguments omitted, will return a context object used like this:

with self.assertWarns(SomeWarning):
    do_something()

An optional keyword argument ‘msg’ can be provided when assertWarns is used as a context object.

The context manager keeps a reference to the first matching warning as the ‘warning’ attribute; similarly, the ‘filename’ and ‘lineno’ attributes give you information about the line of Python code from which the warning was triggered. This allows you to inspect the warning after the assertion:

with self.assertWarns(SomeWarning) as cm:
    do_something()
the_warning = cm.warning
self.assertEqual(the_warning.some_attribute, 147)
assertWarnsRegex ( expected_warning , expected_regex , *args , **kwargs )

Asserts that the message in a triggered warning matches a regexp. Basic functioning is similar to assertWarns() with the addition that only warnings whose messages also match the regular expression are considered successful matches.

Args:

expected_warning: Warning class expected to be triggered. expected_regex: Regex (re pattern object or string) expected

to be found in error message.

args: Function to be called and extra positional args. kwargs: Extra kwargs. msg: Optional message used in case of failure. Can only be used

when assertWarnsRegex is used as a context manager.
cell ( line ) [source]

Run an IPython cell

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

Run an IPython cell magic

debug ( )

Run the test without collecting errors in a TestResult

doCleanups ( )

Execute all cleanup functions. Normally called for you after tearDown.

fail ( msg=None )

Fail immediately, with the given message.

failureException

alias of builtins.AssertionError

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

Run an IPython line magic

setUpClass ( )

Hook method for setting up class fixture before running tests in the class.

shortDescription ( )

Returns a one-line description of the test, or None if no description has been provided.

The default implementation of this method returns the first line of the specified test method’s docstring.

simple_equality ( first , second , msg=None )

Classmethod equivalent to unittest.TestCase method (longMessage = False.)

skipTest ( reason )

Skip this test.

subTest ( msg=<object object> , **params )

Return a context manager that will return the enclosed block of code in a subtest identified by the optional message and keyword parameters. A failure in the subtest marks the test case as failed but resumes execution at the end of the enclosed block, allowing further test code to be executed.

tearDown ( )

Hook method for deconstructing the test fixture after testing it.

tearDownClass ( )

Hook method for deconstructing the class fixture after running all tests in the class.

class holoviews.ipython. notebook_extension ( **params ) [source]

Bases: holoviews.util.extension

params(holoviews=Boolean, name=String, css=String, logo=Boolean, inline=Boolean, width=Number, display_formats=List, case_sensitive_completion=Boolean)

param String css ( allow_None=False, basestring=<class ‘str’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Optional CSS rule set to apply to the notebook.
param Boolean logo ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Toggles display of HoloViews logo
param Boolean inline ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to inline JS and CSS resources. If disabled, resources are loaded from CDN if one is available.
param Number width ( allow_None=True, bounds=(0, 100), constant=False, default=None, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Width of the notebook as a percentage of the browser screen window width.
param List display_formats ( allow_None=False, bounds=(0, None), constant=False, default=[‘html’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
A list of formats that are rendered to the notebook where multiple formats may be selected at once (although only one format will be displayed). Although the ‘html’ format is supported across backends, other formats supported by the current backend (e.g ‘png’ and ‘svg’ using the matplotlib backend) may be used. This may be useful to export figures to other formats such as PDF with nbconvert.
param Boolean case_sensitive_completion ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to monkey patch IPython to use the correct tab-completion behavior.
classmethod completions_sorting_key ( word ) [source]

Fixed version of IPyton.completer.completions_sorting_key

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.notebook_extension'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.notebook_extension'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.notebook_extension'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.notebook_extension'>)
instance = functools.partial(<function ParameterizedFunction.instance>, <class 'holoviews.ipython.notebook_extension'>)
classmethod load_hvjs ( logo=False , bokeh_logo=False , mpl_logo=False , plotly_logo=False , JS=True , message='HoloViewsJS successfully loaded.' ) [source]

Displays javascript and CSS to initialize HoloViews widgets.

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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

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

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

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

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.notebook_extension'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.notebook_extension'>)
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.

tab_completion_docstring = functools.partial(<function notebook_extension.tab_completion_docstring>, <class 'holoviews.ipython.notebook_extension'>) [source]
verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.ipython. show_traceback ( ) [source]

Display the full traceback after an abbreviated traceback has occurred.


archive Module

Inheritance diagram of holoviews.ipython.archive

Implements NotebookArchive used to automatically capture notebook data and export it to disk via the display hooks.

class holoviews.ipython.archive. NotebookArchive ( **params ) [source]

Bases: holoviews.core.io.FileArchive

FileArchive that can automatically capture notebook data via the display hooks and automatically adds a notebook HTML snapshot to the archive upon export.

param List exporters ( allow_None=False, bounds=(0, None), constant=False, default=[<class ‘holoviews.core.io.Pickler’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The exporter functions used to convert HoloViews objects into the appropriate format(s).
param String dimension_formatter ( allow_None=False, basestring=<class ‘str’>, constant=False, default={name}_{range}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
A string formatter for the output file based on the supplied HoloViews objects dimension names and values. Valid fields are the {name}, {range} and {unit} of the dimensions.
param Callable object_formatter ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Callable that given an object returns a string suitable for inclusion in file and directory names. This is what generates the value used in the {obj} field of the filename formatter.
param String filename_formatter ( allow_None=False, basestring=<class ‘str’>, constant=False, default={dimensions},{obj}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Similar to FileArchive.filename_formatter except with support for the notebook name field as {notebook}.
param String timestamp_format ( allow_None=False, basestring=<class ‘str’>, constant=False, default=%Y_%m_%d-%H_%M_%S, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The timestamp format that will be substituted for the {timestamp} field in the export name.
param String root ( allow_None=False, basestring=<class ‘str’>, constant=False, default=., instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The root directory in which the output directory is located. May be an absolute or relative path.
param ObjectSelector archive_format ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=zip, instantiate=False, names=None, objects=[‘zip’, ‘tar’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The archive format to use if there are multiple files and pack is set to True. Supported formats include ‘zip’ and ‘tar’.
param Boolean pack ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether or not to pack to contents into the specified archive format. If pack is False, the contents will be output to a directory. Note that if there is only a single file in the archive, no packing will occur and no directory is created. Instead, the file is treated as a single-file archive.
param String export_name ( allow_None=False, basestring=<class ‘str’>, constant=False, default={notebook}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Similar to FileArchive.filename_formatter except with support for the notebook name field as {notebook}.
param Boolean unique_name ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether the export name should be made unique with a numeric suffix. If set to False, any existing export of the same name will be removed and replaced.
param Integer max_filename ( allow_None=False, bounds=(0, None), constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Maximum length to enforce on generated filenames. 100 is the practical maximum for zip and tar file generation, but you may wish to use a lower value to avoid long filenames.
param Boolean flush_archive ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Flushed the contents of the archive after export.
param Boolean skip_notebook_export ( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Whether to skip JavaScript capture of notebook data which may be unreliable. Also disabled automatic capture of notebook name.
param String snapshot_name ( allow_None=False, basestring=<class ‘str’>, constant=False, default=index, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The basename of the exported notebook snapshot (html). It may optionally use the {timestamp} formatter.
add ( obj=None , filename=None , data=None , info={} , html=None ) [source]

Similar to FileArchive.add but accepts html strings for substitution

auto ( enabled=Boolean , name=String , exporters=List , dimension_formatter=String , object_formatter=Callable , filename_formatter=String , timestamp_format=String , root=String , archive_format=ObjectSelector , pack=Boolean , export_name=String , unique_name=Boolean , max_filename=Integer , flush_archive=Boolean , skip_notebook_export=Boolean , snapshot_name=String ) [source]
contents ( maxlen=70 )

Print the current (unexported) contents of the archive

debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

export ( timestamp=None ) [source]

Get the current notebook data and export.

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.archive.NotebookArchive'>)
get_namespace ( ) [source]

Find the name the user is using to access holoviews.

get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.archive.NotebookArchive'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.archive.NotebookArchive'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.archive.NotebookArchive'>)
last_export_status ( ) [source]

Helper to show the status of the last call to the export method.

listing ( )

Return a list of filename entries currently in the archive

message ( *args , **kwargs )

Inspect .param.message method for the full docstring

object_formatter ( obj )

Simple name_generator designed for HoloViews objects.

Objects are labeled with {group}-{label} for each nested object, based on a depth-first search. Adjacent objects with identical representations yield only a single copy of the representation, to avoid long names for the common case of a container whose element(s) share the same group and label.

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

parse_fields ( formatter )

Returns the format fields otherwise raise exception

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

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

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.archive.NotebookArchive'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.archive.NotebookArchive'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

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

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

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

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring


display_hooks Module

Definition and registration of display hooks for the IPython Notebook.

holoviews.ipython.display_hooks. display ( obj , raw_output=False , **kwargs ) [source]

Renders any HoloViews object to HTML and displays it using the IPython display function. If raw is enabled the raw HTML is returned instead of displaying it directly.

holoviews.ipython.display_hooks. display_hook ( fn ) [source]

A decorator to wrap display hooks that return a MIME bundle or None. Additionally it handles adding output to the notebook archive, saves files specified with the output magic and handles tracebacks.

holoviews.ipython.display_hooks. first_frame ( obj ) [source]

Only display the first frame of an animated plot

holoviews.ipython.display_hooks. image_display ( element , max_frames , fmt ) [source]

Used to render elements to an image format (svg or png) if requested in the display formats.

holoviews.ipython.display_hooks. last_frame ( obj ) [source]

Only display the last frame of an animated plot

holoviews.ipython.display_hooks. middle_frame ( obj ) [source]

Only display the (approximately) middle frame of an animated plot

holoviews.ipython.display_hooks. png_display ( element , max_frames ) [source]

Used to render elements to PNG if requested in the display formats.

holoviews.ipython.display_hooks. process_object ( obj ) [source]

Hook to process the object currently being displayed.

holoviews.ipython.display_hooks. single_frame_plot ( obj ) [source]

Returns plot, renderer and format for single frame export.

holoviews.ipython.display_hooks. svg_display ( element , max_frames ) [source]

Used to render elements to SVG if requested in the display formats.


magics Module

Inheritance diagram of holoviews.ipython.magics
class holoviews.ipython.magics. CompositorMagic ( *args , **kwargs ) [source]

Bases: IPython.core.magic.Magics

Magic allowing easy definition of compositor operations. Consult %compositor? for more information.

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

arg_err ( func )

Print docstring if incorrect arguments were passed

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

default_option ( fn , optstr )

Make an entry in the options_table for fn, with value optstr

format_latex ( strng )

Format a string for latex inclusion.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
parse_options ( arg_str , opt_str , *long_opts , **kw )

Parse options passed to an argument string.

The interface is similar to that of getopt.getopt() , but it returns a Struct with the options as keys and the stripped argument string still as a string.

arg_str is quoted as a true sys.argv vector by using shlex.split. This allows us to easily expand variables, glob files, quote arguments, etc.

arg_str : str
The arguments to parse.
opt_str : str
The options specification.
mode : str, default ‘string’
If given as ‘list’, the argument string is returned as a list (split on whitespace) instead of a string.
list_all : bool, default False
Put all option values in lists. Normally only options appearing more than once are put in a list.
posix : bool, default True
Whether to split the input line in POSIX mode or not, as per the conventions outlined in the shlex module from the standard library.
section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values

class holoviews.ipython.magics. OptsCompleter [source]

Bases: object

Implements the TAB-completion for the %%opts magic.

classmethod dotted_completion ( line , sorted_keys , compositor_defs ) [source]

Supply the appropriate key in Store.options and supply suggestions for further completion.

classmethod option_completer ( k , v ) [source]

Tab completion hook for the %%opts cell magic.

classmethod setup_completer ( ) [source]

Get the dictionary of valid completions

class holoviews.ipython.magics. OptsMagic ( shell=None , **kwargs ) [source]

Bases: IPython.core.magic.Magics

Magic for easy customising of normalization, plot and style options. Consult %%opts? for more information.

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

arg_err ( func )

Print docstring if incorrect arguments were passed

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

default_option ( fn , optstr )

Make an entry in the options_table for fn, with value optstr

format_latex ( strng )

Format a string for latex inclusion.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
opts ( line='' , cell=None ) [source]

The opts line/cell magic with tab-completion.

%%opts [ [path] [normalization] [plotting options] [style options]]+

path: A dotted type.group.label specification
(e.g. Image.Grayscale.Photo)
normalization: List of normalization options delimited by braces.
One of | -axiswise | -framewise | +axiswise | +framewise | E.g. { +axiswise +framewise }
plotting options: List of plotting option keywords delimited by
square brackets. E.g. [show_title=False]
style options: List of style option keywords delimited by
parentheses. E.g. (lw=10 marker=’+’)

Note that commas between keywords are optional (not recommended) and that keywords must end in ‘=’ without a separating space.

More information may be found in the class docstring of util.parser.OptsSpec.

parse_options ( arg_str , opt_str , *long_opts , **kw )

Parse options passed to an argument string.

The interface is similar to that of getopt.getopt() , but it returns a Struct with the options as keys and the stripped argument string still as a string.

arg_str is quoted as a true sys.argv vector by using shlex.split. This allows us to easily expand variables, glob files, quote arguments, etc.

arg_str : str
The arguments to parse.
opt_str : str
The options specification.
mode : str, default ‘string’
If given as ‘list’, the argument string is returned as a list (split on whitespace) instead of a string.
list_all : bool, default False
Put all option values in lists. Normally only options appearing more than once are put in a list.
posix : bool, default True
Whether to split the input line in POSIX mode or not, as per the conventions outlined in the shlex module from the standard library.
classmethod process_element ( obj ) [source]

To be called by the display hook which supplies the element to be displayed. Any customisation of the object can then occur before final display. If there is any error, a HTML message may be returned. If None is returned, display will proceed as normal.

section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values

class holoviews.ipython.magics. TimerMagic ( shell=None , **kwargs ) [source]

Bases: IPython.core.magic.Magics

A line magic for measuring the execution time of multiple cells.

After you start/reset the timer with ‘%timer start’ you may view elapsed time with any subsequent calls to %timer.

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

arg_err ( func )

Print docstring if incorrect arguments were passed

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

default_option ( fn , optstr )

Make an entry in the options_table for fn, with value optstr

format_latex ( strng )

Format a string for latex inclusion.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
parse_options ( arg_str , opt_str , *long_opts , **kw )

Parse options passed to an argument string.

The interface is similar to that of getopt.getopt() , but it returns a Struct with the options as keys and the stripped argument string still as a string.

arg_str is quoted as a true sys.argv vector by using shlex.split. This allows us to easily expand variables, glob files, quote arguments, etc.

arg_str : str
The arguments to parse.
opt_str : str
The options specification.
mode : str, default ‘string’
If given as ‘list’, the argument string is returned as a list (split on whitespace) instead of a string.
list_all : bool, default False
Put all option values in lists. Normally only options appearing more than once are put in a list.
posix : bool, default True
Whether to split the input line in POSIX mode or not, as per the conventions outlined in the shlex module from the standard library.
section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

timer ( line='' ) [source]

Timer magic to print initial date/time information and subsequent elapsed time intervals.

To start the timer, run:

%timer start

This will print the start date and time.

Subsequent calls to %timer will print the elapsed time relative to the time when %timer start was called. Subsequent calls to %timer start may also be used to reset the timer.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values


preprocessors Module

Inheritance diagram of holoviews.ipython.preprocessors

Prototype demo:

python holoviews/ipython/convert.py Conversion_Example.ipynb | python

class holoviews.ipython.preprocessors. OptsMagicProcessor ( **kw ) [source]

Bases: nbconvert.preprocessors.base.Preprocessor

Preprocessor to convert notebooks to Python source to convert use of opts magic to use the util.opts utility instead.

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
preprocess ( nb , resources )

Preprocessing to apply on each notebook.

Must return modified nb, resources.

If you wish to apply your preprocessing to each cell, you might want to override preprocess_cell method instead.

nb : NotebookNode
Notebook being converted
resources : dictionary
Additional resources used in the conversion process. Allows preprocessors to pass variables into the Jinja engine.
section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values

class holoviews.ipython.preprocessors. OutputMagicProcessor ( **kw ) [source]

Bases: nbconvert.preprocessors.base.Preprocessor

Preprocessor to convert notebooks to Python source to convert use of output magic to use the util.output utility instead.

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
preprocess ( nb , resources )

Preprocessing to apply on each notebook.

Must return modified nb, resources.

If you wish to apply your preprocessing to each cell, you might want to override preprocess_cell method instead.

nb : NotebookNode
Notebook being converted
resources : dictionary
Additional resources used in the conversion process. Allows preprocessors to pass variables into the Jinja engine.
section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values

class holoviews.ipython.preprocessors. StripMagicsProcessor ( **kw ) [source]

Bases: nbconvert.preprocessors.base.Preprocessor

Preprocessor to convert notebooks to Python source to strips out all magics. To be applied after the preprocessors that can handle holoviews magics appropriately.

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
preprocess ( nb , resources )

Preprocessing to apply on each notebook.

Must return modified nb, resources.

If you wish to apply your preprocessing to each cell, you might want to override preprocess_cell method instead.

nb : NotebookNode
Notebook being converted
resources : dictionary
Additional resources used in the conversion process. Allows preprocessors to pass variables into the Jinja engine.
section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values

class holoviews.ipython.preprocessors. Substitute ( version , substitutions , **kw ) [source]

Bases: nbconvert.preprocessors.base.Preprocessor

An nbconvert preprocessor that substitutes one set of HTML data output for another, adding annotation to the output as required.

The constructor accepts the notebook format version and a substitutions dictionary:

{source_html:(target_html, annotation)}

Where the annotation may be None (i.e. no annotation).

add_traits ( **traits )

Dynamically add trait attributes to the HasTraits instance.

class_config_rst_doc ( )

Generate rST documentation for this class’ config options.

Excludes traits defined on parent classes.

class_config_section ( )

Get the config class config section

class_get_help ( inst=None )

Get the help string for this class in ReST format.

If inst is given, it’s current trait values will be used in place of class defaults.

class_get_trait_help ( trait , inst=None )

Get the help string for a single trait.

If inst is given, it’s current trait values will be used in place of the class default.

class_own_trait_events ( name )

Get a dict of all event handlers defined on this class, not a parent.

Works like event_handlers , except for excluding traits from parents.

class_own_traits ( **metadata )

Get a dict of all the traitlets defined on this class, not a parent.

Works like class_traits , except for excluding traits from parents.

class_print_help ( inst=None )

Get the help string for a single trait and print it.

class_trait_names ( **metadata )

Get a list of all the names of this class’ traits.

This method is just like the trait_names() method, but is unbound.

class_traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

This method is just like the traits() method, but is unbound.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

At the end of the block, the lock’s value is restored to its value prior to entering the block.

has_trait ( name )

Returns True if the object has a trait with the specified name.

hold_trait_notifications ( )

Context manager for bundling trait change notifications and cross validation.

Use this when doing multiple trait assignments (init, config), to avoid race conditions in trait notifiers requesting other trait values. All trait notifications will fire after all values have been assigned.

observe ( handler , names=traitlets.All , type='change' )

Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

handler : callable
A callable that is called when a trait changes. Its signature should be handler(change) , where change is a dictionary. The change dictionary at least holds a ‘type’ key. * type : the type of notification. Other keys may be passed depending on the value of ‘type’. In the case where type is ‘change’, we also have the following keys: * owner : the HasTraits instance * old : the old value of the modified trait attribute * new : the new value of the modified trait attribute * name : the name of the modified trait attribute.
names : list, str, All
If names is All, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
type : str, All (default: ‘change’)
The type of notification to filter by. If equal to All, then all notifications are passed to the observe handler.
on_trait_change ( handler=None , name=None , remove=False )

DEPRECATED: Setup a handler to be called when a trait changes.

This is used to setup dynamic notifications of trait changes.

Static handlers can be created by creating methods on a HasTraits subclass with the naming convention ‘_[traitname]_changed’. Thus, to create static handler for the trait ‘a’, create the method _a_changed(self, name, old, new) (fewer arguments can be used, see below).

If remove is True and handler is not specified, all change handlers for the specified name are uninstalled.

handler : callable, None
A callable that is called when a trait changes. Its signature can be handler(), handler(name), handler(name, new), handler(name, old, new), or handler(name, old, new, self).
name : list, str, None
If None, the handler will apply to all traits. If a list of str, handler will apply to all names in the list. If a str, the handler will apply just to that name.
remove : bool
If False (the default), then install the handler. If True then unintall it.
preprocess ( nb , resources )

Preprocessing to apply on each notebook.

Must return modified nb, resources.

If you wish to apply your preprocessing to each cell, you might want to override preprocess_cell method instead.

nb : NotebookNode
Notebook being converted
resources : dictionary
Additional resources used in the conversion process. Allows preprocessors to pass variables into the Jinja engine.
replace ( src ) [source]

Given some source html substitute and annotated as applicable

section_names ( )

return section names as a list

set_trait ( name , value )

Forcibly sets trait attribute, including read-only attributes.

trait_events ( name=None )

Get a dict of all the event handlers of this class.

name: str (default: None)
The name of a trait of this class. If name is None then all the event handlers of this class will be returned instead.

The event handlers associated with a trait name, or all event handlers.

trait_metadata ( traitname , key , default=None )

Get metadata values for trait by key.

trait_names ( **metadata )

Get a list of all the names of this class’ traits.

traits ( **metadata )

Get a dict of all the traits of this class. The dictionary is keyed on the name and the values are the TraitType objects.

The TraitTypes returned don’t know anything about the values that the various HasTrait’s instances are holding.

The metadata kwargs allow functions to be passed in which filter traits based on metadata values. The functions should take a single value as an argument and return a boolean. If any function returns False, then the trait is not included in the output. If a metadata key doesn’t exist, None will be passed to the function.

unobserve ( handler , names=traitlets.All , type='change' )

Remove a trait change handler.

This is used to unregister handlers to trait change notifications.

handler : callable
The callable called when a trait attribute changes.
names : list, str, All (default: All)
The names of the traits for which the specified handler should be uninstalled. If names is All, the specified handler is uninstalled from the list of notifiers corresponding to all changes.
type : str or All (default: ‘change’)
The type of notification to filter by. If All, the specified handler is uninstalled from the list of notifiers corresponding to all types.
unobserve_all ( name=traitlets.All )

Remove trait change handlers of any type for the specified name. If name is not specified, removes all trait notifiers.

update_config ( config )

Update config and load the new values

holoviews.ipython.preprocessors. comment_out_magics ( source ) [source]

Utility used to make sure AST parser does not choke on unrecognized magics.

holoviews.ipython.preprocessors. filter_magic ( source , magic , strip=True ) [source]

Given the source of a cell, filter out the given magic and collect the lines using the magic into a list.

If strip is True, the IPython syntax part of the magic (e.g %magic or %%magic) is stripped from the returned lines.

holoviews.ipython.preprocessors. replace_line_magic ( source , magic , template='{line}' ) [source]

Given a cell’s source, replace line magics using a formatting template, where {line} is the string that follows the magic.

holoviews.ipython.preprocessors. strip_magics ( source ) [source]

Given the source of a cell, filter out all cell and line magics.

holoviews.ipython.preprocessors. wrap_cell_expression ( source , template='{expr}' ) [source]

If a cell ends in an expression that could be displaying a HoloViews object (as determined using the AST), wrap it with a given prefix and suffix string.

If the cell doesn’t end in an expression, return the source unchanged.


widgets Module

Inheritance diagram of holoviews.ipython.widgets
class holoviews.ipython.widgets. ProgressBar ( **params ) [source]

Bases: holoviews.core.util.ProgressIndicator

A simple text progress bar suitable for both the IPython notebook and the IPython interactive prompt.

ProgressBars are automatically nested if a previous instantiated progress bars has not achieved 100% completion.

param NumericTuple percent_range ( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
param String label ( allow_None=True, basestring=<class ‘str’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The label of the current progress bar.
param ObjectSelector display ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=stdout, instantiate=False, names=None, objects=[‘stdout’, ‘disabled’, ‘broadcast’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Parameter to control display of the progress bar. By default, progress is shown on stdout but this may be disabled e.g. for jobs that log standard output to file. If the output mode is set to ‘broadcast’, a socket is opened on a stated port to broadcast the completion percentage. The RemoteProgress class may then be used to view the progress from a different process.
param Integer width ( allow_None=False, bounds=None, constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the progress bar as the number of characters
param String fill_char ( allow_None=False, basestring=<class ‘str’>, constant=False, default=#, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The character used to fill the progress bar.
param String blank_char ( allow_None=False, basestring=<class ‘str’>, constant=False, default= , instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The character for the blank portion of the progress bar.
param Boolean elapsed_time ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If enabled, the progress bar will disappear and display the total elapsed time once 100% completion is reached.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.ProgressBar'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.ProgressBar'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.ProgressBar'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.ProgressBar'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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

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

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.ProgressBar'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.ProgressBar'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

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

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

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

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.ipython.widgets. RemoteProgress ( port , **params ) [source]

Bases: holoviews.ipython.widgets.ProgressBar

Connect to a progress bar in a separate process with output_mode set to ‘broadcast’ in order to display the results (to stdout).

param NumericTuple percent_range ( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
param String label ( allow_None=True, basestring=<class ‘str’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The label of the current progress bar.
param ObjectSelector display ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=stdout, instantiate=False, names=None, objects=[‘stdout’, ‘disabled’, ‘broadcast’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Parameter to control display of the progress bar. By default, progress is shown on stdout but this may be disabled e.g. for jobs that log standard output to file. If the output mode is set to ‘broadcast’, a socket is opened on a stated port to broadcast the completion percentage. The RemoteProgress class may then be used to view the progress from a different process.
param Integer width ( allow_None=False, bounds=None, constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the progress bar as the number of characters
param String fill_char ( allow_None=False, basestring=<class ‘str’>, constant=False, default=#, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The character used to fill the progress bar.
param String blank_char ( allow_None=False, basestring=<class ‘str’>, constant=False, default= , instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The character for the blank portion of the progress bar.
param Boolean elapsed_time ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If enabled, the progress bar will disappear and display the total elapsed time once 100% completion is reached.
param String hostname ( allow_None=False, basestring=<class ‘str’>, constant=False, default=localhost, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
Hostname where progress is being broadcast.
param Integer port ( allow_None=False, bounds=None, constant=False, default=8080, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
Target port on hostname.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RemoteProgress'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RemoteProgress'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RemoteProgress'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RemoteProgress'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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

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

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RemoteProgress'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RemoteProgress'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

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

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

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

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

class holoviews.ipython.widgets. RunProgress ( **params ) [source]

Bases: holoviews.ipython.widgets.ProgressBar

RunProgress breaks up the execution of a slow running command so that the level of completion can be displayed during execution.

This class is designed to run commands that take a single numeric argument that acts additively. Namely, it is expected that a slow running command ‘run_hook(X+Y)’ can be arbitrarily broken up into multiple, faster executing calls ‘run_hook(X)’ and ‘run_hook(Y)’ without affecting the overall result.

For instance, this is suitable for simulations where the numeric argument is the simulated time - typically, advancing 10 simulated seconds takes about twice as long as advancing by 5 seconds.

param NumericTuple percent_range ( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
param String label ( allow_None=True, basestring=<class ‘str’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The label of the current progress bar.
param ObjectSelector display ( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=stdout, instantiate=False, names=None, objects=[‘stdout’, ‘disabled’, ‘broadcast’], pickle_default_value=True, precedence=None, readonly=False, watchers={} )
Parameter to control display of the progress bar. By default, progress is shown on stdout but this may be disabled e.g. for jobs that log standard output to file. If the output mode is set to ‘broadcast’, a socket is opened on a stated port to broadcast the completion percentage. The RemoteProgress class may then be used to view the progress from a different process.
param Integer width ( allow_None=False, bounds=None, constant=False, default=70, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The width of the progress bar as the number of characters
param String fill_char ( allow_None=False, basestring=<class ‘str’>, constant=False, default=#, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The character used to fill the progress bar.
param String blank_char ( allow_None=False, basestring=<class ‘str’>, constant=False, default= , instantiate=False, pickle_default_value=True, precedence=None, readonly=False, regex=None, watchers={} )
The character for the blank portion of the progress bar.
param Boolean elapsed_time ( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
If enabled, the progress bar will disappear and display the total elapsed time once 100% completion is reached.
param Number interval ( allow_None=False, bounds=None, constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001>, watchers={} )
The run interval used to break up updates to the progress bar.
param Callable run_hook ( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False, watchers={} )
By default updates time in param which is very fast and does not need a progress bar. Should be set to some slower running callable where display of progress level is desired.
debug ( *args , **kwargs )

Inspect .param.debug method for the full docstring

defaults ( *args , **kwargs )

Inspect .param.defaults method for the full docstring

force_new_dynamic_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RunProgress'>)
get_param_values = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RunProgress'>)
get_value_generator = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RunProgress'>)
inspect_value = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RunProgress'>)
message ( *args , **kwargs )

Inspect .param.message method for the full docstring

params ( *args , **kwargs )

Inspect .param.params method for the full docstring

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

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

print_param_defaults ( *args , **kwargs )

Inspect .param.print_param_defaults method for the full docstring

print_param_values ( *args , **kwargs )

Inspect .param.print_param_values method for the full docstring

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

Variant of __repr__ designed for generating a runnable script.

set_default ( *args , **kwargs )

Inspect .param.set_default method for the full docstring

set_dynamic_time_fn = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RunProgress'>)
set_param = functools.partial(<function Parameters.deprecate.<locals>.inner>, <class 'holoviews.ipython.widgets.RunProgress'>)
state_pop ( )

Restore the most recently saved state.

See state_push() for more details.

state_push ( )

Save this instance’s state.

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

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

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

verbose ( *args , **kwargs )

Inspect .param.verbose method for the full docstring

warning ( *args , **kwargs )

Inspect .param.warning method for the full docstring

holoviews.ipython.widgets. progress ( iterator , enum=False , length=None ) [source]

A helper utility to display a progress bar when iterating over a collection of a fixed length or a generator (with a declared length).

If enum=True, then equivalent to enumerate with a progress bar.