Skip to content

warnings_ module

Utilities for warnings.


custom_formatwarning function

custom_formatwarning(
    message,
    category,
    filename,
    lineno,
    line=None
)

Custom warning formatter.


use_formatwarning function

use_formatwarning(
    formatwarning
)

Context manager to temporarily set a custom warning formatter.


warn function

warn(
    message,
    category=vectorbtpro.utils.warnings_.VBTWarning,
    stacklevel=2
)

Emit a warning with a custom formatter.


warn_stdout function

warn_stdout(
    func
)

Supress and convert to a warning output from a function.


VBTWarning class

VBTWarning(
    *args,
    **kwargs
)

Base class for warnings raised by VBT.

Superclasses

  • builtins.BaseException
  • builtins.Exception
  • builtins.Warning

WarningsFiltered class

WarningsFiltered(
    entries='ignore',
    **kwargs
)

Context manager to ignore warnings.

Specify whether to record warnings and if an alternative module should be used other than sys.modules['warnings'].

For compatibility with Python 3.0, please consider all arguments to be keyword-only.

Superclasses

  • Base
  • warnings.catch_warnings

Inherited members


entries class property

One or more simple entries to add into the list of warnings filters.