|
33 | 33 |
|
34 | 34 | from pymc.exceptions import BlockModelAccessError |
35 | 35 |
|
36 | | -# User-facing coordinate types |
37 | 36 | CoordValue: TypeAlias = Sequence[Hashable] | np.ndarray | None |
| 37 | +# User-provided values for a single coordinate dimension. |
| 38 | + |
38 | 39 | Coords: TypeAlias = Mapping[str, CoordValue] |
| 40 | +# Mapping from dimension name to its coordinate values. |
39 | 41 |
|
40 | | -# Internal strong coordinate types |
41 | 42 | StrongCoordValue: TypeAlias = tuple[Hashable, ...] | None |
| 43 | +# Normalized coordinate values stored internally. |
| 44 | + |
42 | 45 | StrongCoords: TypeAlias = Mapping[str, StrongCoordValue] |
| 46 | +# Mapping from dimension name to normalized coordinate values. |
43 | 47 |
|
44 | | -# Internal strong dimension/shape types |
45 | 48 | StrongDims: TypeAlias = tuple[str, ...] |
| 49 | +# Tuple of dimension names after validation. |
| 50 | + |
46 | 51 | StrongShape: TypeAlias = tuple[int, ...] |
| 52 | +# Fully-resolved numeric shape used internally. |
47 | 53 |
|
48 | | -# User-provided shape before processing |
49 | 54 | Shape: TypeAlias = int | TensorVariable | Sequence[int | Variable] |
| 55 | +# User-provided shape specification before normalization. |
50 | 56 |
|
51 | | -# User-provided dims before processing |
52 | 57 | Dims: TypeAlias = str | Sequence[str | None] |
| 58 | +# User-provided dimension names before normalization. |
53 | 59 |
|
54 | | -# User-provided dims that may include ellipsis (...) |
55 | 60 | DimsWithEllipsis: TypeAlias = str | EllipsisType | Sequence[str | None | EllipsisType] |
| 61 | +# User-provided dimension names that may include ellipsis. |
56 | 62 |
|
57 | | -# User-provided size before processing |
58 | 63 | Size: TypeAlias = int | TensorVariable | Sequence[int | Variable] |
| 64 | +# User-provided size specification before normalization. |
59 | 65 |
|
60 | | -# Strong / normalized versions used internally |
61 | 66 | StrongDimsWithEllipsis: TypeAlias = Sequence[str | EllipsisType] |
62 | | -StrongSize: TypeAlias = TensorVariable | tuple[int | Variable, ...] |
63 | | -""" |
64 | | -Type alias groups: |
| 67 | +# Normalized dimension names that may include ellipsis. |
65 | 68 |
|
66 | | -- User-facing types (Coords, CoordValue, Shape, Dims, Size) represent the flexible inputs |
67 | | - accepted from users when defining models. |
68 | | -
|
69 | | -- Strong/internal types (StrongCoords, StrongDims, StrongShape, StrongSize, etc.) represent |
70 | | - normalized, fully-validated forms used internally after processing. |
71 | | -
|
72 | | -These distinctions allow looser user input while keeping strict internal consistency. |
73 | | -""" |
| 69 | +StrongSize: TypeAlias = TensorVariable | tuple[int | Variable, ...] |
| 70 | +# Normalized symbolic size used internally. |
74 | 71 |
|
75 | 72 |
|
76 | 73 | class _UnsetType: |
|
0 commit comments