Skip to content

exceptions

Classes:

UnknownDescalerError

UnknownDescalerError(
    func: FuncExcept, name: str, message: str | None = None, **kwargs: Any
)

Bases: _UnknownBaseScalerError

Raised when an unknown descaler is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • func

    (FuncExcept) –

    Function this exception was raised from.

  • name

    (str) –

    Base scaler name.

  • message

    (str | None, default: None ) –

    Message of the error.

Methods:

  • __call__

    Copy an existing exception with defaults and instantiate a new one.

  • catch

    Create a context manager that catches exceptions of this class type.

Attributes:

Source code in vskernels/exceptions.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, func: FuncExcept, name: str, message: str | None = None, **kwargs: Any) -> None:
    """
    Instantiate a new exception with pretty printing and more.

    Args:
        func: Function this exception was raised from.
        name: Base scaler name.
        message: Message of the error.
    """
    super().__init__(fallback(message, self._message), func, **{self._placeholder: name}, **kwargs)

func instance-attribute

func = func

kwargs instance-attribute

kwargs = kwargs

message instance-attribute

message = message

reason instance-attribute

reason = reason

__call__

__call__(
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any
) -> Self

Copy an existing exception with defaults and instantiate a new one.

Parameters:

Source code in jetpytools/exceptions/base.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def __call__(
    self,
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any,
) -> Self:
    """
    Copy an existing exception with defaults and instantiate a new one.

    Args:
        message: Message of the error.
        func: Function this exception was raised from.
        reason: Reason of the exception. For example, an optional parameter.
    """
    from copy import deepcopy

    err = deepcopy(self)

    if message is not MISSING:
        err.message = message

    if func is not MISSING:
        err.func = func

    if reason is not MISSING:
        err.reason = reason

    err.kwargs |= kwargs

    return err

catch classmethod

catch() -> CatchError[Self]

Create a context manager that catches exceptions of this class type.

Returns:

  • CatchError[Self]

    CatchError[Self]: A context manager that will catch and store exceptions of type cls when used in a with block.

Source code in jetpytools/exceptions/base.py
134
135
136
137
138
139
140
141
142
143
@classmethod
def catch(cls) -> CatchError[Self]:
    """
    Create a context manager that catches exceptions of this class type.

    Returns:
        CatchError[Self]: A context manager that will catch and store exceptions of type `cls`
            when used in a `with` block.
    """
    return CatchError(cls)

UnknownKernelError

UnknownKernelError(
    func: FuncExcept, name: str, message: str | None = None, **kwargs: Any
)

Bases: _UnknownBaseScalerError

Raised when an unknown kernel is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • func

    (FuncExcept) –

    Function this exception was raised from.

  • name

    (str) –

    Base scaler name.

  • message

    (str | None, default: None ) –

    Message of the error.

Methods:

  • __call__

    Copy an existing exception with defaults and instantiate a new one.

  • catch

    Create a context manager that catches exceptions of this class type.

Attributes:

Source code in vskernels/exceptions.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, func: FuncExcept, name: str, message: str | None = None, **kwargs: Any) -> None:
    """
    Instantiate a new exception with pretty printing and more.

    Args:
        func: Function this exception was raised from.
        name: Base scaler name.
        message: Message of the error.
    """
    super().__init__(fallback(message, self._message), func, **{self._placeholder: name}, **kwargs)

func instance-attribute

func = func

kwargs instance-attribute

kwargs = kwargs

message instance-attribute

message = message

reason instance-attribute

reason = reason

__call__

__call__(
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any
) -> Self

Copy an existing exception with defaults and instantiate a new one.

Parameters:

Source code in jetpytools/exceptions/base.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def __call__(
    self,
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any,
) -> Self:
    """
    Copy an existing exception with defaults and instantiate a new one.

    Args:
        message: Message of the error.
        func: Function this exception was raised from.
        reason: Reason of the exception. For example, an optional parameter.
    """
    from copy import deepcopy

    err = deepcopy(self)

    if message is not MISSING:
        err.message = message

    if func is not MISSING:
        err.func = func

    if reason is not MISSING:
        err.reason = reason

    err.kwargs |= kwargs

    return err

catch classmethod

catch() -> CatchError[Self]

Create a context manager that catches exceptions of this class type.

Returns:

  • CatchError[Self]

    CatchError[Self]: A context manager that will catch and store exceptions of type cls when used in a with block.

Source code in jetpytools/exceptions/base.py
134
135
136
137
138
139
140
141
142
143
@classmethod
def catch(cls) -> CatchError[Self]:
    """
    Create a context manager that catches exceptions of this class type.

    Returns:
        CatchError[Self]: A context manager that will catch and store exceptions of type `cls`
            when used in a `with` block.
    """
    return CatchError(cls)

UnknownResamplerError

UnknownResamplerError(
    func: FuncExcept, name: str, message: str | None = None, **kwargs: Any
)

