Skip to content

funcs

Type Aliases:

Classes:

  • Align

    Defines alignment flags for positioning elements vertically and horizontally.

  • ConvMode

    Convolution mode for .std.Convolution or std.AverageFrames

OneDimConvMode

OneDimConvMode = Literal[HORIZONTAL, VERTICAL, HV]

Type alias for one dimension convolution mode

OnePassConvMode

OnePassConvMode = Literal[SQUARE, HORIZONTAL, VERTICAL, TEMPORAL]

Type alias for one pass convolution mode

SpatialConvMode

SpatialConvMode = Literal[SQUARE, HORIZONTAL, VERTICAL, HV]

Type alias for spatial convolution mode only

TempConvMode

TempConvMode = Literal[TEMPORAL]

Type alias for temporal convolution mode only

TwoDimConvMode

TwoDimConvMode = Literal[SQUARE]

Type alias for two dimensions convolution mode

TwoPassesConvMode

TwoPassesConvMode = Literal[HV]

Type alias for two passes convolution mode

Align

Bases: Flag

Defines alignment flags for positioning elements vertically and horizontally.

Attributes:

BOTTOM class-attribute instance-attribute

BOTTOM = auto()

Align to the bottom.

BOTTOM_CENTER class-attribute instance-attribute

BOTTOM_CENTER = BOTTOM | CENTER

Align to the bottom-center.

BOTTOM_LEFT class-attribute instance-attribute

BOTTOM_LEFT = BOTTOM | LEFT

Align to the bottom-left corner.

BOTTOM_RIGHT class-attribute instance-attribute

BOTTOM_RIGHT = BOTTOM | RIGHT

Align to the bottom-right corner.

CENTER class-attribute instance-attribute

CENTER = auto()

Align to the horizontal center.

LEFT class-attribute instance-attribute

LEFT = auto()

Align to the left.

MIDDLE class-attribute instance-attribute

MIDDLE = auto()

Align to the vertical center.

MIDDLE_CENTER class-attribute instance-attribute

MIDDLE_CENTER = MIDDLE | CENTER

Align to the center (both vertically and horizontally).

MIDDLE_LEFT class-attribute instance-attribute

MIDDLE_LEFT = MIDDLE | LEFT

Align to the middle-left.

MIDDLE_RIGHT class-attribute instance-attribute

MIDDLE_RIGHT = MIDDLE | RIGHT

Align to the middle-right.

RIGHT class-attribute instance-attribute

RIGHT = auto()

Align to the right.

TOP class-attribute instance-attribute

TOP = auto()

Align to the top.

TOP_CENTER class-attribute instance-attribute

TOP_CENTER = TOP | CENTER

Align to the top-center.

TOP_LEFT class-attribute instance-attribute

TOP_LEFT = TOP | LEFT

Align to the top-left corner.

TOP_RIGHT class-attribute instance-attribute

TOP_RIGHT = TOP | RIGHT

Align to the top-right corner.

ConvMode

Bases: CustomStrEnum

Convolution mode for .std.Convolution or std.AverageFrames

Methods:

Attributes:

H class-attribute instance-attribute

Alias for ConvMode.HORIZONTAL

HORIZONTAL class-attribute instance-attribute

HORIZONTAL = 'h'

Horizontal-only convolution.

HV class-attribute instance-attribute

HV = 'hv'

Horizontal and Vertical convolution

S class-attribute instance-attribute

S = SQUARE

Alias for ConvMode.SQUARE

SQUARE class-attribute instance-attribute

SQUARE = 's'

Square horizontal/vertical convolution.

T class-attribute instance-attribute

Alias for ConvMode.TEMPORAL

TEMPORAL class-attribute instance-attribute

TEMPORAL = 't'

Temporal convolution

V class-attribute instance-attribute

Alias for ConvMode.VERTICAL

VERTICAL class-attribute instance-attribute

VERTICAL = 'v'

Vertical-only convolution.

is_one_dim property

is_one_dim: bool

is_spatial property

is_spatial: bool

is_temporal property

is_temporal: bool

is_two_dim property

is_two_dim: bool

from_param classmethod

from_param(value: Any, func_except: FuncExcept | None = None) -> Self

Return the enum value from a parameter.

Parameters:

  • value

    (Any) –

    Value to instantiate the enum class.

  • func_except

    (FuncExcept | None, default: None ) –

    Exception function.

Returns:

  • Self

    Enum value.

Raises:

Source code in jetpytools/enums/base.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@classmethod
def from_param(cls, value: Any, func_except: FuncExcept | None = None) -> Self:
    """
    Return the enum value from a parameter.

    Args:
        value: Value to instantiate the enum class.
        func_except: Exception function.

    Returns:
        Enum value.

    Raises:
        NotFoundEnumValue: Variable not found in the given enum.
    """
    func_except = func_except or cls.from_param

    try:
        return cls(value)
    except (ValueError, TypeError):
        pass

    if isinstance(func_except, tuple):
        func_name, var_name = func_except
    else:
        func_name, var_name = func_except, repr(cls)

    raise NotFoundEnumValueError(
        'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
        "Valid values are: [{readable_enum}].",
        func_name,
        var_name=var_name,
        enum_name=cls,
        value=value,
        readable_enum=(f"{name} ({value!r})" for name, value in cls.__members__.items()),
        reason=value,
    ) from None

value

value() -> str
Source code in jetpytools/enums/base.py
97
98
@enum_property
def value(self) -> str: ...