fetch_theme

Contents

fetch_theme#

fetch_theme()[source]#

Return the path to the bundled PyVisual PyVista theme file.

Resolves pyvisual_theme.json from the package’s _assets directory and returns its absolute Path. This file is loaded automatically at import time by pyvisual.core to apply the default PyVista color theme.

Returns:
filepathpathlib.Path

Absolute path to pyvisual_theme.json.

Raises:
FileNotFoundError

If pyvisual_theme.json is not found at the expected location. This typically means the file was not included in the installation.

Notes

The path is resolved as:

core_dir = Path(__file__).resolve().parent.parent
filepath = core_dir / "_assets" / "pyvisual_theme.json"

Examples

>>> theme_path = fetch_theme()
>>> theme_path.name
'pyvisual_theme.json'