Skip to content

Commit 7163032

Browse files
committed
More precise type-hints
1 parent f9e0f8c commit 7163032

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pymc/distributions/shape_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def get_support_shape(
369369
support_shape_offset = [0] * ndim_supp
370370
elif isinstance(support_shape_offset, int):
371371
support_shape_offset = [support_shape_offset] * ndim_supp
372-
inferred_support_shape: Sequence[int | np.ndarray | Variable] | None = None
372+
inferred_support_shape: Sequence[int | np.ndarray | TensorVariable] | None = None
373373

374374
if shape is not None:
375375
shape = to_tuple(shape)
@@ -411,7 +411,7 @@ def get_support_shape(
411411
# There were two sources of support_shape, make sure they are consistent
412412
inferred_support_shape = [
413413
cast(
414-
Variable,
414+
TensorVariable,
415415
Assert(msg="support_shape does not match respective shape dimension")(
416416
inferred, pt.eq(inferred, explicit)
417417
),

pymc/gp/cov.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class Covariance(BaseCovariance):
164164

165165
def __init__(self, input_dim: int, active_dims: IntSequence | None = None):
166166
self.input_dim = input_dim
167+
self.active_dims: np.ndarray[Any, np.dtype[np.int_]]
167168
if active_dims is None:
168169
self.active_dims = np.arange(input_dim)
169170
else:

pymc/model/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def coords(self) -> dict[str, tuple | None]:
895895
return self._coords
896896

897897
@property
898-
def dim_lengths(self) -> dict[str, Variable]:
898+
def dim_lengths(self) -> dict[str, TensorVariable]:
899899
"""The symbolic lengths of dimensions in the model.
900900
901901
The values are typically instances of ``TensorVariable`` or ``ScalarSharedVariable``.

0 commit comments

Comments
 (0)