unregister_dataset_accessor#
- unregister_dataset_accessor(name: str, target_cls: type) None[source]#
Remove an accessor previously attached to a target class.
The inverse of
register_dataset_accessor(). Restores any built-in attribute that was shadowed viaoverride=Truewhen the accessor was registered.Added in version 0.48.0.
- Parameters:
- Raises:
ValueErrorIf no accessor named
nameis attached directly totarget_cls.TypeErrorIf
target_clsis not a class, ornameis not a string.
Examples#
>>> import pyvista as pv
>>> @pv.register_dataset_accessor('tmp', pv.PolyData)
... class TmpAccessor:
... def __init__(self, mesh):
... self._mesh = mesh
>>> pv.unregister_dataset_accessor('tmp', pv.PolyData)