Skip to content

Conversation

@pranavm-nvidia
Copy link
Collaborator

Cleans up the display of type annotations and includes module names for arguments provided from outside of Tripy or Python builtins.

Before (line breaks added for clarity):

Not a valid overload because: For parameter: 'other', expected an instance of type:
    'typing.Union[ForwardRef('tripy.Tensor'), ForwardRef('tripy.types.NestedNumberSequence')]'
    but got argument of type: 'Tensor'.

After:

Not a valid overload because: For parameter: 'other', expected an instance of type:
    'Union[tripy.Tensor, tripy.types.NestedNumberSequence]'
    but got argument of type: 'torch.Tensor'.

Cleans up the display of type annotations and includes module names for arguments
provided from outside of Tripy or Python builtins.

Before (line breaks added for clarity):
```
Not a valid overload because: For parameter: 'other', expected an instance of type:
    'typing.Union[ForwardRef('tripy.Tensor'), ForwardRef('tripy.types.NestedNumberSequence')]'
    but got argument of type: 'Tensor'.
```

After:
```
Not a valid overload because: For parameter: 'other', expected an instance of type:
    'Union[tripy.Tensor, tripy.types.NestedNumberSequence]'
    but got argument of type: 'torch.Tensor'.
```
@jhalakpatel jhalakpatel self-requested a review October 1, 2024 01:32
@pranavm-nvidia pranavm-nvidia merged commit af99134 into main Oct 1, 2024
@pranavm-nvidia pranavm-nvidia deleted the improve-type-errors branch October 1, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants