Skip to content

color

Classes:

InvalidColorspacePathError

InvalidColorspacePathError(
    func: FuncExcept, message: SupportsString | None = None, **kwargs: Any
)

Bases: CustomValueError

Raised when there is no path between two colorspaces.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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.

  • check

    Check if there's a valid colorspace path for the given clip.

Attributes:

Source code in vstools/exceptions/color.py
36
37
38
39
40
41
42
43
44
45
46
def __init__(self, func: FuncExcept, message: SupportsString | None = None, **kwargs: Any) -> None:
    def_msg = "Unable to convert between colorspaces! "
    def_msg += "Please provide more colorspace information (e.g., matrix, transfer, primaries)."

    if isinstance(message, vs.Error):
        error_msg = str(message)
        if "Resize error:" in error_msg:
            kwargs["reason"] = error_msg[error_msg.find("(") + 1 : error_msg.rfind(")")]
            message = def_msg

    super().__init__(message or def_msg, func, **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)

check staticmethod

check(func: FuncExcept, to_check: VideoNode) -> None

Check if there's a valid colorspace path for the given clip.

Parameters:

  • func

    (FuncExcept) –

    Function returned for custom error handling. This should only be set by VS package developers.

  • to_check

    (VideoNode) –

    Value to check. Must be a VideoNode.

Raises:

Source code in vstools/exceptions/color.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@staticmethod
def check(func: FuncExcept, to_check: vs.VideoNode) -> None:
    """
    Check if there's a valid colorspace path for the given clip.

    Args:
        func: Function returned for custom error handling. This should only be set by VS package developers.
        to_check: Value to check. Must be a VideoNode.

    Raises:
        InvalidColorspacePathError: If there's no valid colorspace path.
    """

    try:
        to_check.get_frame(0).close()
    except vs.Error as e:
        if "no path between colorspaces" in str(e):
            raise InvalidColorspacePathError(func, e)
        raise

InvalidMatrixError

InvalidMatrixError(
    func: FuncExcept,
    matrix: int = 2,
    message: SupportsString = "You can't set a matrix of {matrix}!",
    **kwargs: Any
)

Bases: CustomValueError

Raised when an invalid matrix is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 vstools/exceptions/color.py
 96
 97
 98
 99
100
101
102
103
def __init__(
    self,
    func: FuncExcept,
    matrix: int = 2,
    message: SupportsString = "You can't set a matrix of {matrix}!",
    **kwargs: Any,
) -> None:
    super().__init__(message, func, matrix=matrix, **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)

InvalidPrimariesError

InvalidPrimariesError(
    func: FuncExcept,
    primaries: int = 2,
    message: SupportsString = "You can't set primaries of {primaries}!",
    **kwargs: Any
)

Bases: CustomValueError

Raised when an invalid matrix is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 vstools/exceptions/color.py
170
171
172
173
174
175
176
177
def __init__(
    self,
    func: FuncExcept,
    primaries: int = 2,
    message: SupportsString = "You can't set primaries of {primaries}!",
    **kwargs: Any,
) -> None:
    super().__init__(message, func, primaries=primaries, **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)

InvalidTransferError

InvalidTransferError(
    func: FuncExcept,
    transfer: int = 2,
    message: SupportsString = "You can't set a transfer of {transfer}!",
    **kwargs: Any
)

Bases: CustomValueError

Raised when an invalid matrix is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 vstools/exceptions/color.py
133
134
135
136
137
138
139
140
def __init__(
    self,
    func: FuncExcept,
    transfer: int = 2,
    message: SupportsString = "You can't set a transfer of {transfer}!",
    **kwargs: Any,
) -> None:
    super().__init__(message, func, transfer=transfer, **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)

ReservedMatrixError

ReservedMatrixError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomPermissionError

Raised when a reserved matrix is requested.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

ReservedPrimariesError

ReservedPrimariesError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomPermissionError

Raised when reserved primaries are requested.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

ReservedTransferError

ReservedTransferError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomPermissionError

Raised when a reserved transfer is requested.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UndefinedColorRangeError

UndefinedColorRangeError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when a undefined color range value is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UndefinedMatrixError

UndefinedMatrixError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when an undefined matrix is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UndefinedPrimariesError

UndefinedPrimariesError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when an undefined primaries value is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UndefinedTransferError

UndefinedTransferError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when an undefined transfer is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UnsupportedColorRangeError

UnsupportedColorRangeError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when a unsupported color range value is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UnsupportedMatrixError

UnsupportedMatrixError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when an unsupported matrix is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UnsupportedPrimariesError

UnsupportedPrimariesError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when a unsupported primaries value is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)

UnsupportedTransferError

UnsupportedTransferError(
    message: SupportsString | None = None,
    func: FuncExcept | None = None,
    reason: Any = None,
    **kwargs: Any
)

Bases: CustomValueError

Raised when an unsupported transfer is passed.

Instantiate a new exception with pretty printing and more.

Parameters:

  • message

    (SupportsString | None, default: None ) –

    Message of the error.

  • func

    (FuncExcept | None, default: None ) –

    Function this exception was raised from.

  • reason

    (Any, default: None ) –

    Reason of the exception. For example, an optional parameter.

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 jetpytools/exceptions/base.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self, message: SupportsString | None = None, func: FuncExcept | None = None, reason: Any = None, **kwargs: Any
) -> None:
    """
    Instantiate a new exception with pretty printing and more.

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

    self.message = message
    self.func = func
    self.reason = reason
    self.kwargs = kwargs

    super().__init__(message)

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)