optimap.utils¶

General utility functions.

Functions

deprecated(reason)

Function decorator to mark a function as deprecated.

disable_interactive_backend_switching()

Disable automatic switching of the matplotlib backend to Qt when necessary.

download_example_data(name[, directory, silent])

Download example data if not already present.

enable_interactive_backend_switching()

Enable automatic switching of the matplotlib backend to Qt when necessary.

interactive_backend(func)

Function decorator to change backend temporarily in Ipython session.

is_verbose()

Returns whether optimap is verbose.

jupyter_render_animation(f[, mp4_filename, ...])

Helper function for our documentation to render animations in Jupyter notebooks.

print_bar([force])

Print a bar to separate sections of output.

print_properties(array)

Print properties of an array.

retrieve_example_data(name[, directory, silent])

set_verbose([state])

Set verbosity of optimap.

optimap.utils.set_verbose(state=True)[source]¶

Set verbosity of optimap.

Parameters:

state (bool) – If True, optimap will print more information.

optimap.utils.is_verbose()[source]¶

Returns whether optimap is verbose.

Returns:

Whether optimap is verbose.

Return type:

bool

optimap.utils.print_bar(force=False)[source]¶

Print a bar to separate sections of output.

optimap.utils.print_properties(array: ndarray)[source]¶

Print properties of an array.

optimap.utils.enable_interactive_backend_switching()[source]¶

Enable automatic switching of the matplotlib backend to Qt when necessary.

See also disable_interactive_backend_switching().

optimap.utils.disable_interactive_backend_switching()[source]¶

Disable automatic switching of the matplotlib backend to Qt when necessary.

See also enable_interactive_backend_switching().

optimap.utils.download_example_data(name, directory='./optimap_example_data', silent=False)[source]¶

Download example data if not already present.

Parameters:
  • name (str) – Name of the file to download.

  • directory (str) – Directory to download the file to.

  • silent (bool) – If True, set logging level to WARNING.

Returns:

Path to the file.

Return type:

str