pyvista.core.utilities.VtkErrorCatcher

pyvista.core.utilities.VtkErrorCatcher#

class VtkErrorCatcher(
raise_errors: bool = False,
send_to_logging: bool = True,
emit_warnings: bool = False,
)[ソース]#

VTKエラーを一時的にキャッチするためのコンテキストマネージャ.

パラメータ:
raise_errorsbool, default: False

Raise a pyvista.VTKExecutionError (a runtime error) when a VTK error is observed.

バージョン 0.47 で変更: A pyvista.VTKExecutionError is now raised instead of a generic RuntimeError.

send_to_loggingbool, default: True

コンテキスト内で発生したVTKエラーもロギングに送信するかどうかを決定します.

emit_warningsbool, default: False

Emit a pyvista.VTKExecutionWarning (a runtime warning) when a VTK warning is observed.

Added in version 0.47.

Catch VTK errors using the context manager. This only sends to logging by default.

>>> import pyvista as pv
>>> with pv.VtkErrorCatcher() as error_catcher:
...     sphere = pv.Sphere()

Raise VTK errors as Python errors and emit VTK warnings as Python warnings.

>>> with pv.VtkErrorCatcher(
...     raise_errors=True, emit_warnings=True
... ) as error_catcher:
...     sphere = pv.Sphere()

メソッド#

アトリビュート#

VtkErrorCatcher.error_events

List of VTK error events observed.

VtkErrorCatcher.events

List of all VTK warning and error events observed.

VtkErrorCatcher.warning_events

List of VTK error events observed.