vispy package#

Subpackages#

Submodules#

Module contents#

Vispy is a high-performance interactive 2D/3D data visualization library. Vispy leverages the computational power of modern Graphics Processing Units (GPUs) through the OpenGL library to display very large datasets.

For more information, see http://vispy.org.

vispy.set_log_level(verbose, match=None, return_old=False)#

Convenience function for setting the logging level

Parameters:
verbosebool, str, int, or None

The verbosity of messages to print. If a str, it can be either DEBUG, INFO, WARNING, ERROR, or CRITICAL. Note that these are for convenience and are equivalent to passing in logging.DEBUG, etc. For bool, True is the same as ‘INFO’, False is the same as ‘WARNING’.

matchstr | None

String to match. Only those messages that both contain a substring that regexp matches 'match' (and the verbose level) will be displayed.

return_oldbool

If True, return the old verbosity level and old match.

See also

vispy.util.use_log_level

Notes

If verbose=='debug', then the vispy method emitting the log message will be prepended to each log message, which is useful for debugging. If verbose=='debug' or match is not None, then a small performance overhead is added. Thus it is suggested to only use these options when performance is not crucial.

vispy.sys_info(fname=None, overwrite=False)#

Get relevant system and debugging information

Parameters:
fnamestr | None

Filename to dump info to. Use None to simply print.

overwritebool

If True, overwrite file (if it exists).

Returns:
outstr

The system information as a string.

vispy.test(*args, **kwargs)#

Proxy function to delay .testing import

vispy.use(app=None, gl=None)#

Set the usage options for vispy

Specify what app backend and GL backend to use.

Parameters:
appstr
The app backend to use (case insensitive). Standard backends:
  • ‘PyQt4’: use Qt widget toolkit via PyQt4.

  • ‘PyQt5’: use Qt widget toolkit via PyQt5.

  • ‘PyQt6’: use Qt widget toolkit via PyQt6.

  • ‘PySide’: use Qt widget toolkit via PySide.

  • ‘PySide2’: use Qt widget toolkit via PySide2.

  • ‘PySide6’: use Qt widget toolkit via PySide6.

  • ‘PyGlet’: use Pyglet backend.

  • ‘Glfw’: use Glfw backend (successor of Glut). Widely available on Linux.

  • ‘SDL2’: use SDL v2 backend.

  • ‘osmesa’: Use OSMesa backend

Additional backends:
  • ‘jupyter_rfb’: show vispy canvases in Jupyter lab/notebook (depends on the jupyter_rfb library).

glstr
The gl backend to use (case insensitive). Options are:
  • ‘gl2’: use Vispy’s desktop OpenGL API.

  • ‘pyopengl2’: use PyOpenGL’s desktop OpenGL API. Mostly for testing.

  • ‘es2’: (TO COME) use real OpenGL ES 2.0 on Windows via Angle. Availability of ES 2.0 is larger for Windows, since it relies on DirectX.

  • ‘gl+’: use the full OpenGL functionality available on your system (via PyOpenGL).

See also

vispy.app.use_app
vispy.gloo.gl.use_gl

Notes

If the app option is given, vispy.app.use_app() is called. If the gl option is given, vispy.gloo.use_gl() is called.

If an app backend name is provided, and that backend could not be loaded, an error is raised.

If no backend name is provided, Vispy will first check if the GUI toolkit corresponding to each backend is already imported, and try that backend first. If this is unsuccessful, it will try the ‘default_backend’ provided in the vispy config. If still not succesful, it will try each backend in a predetermined order.