Bases: _UnknownBaseScalerError

Raised when an unknown resampler is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • func

    (FuncExcept) –

    Function this exception was raised from.

  • name

    (str) –

    Base scaler name.

  • message

    (str | None, default: None ) –

    Message of the error.

Methods:

  • __call__

    Copy an existing exception with defaults and instantiate a new one.

  • catch

    Create a context manager that catches exceptions of this class type.

Attributes:

Source code in vskernels/exceptions.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, func: FuncExcept, name: str, message: str | None = None, **kwargs: Any) -> None:
    """
    Instantiate a new exception with pretty printing and more.

    Args:
        func: Function this exception was raised from.
        name: Base scaler name.
        message: Message of the error.
    """
    super().__init__(fallback(message, self._message), func, **{self._placeholder: name}, **kwargs)

func instance-attribute

func = func

kwargs instance-attribute

kwargs = kwargs

message instance-attribute

message = message

reason instance-attribute

reason = reason

__call__

__call__(
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any
) -> Self

Copy an existing exception with defaults and instantiate a new one.

Parameters:

Source code in jetpytools/exceptions/base.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def __call__(
    self,
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any,
) -> Self:
    """
    Copy an existing exception with defaults and instantiate a new one.

    Args:
        message: Message of the error.
        func: Function this exception was raised from.
        reason: Reason of the exception. For example, an optional parameter.
    """
    from copy import deepcopy

    err = deepcopy(self)

    if message is not MISSING:
        err.message = message

    if func is not MISSING:
        err.func = func

    if reason is not MISSING:
        err.reason = reason

    err.kwargs |= kwargs

    return err

catch classmethod

catch() -> CatchError[Self]

Create a context manager that catches exceptions of this class type.

Returns:

  • CatchError[Self]

    CatchError[Self]: A context manager that will catch and store exceptions of type cls when used in a with block.

Source code in jetpytools/exceptions/base.py
134
135
136
137
138
139
140
141
142
143
@classmethod
def catch(cls) -> CatchError[Self]:
    """
    Create a context manager that catches exceptions of this class type.

    Returns:
        CatchError[Self]: A context manager that will catch and store exceptions of type `cls`
            when used in a `with` block.
    """
    return CatchError(cls)

UnknownScalerError

UnknownScalerError(
    func: FuncExcept, name: str, message: str | None = None, **kwargs: Any
)

Bases: _UnknownBaseScalerError

Raised when an unknown scaler is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • func

    (FuncExcept) –

    Function this exception was raised from.

  • name

    (str) –

    Base scaler name.

  • message

    (str | None, default: None ) –

    Message of the error.

Methods:

  • __call__

    Copy an existing exception with defaults and instantiate a new one.

  • catch

    Create a context manager that catches exceptions of this class type.

Attributes:

Source code in vskernels/exceptions.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, func: FuncExcept, name: str, message: str | None = None, **kwargs: Any) -> None:
    """
    Instantiate a new exception with pretty printing and more.

    Args:
        func: Function this exception was raised from.
        name: Base scaler name.
        message: Message of the error.
    """
    super().__init__(fallback(message, self._message), func, **{self._placeholder: name}, **kwargs)

func instance-attribute

func = func

kwargs instance-attribute

kwargs = kwargs

message instance-attribute

message = message

reason instance-attribute

reason = reason

__call__

__call__(
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any
) -> Self

Copy an existing exception with defaults and instantiate a new one.

Parameters:

Source code in jetpytools/exceptions/base.py
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def __call__(
    self,
    message: SupportsString | None | MissingT = MISSING,
    func: FuncExcept | None | MissingT = MISSING,
    reason: SupportsString | FuncExcept | None | MissingT = MISSING,
    **kwargs: Any,
) -> Self:
    """
    Copy an existing exception with defaults and instantiate a new one.

    Args:
        message: Message of the error.
        func: Function this exception was raised from.
        reason: Reason of the exception. For example, an optional parameter.
    """
    from copy import deepcopy

    err = deepcopy(self)

    if message is not MISSING:
        err.message = message

    if func is not MISSING:
        err.func = func

    if reason is not MISSING:
        err.reason = reason

    err.kwargs |= kwargs

    return err

catch classmethod

catch() -> CatchError[Self]

Create a context manager that catches exceptions of this class type.

Returns:

  • CatchError[Self]

    CatchError[Self]: A context manager that will catch and store exceptions of type cls when used in a with block.

Source code in jetpytools/exceptions/base.py
134
135
136
137
138
139
140
141
142
143
@classmethod
def catch(cls) -> CatchError[Self]:
    """
    Create a context manager that catches exceptions of this class type.

    Returns:
        CatchError[Self]: A context manager that will catch and store exceptions of type `cls`
            when used in a `with` block.
    """
    return CatchError(cls)