ThemeRegistration

ThemeRegistration#

namedtuple ThemeRegistration(
name: str,
kind: Literal['subclass', 'entry_point', 'alias'],
source: str,
)[source]#

Describe how a theme name became registered.

Returned by registered_themes(). kind distinguishes the registration path: a Theme subclass with a class-level _default_name ('subclass'), a pyvista.themes entry point from an installed plugin ('entry_point'), or a built-in legacy alias such as 'default' or 'vtk' ('alias').

Attributes:
namestr

The registered (normalized) theme name.

kind{‘subclass’, ‘entry_point’, ‘alias’}

How the name was registered.

sourcestr

Human-readable origin (e.g. 'my_package.theme.MyTheme').

Examples

Inspect how a name became registered.

>>> import pyvista as pv
>>> next(r for r in pv.registered_themes() if r.name == 'dark')
ThemeRegistration(name='dark', kind='subclass', source='pyvista.plotting.themes.DarkTheme')
Fields:
  1.  name (str) – Alias for field number 0

  2.  kind (Literal['subclass', 'entry_point', 'alias']) – Alias for field number 1

  3.  source (str) – Alias for field number 2