Skip to content

Commit

Permalink
pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
rsokl committed Aug 1, 2024
1 parent 6d3f743 commit f59cd60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/phantom_tensors/_internals/dim_binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from functools import wraps
from typing import Any, Callable, Iterable, Optional, Tuple, Type, TypeVar, Union, cast

from typing_extensions import Final, TypeAlias
from typing_extensions import TypeAlias

import phantom_tensors._internals.utils as _utils
from phantom_tensors._internals.utils import LiteralLike, NewTypeLike, UnpackLike
Expand Down Expand Up @@ -92,7 +92,7 @@ def check(shape_type: Tuple[ShapeDimType, ...], shape: Tuple[int, ...]) -> bool:

# if variadic tuple is present, need to use negative indexing to reference
# location from the end of the tuple
CURRENT_INDEX: Final = n if var_field_ind is None else n - len(shape_type)
CURRENT_INDEX = n if var_field_ind is None else n - len(shape_type)

# The following symbols bind to dimensions (by symbol-reference)
# Some of them may also carry with them additional validation checks,
Expand Down
5 changes: 0 additions & 5 deletions tests/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,11 @@ def check_bad_tensor_parse(x: tr.Tensor):


def check_readme_blurb_one():
from typing import NewType

import numpy as np

from phantom_tensors import parse
from phantom_tensors.numpy import NDArray

A = NewType("A", int)
B = NewType("B", int)

# runtime: checks that shapes (2, 3) and (3, 2)
# match (A, B) and (B, A) pattern
if sys.version_info < (3, 8):
Expand Down

0 comments on commit f59cd60

Please sign in to comment.