holoviews.ipython Package ¶
ipython
Package
¶
-
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 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 signficant digit).
If the two objects compare equal then they will automatically compare almost equal.
-
assertAlmostEquals
( 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 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 signficant digit).
If the two objects compare equal then they will automatically compare almost equal.
-
assertDictContainsSubset
( expected , actual , msg=None ) ¶ -
Checks whether actual is a superset of expected.
-
assertEqual
( first , second , msg=None ) ¶ -
Classmethod equivalent to unittest.TestCase method
-
assertEquals
( first , second , msg=None ) ¶ -
Fail if the two objects are unequal as determined by the ‘==’ operator.
-
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.
-
assertItemsEqual
( expected_seq , actual_seq , msg=None ) ¶ -
An unordered sequence specific comparison. It asserts that actual_seq and expected_seq have the same element counts. Equivalent to:
self.assertEqual(Counter(iter(actual_seq)), Counter(iter(expected_seq)))
Asserts that each element has the same count in both sequences. Example:
- [0, 1, 1] and [1, 0, 1] compare equal.
- [0, 0, 1] and [0, 1] compare unequal.
-
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.
-
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 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 signficant digit).
Objects that are equal automatically fail.
-
assertNotAlmostEquals
( 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 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 signficant digit).
Objects that are equal automatically fail.
-
assertNotEqual
( first , second , msg=None ) ¶ -
Fail if the two objects are equal as determined by the ‘!=’ operator.
-
assertNotEquals
( 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.
-
assertNotRegexpMatches
( text , unexpected_regexp , msg=None ) ¶ -
Fail the test if the text matches the regular expression.
-
assertRaises
( excClass , callableObj=None , *args , **kwargs ) ¶ -
Fail unless an exception of class excClass is raised by callableObj when invoked with arguments args and keyword arguments kwargs. 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 callableObj omitted or None, will return a context object used like this:
with self.assertRaises(SomeException): do_something()
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)
-
assertRaisesRegexp
( expected_exception , expected_regexp , callable_obj=None , *args , **kwargs ) ¶ -
Asserts that the message in a raised exception matches a regexp.
- Args:
-
expected_exception: Exception class expected to be raised. expected_regexp: Regexp (re pattern object or string) expected
to be found in error message.callable_obj: Function to be called. args: Extra args. kwargs: Extra kwargs.
-
assertRegexpMatches
( text , expected_regexp , 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.
-
assert_
( expr , msg=None ) ¶ -
Check that the expression is true.
-
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
AssertionError
-
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.
-
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, display_formats=List, name=String, case_sensitive_completion=Boolean, width=Number, inline=Boolean, logo=Boolean, css=String)
-
param List
display_formats
( allow_None=False, bounds=(0, None), constant=False, default=[‘html’], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - 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=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Whether to monkey patch IPython to use the correct tab-completion behavior.
-
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> ) - Width of the notebook as a percentage of the browser screen window width.
-
param Boolean
inline
( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Whether to inline JS and CSS resources, if disabled resources are loaded from CDN if one is available.
-
param Boolean
logo
( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Toggles display of HoloViews logo
-
param String
css
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Optional CSS rule set to apply to the notebook.
-
classmethod
completions_sorting_key
( word ) [source] ¶ -
Fixed version of IPyton.completer.completions_sorting_key
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= <functools.partial object> ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= <functools.partial object> ¶
-
inspect_value
= <functools.partial object> ¶
-
instance
= <functools.partial object> ¶
-
classmethod
load_hvjs
( logo=False , JS=True , message='HoloViewsJS successfully loaded.' ) [source] ¶ -
Displays javascript and CSS to initialize HoloViews widgets.
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix='\n ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
Same as Parameterized.pprint, except that X.classname(Y is replaced with X.classname.instance(Y
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Same as Parameterized.script_repr, except that X.classname(Y is replaced with X.classname.instance(Y
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= <functools.partial object> ¶
-
set_param
= <functools.partial object> ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param List
archive
Module
¶
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 Boolean
unique_name
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Whether the export name should be made unique with a numeric suffix. If set to False, any existing export of the same name will be removed and replaced.
-
param Boolean
skip_notebook_export
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Whether to skip JavaScript capture of notebook data which may be unreliable. Also disabled automatic capture of notebook name.
-
param Integer
max_filename
( allow_None=False, bounds=(0, None), constant=False, default=100, inclusive_bounds=(True, True), instantiate=False, pickle_default_value=True, precedence=None, readonly=False, softbounds=None, time_dependent=False, time_fn=<Time Time00001> ) - Maximum length to enforce on generated filenames. 100 is the practical maximum for zip and tar file generation, but you may wish to use a lower value to avoid long filenames.
-
param String
root
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=., instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The root directory in which the output directory is located. May be an absolute or relative path.
-
param String
filename_formatter
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default={dimensions},{obj}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Similar to FileArchive.filename_formatter except with support for the notebook name field as {notebook}.
-
param String
export_name
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default={notebook}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Similar to FileArchive.filename_formatter except with support for the notebook name field as {notebook}.
-
param String
snapshot_name
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=index, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The basename of the exported notebook snapshot (html). It may optionally use the {timestamp} formatter.
-
param String
dimension_formatter
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default={name}_{range}, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - A string formatter for the output file based on the supplied HoloViews objects dimension names and values. Valid fields are the {name}, {range} and {unit} of the dimensions.
-
param ObjectSelector
archive_format
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=zip, instantiate=False, objects=[‘zip’, ‘tar’], pickle_default_value=True, precedence=None, readonly=False ) - The archive format to use if there are multiple files and pack is set to True. Supported formats include ‘zip’ and ‘tar’.
-
param List
exporters
( allow_None=False, bounds=(0, None), constant=False, default=[<class ‘holoviews.core.io.Pickler’>], instantiate=True, pickle_default_value=True, precedence=None, readonly=False ) - The exporter functions used to convert HoloViews objects into the appropriate format(s).
-
param Boolean
flush_archive
( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Flushed the contents of the archive after export.
-
param Callable
object_formatter
( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Callable that given an object returns a string suitable for inclusion in file and directory names. This is what generates the value used in the {obj} field of the filename formatter.
-
param String
timestamp_format
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=%Y_%m_%d-%H_%M_%S, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The timestamp format that will be substituted for the {timestamp} field in the export name.
-
param Boolean
pack
( allow_None=False, bounds=(0, 1), constant=False, default=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Whether or not to pack to contents into the specified archive format. If pack is False, the contents will be output to a directory. Note that if there is only a single file in the archive, no packing will occur and no directory is created. Instead, the file is treated as a single-file archive.
-
add
( obj=None , filename=None , data=None , info={} , html=None ) [source] ¶ -
Similar to FileArchive.add but accepts html strings for substitution
-
auto
( enabled=Boolean , unique_name=Boolean , skip_notebook_export=Boolean , name=String , max_filename=Integer , root=String , filename_formatter=String , export_name=String , snapshot_name=String , dimension_formatter=String , archive_format=ObjectSelector , exporters=List , flush_archive=Boolean , object_formatter=Callable , timestamp_format=String , pack=Boolean ) [source] ¶
-
contents
( maxlen=70 ) ¶ -
Print the current (unexported) contents of the archive
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= <functools.partial object> ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= <functools.partial object> ¶
-
inspect_value
= <functools.partial object> ¶
-
listing
( ) ¶ -
Return a list of filename entries currently in the archive
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
object_formatter
( obj ) ¶ -
Simple name_generator designed for HoloViews objects.
Objects are labeled with {group}-{label} for each nested object, based on a depth-first search. Adjacent objects with identical representations yield only a single copy of the representation, to avoid long names for the common case of a container whose element(s) share the same group and label.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
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
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= <functools.partial object> ¶
-
set_param
= <functools.partial object> ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Boolean
display_hooks
Module
¶
Definition and registration of display hooks for the IPython Notebook.
-
holoviews.ipython.display_hooks.
display
( obj , raw=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.
element_png_display
( element ) [source] ¶ -
Used to render elements to PNG if requested in the display formats.
-
holoviews.ipython.display_hooks.
element_svg_display
( element ) [source] ¶ -
Used to render elements to SVG if requested in the display formats.
-
holoviews.ipython.display_hooks.
first_frame
( obj ) [source] ¶ -
Only display the first frame of an animated plot
-
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
magics
Module
¶
-
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
( *args , **kwds ) ¶ -
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)
, wherechange
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 aStruct
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.
-
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
( *args , **kwds ) ¶ -
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)
, wherechange
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 aStruct
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
( *args , **kwds ) ¶ -
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)
, wherechange
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 aStruct
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
¶
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
( *args , **kwds ) ¶ -
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)
, wherechange
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
( *args , **kwds ) ¶ -
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)
, wherechange
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
( *args , **kwds ) ¶ -
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)
, wherechange
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
( *args , **kwds ) ¶ -
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)
, wherechange
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
-
-
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
¶
-
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 Boolean
elapsed_time
( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - If enabled, the progress bar will disappear and display the total elapsed time once 100% completion is reached.
-
param String
label
( allow_None=True, basestring=<type ‘basestring’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The label of the current progress bar.
-
param NumericTuple
percent_range
( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False ) - The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
-
param 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> ) - The width of the progress bar as the number of chararacters
-
param String
fill_char
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=#, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The character used to fill the progress bar.
-
param String
blank_char
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default= , instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The character for the blank portion of the progress bar.
-
param ObjectSelector
display
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=stdout, instantiate=False, objects=[‘stdout’, ‘disabled’, ‘broadcast’], pickle_default_value=True, precedence=None, readonly=False ) - 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.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= <functools.partial object> ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= <functools.partial object> ¶
-
inspect_value
= <functools.partial object> ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= <functools.partial object> ¶
-
set_param
= <functools.partial object> ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Boolean
-
class
holoviews.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 Boolean
elapsed_time
( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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=<type ‘basestring’>, constant=False, default=localhost, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - Hostname where progress is being broadcast.
-
param String
label
( allow_None=True, basestring=<type ‘basestring’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The label of the current progress bar.
-
param NumericTuple
percent_range
( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False ) - The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
-
param 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> ) - The width of the progress bar as the number of chararacters
-
param String
fill_char
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=#, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The character used to fill the progress bar.
-
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> ) - Target port on hostname.
-
param String
blank_char
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default= , instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The character for the blank portion of the progress bar.
-
param ObjectSelector
display
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=stdout, instantiate=False, objects=[‘stdout’, ‘disabled’, ‘broadcast’], pickle_default_value=True, precedence=None, readonly=False ) - 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.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= <functools.partial object> ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= <functools.partial object> ¶
-
inspect_value
= <functools.partial object> ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= <functools.partial object> ¶
-
set_param
= <functools.partial object> ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Boolean
-
class
holoviews.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 Boolean
elapsed_time
( allow_None=False, bounds=(0, 1), constant=False, default=True, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - If enabled, the progress bar will disappear and display the total elapsed time once 100% completion is reached.
-
param Callable
run_hook
( allow_None=False, constant=False, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - 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.
-
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> ) - The run interval used to break up updates to the progress bar.
-
param String
label
( allow_None=True, basestring=<type ‘basestring’>, constant=False, default=Progress, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The label of the current progress bar.
-
param NumericTuple
percent_range
( allow_None=False, constant=False, default=(0.0, 100.0), instantiate=False, length=2, pickle_default_value=True, precedence=None, readonly=False ) - The total percentage spanned by the progress bar when called with a value between 0% and 100%. This allows an overall completion in percent to be broken down into smaller sub-tasks that individually complete to 100 percent.
-
param 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> ) - The width of the progress bar as the number of chararacters
-
param String
fill_char
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default=#, instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The character used to fill the progress bar.
-
param String
blank_char
( allow_None=False, basestring=<type ‘basestring’>, constant=False, default= , instantiate=False, pickle_default_value=True, precedence=None, readonly=False ) - The character for the blank portion of the progress bar.
-
param ObjectSelector
display
( allow_None=None, check_on_set=True, compute_default_fn=None, constant=False, default=stdout, instantiate=False, objects=[‘stdout’, ‘disabled’, ‘broadcast’], pickle_default_value=True, precedence=None, readonly=False ) - 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.
-
debug
( msg , *args , **kw ) ¶ -
Print msg merged with args as a debugging statement.
See Python’s logging module for details of message formatting.
-
defaults
( ) ¶ -
Return {parameter_name:parameter.default} for all non-constant Parameters.
Note that a Parameter for which instantiate==True has its default instantiated.
-
force_new_dynamic_value
= <functools.partial object> ¶
-
get_param_values
( onlychanged=False ) ¶ -
Return a list of name,value pairs for all Parameters of this object.
If onlychanged is True, will only return values that are not equal to the default value.
-
get_value_generator
= <functools.partial object> ¶
-
inspect_value
= <functools.partial object> ¶
-
message
( msg , *args , **kw ) ¶ -
Print msg merged with args as a message.
See Python’s logging module for details of message formatting.
-
params
( parameter_name=None ) ¶ -
Return the Parameters of this class as the dictionary {name: parameter_object}
Includes Parameters from this class and its superclasses.
-
pprint
( imports=None , prefix=' ' , unknown_value='<?>' , qualify=False , separator='' ) ¶ -
(Experimental) Pretty printed representation that may be evaluated with eval. See pprint() function for more details.
-
print_param_defaults
( ) ¶ -
Print the default values of all cls’s Parameters.
-
print_param_values
( ) ¶ -
Print the values of all this object’s Parameters.
-
script_repr
( imports=[] , prefix=' ' ) ¶ -
Variant of __repr__ designed for generating a runnable script.
-
set_default
( param_name , value ) ¶ -
Set the default value of param_name.
Equivalent to setting param_name on the class.
-
set_dynamic_time_fn
= <functools.partial object> ¶
-
set_param
= <functools.partial object> ¶
-
state_pop
( ) ¶ -
Restore the most recently saved state.
See state_push() for more details.
-
state_push
( ) ¶ -
Save this instance’s state.
For Parameterized instances, this includes the state of dynamically generated values.
Subclasses that maintain short-term state should additionally save and restore that state using state_push() and state_pop().
Generally, this method is used by operations that need to test something without permanently altering the objects’ state.
-
verbose
( msg , *args , **kw ) ¶ -
Print msg merged with args as a verbose message.
See Python’s logging module for details of message formatting.
-
warning
( msg , *args , **kw ) ¶ -
Print msg merged with args as a warning, unless module variable warnings_as_exceptions is True, then raise an Exception containing the arguments.
See Python’s logging module for details of message formatting.
-
param Boolean
-
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.


BlackJack
21
Game Scores
Player
:
0
Dealer:
0
Player
Game Statistics
Wins:
0
Losses:
0
Ties:
0
Deal Cards
Hit
Stand


×
Close
Sign Out
All unsaved changes will be lost!
Are you sure you want to sign out of the application?
Loading...
Exit Fullscreen