pymor.discretizers.builtin.gui.jupyter

This module provides plotting support inside the Jupyter notebook.

To use these routines you first have to execute

%matplotlib notebook

inside the given notebook.

Submodules

Package Contents

Functions

defaults

Function decorator for marking function arguments as user-configurable defaults.

visualize_patch

Visualize scalar data associated to a two-dimensional Grid as a patch plot.

get_visualizer

progress_bar

load_ipython_extension

unload_ipython_extension

Attributes

config

_extension_loaded

pymor.discretizers.builtin.gui.jupyter.defaults(*args)[source]

Function decorator for marking function arguments as user-configurable defaults.

If a function decorated with defaults is called, the values of the marked default parameters are set to the values defined via load_defaults_from_file or set_defaults in case no value has been provided by the caller of the function. Moreover, if None is passed as a value for a default argument, the argument is set to its default value, as well. If no value has been specified using set_defaults or load_defaults_from_file, the default value provided in the function signature is used.

If the argument arg of function f in sub-module m of package p is marked as a default value, its value will be changeable by the aforementioned methods under the path p.m.f.arg.

Note that the defaults decorator can also be used in user code.

Parameters

args

List of strings containing the names of the arguments of the decorated function to mark as pyMOR defaults. Each of these arguments has to be a keyword argument (with a default value).

pymor.discretizers.builtin.gui.jupyter.visualize_patch(grid, U, bounding_box=None, codim=2, title=None, legend=None, separate_colorbars=False, rescale_colorbars=False, columns=2)[source]

Visualize scalar data associated to a two-dimensional Grid as a patch plot.

The grid’s ReferenceElement must be the triangle or square. The data can either be attached to the faces or vertices of the grid.

Parameters

grid

The underlying Grid.

U

VectorArray of the data to visualize. If len(U) > 1, the data is visualized as a time series of plots. Alternatively, a tuple of VectorArrays can be provided, in which case a subplot is created for each entry of the tuple. The lengths of all arrays have to agree.

bounding_box

A bounding box in which the grid is contained (defaults to grid.bounding_box()).

codim

The codimension of the entities the data in U is attached to (either 0 or 2).

title

Title of the plot.

legend

Description of the data that is plotted. Most useful if U is a tuple in which case legend has to be a tuple of strings of the same length.

separate_colorbars

If True, use separate colorbars for each subplot.

rescale_colorbars

If True, rescale colorbars to data in each frame.

columns

The number of columns in the visualizer GUI in case multiple plots are displayed at the same time.

pymor.discretizers.builtin.gui.jupyter.config[source]
pymor.discretizers.builtin.gui.jupyter._extension_loaded = False[source]
pymor.discretizers.builtin.gui.jupyter.get_visualizer(backend='py3js')[source]
pymor.discretizers.builtin.gui.jupyter.progress_bar(sequence, every=None, size=None, name='Parameters')[source]
pymor.discretizers.builtin.gui.jupyter.load_ipython_extension(ipython)[source]
pymor.discretizers.builtin.gui.jupyter.unload_ipython_extension(ipython)[source]