suppress_warnings

function of dascore.utils.misc source

suppress_warnings(
    category = <class ‘Warning’>,
    message: str | None[str, None] = None,
    action: Literal[‘default’, ‘error’, ‘ignore’, ‘always’, ‘module’, ‘once’] = ignore,
    record: bool = False,
)

Context manager for configuring warnings inside a local scope.

Parameters

Parameter Description
category The types of warnings to suppress. Must be a subclass of Warning.
message Optional regex used to match warning messages.
action The warning action to apply, such as "ignore", "error",
or "always".
record If True, yield the recorded warning list from catch_warnings.