Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable typing support #8254

Merged
merged 9 commits into from
Dec 4, 2023
Merged

Enable typing support #8254

merged 9 commits into from
Dec 4, 2023

Conversation

akihironitta
Copy link
Member

Addresses #3429 (reply in thread).
Related to #5657.

Package maintainers who wish to support type checking of their code MUST add a marker file named py.typed to their package supporting typing. This marker applies recursively: if a top-level package includes it, all its sub-packages MUST support type checking as well.

https://peps.python.org/pep-0561/#packaging-type-information

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4f379d7) 88.30% compared to head (31b247b) 88.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8254      +/-   ##
==========================================
- Coverage   88.30%   88.30%   -0.01%     
==========================================
  Files         479      479              
  Lines       29645    29645              
==========================================
- Hits        26178    26177       -1     
- Misses       3467     3468       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@akihironitta akihironitta marked this pull request as draft December 2, 2023 22:20
@akihironitta
Copy link
Member Author

I'm not very familiar with TorchScript, but it seems like there's an issue with around annotations for TorchScript:

def forward(
self, x: Union[Tensor, PairTensor],
batch: Union[OptTensor, Optional[PairTensor]] = None) -> Tensor:
# type: (Tensor, OptTensor) -> Tensor # noqa
# type: (PairTensor, Optional[PairTensor]) -> Tensor # noqa

$ mypy
torch_geometric/nn/conv/edge_conv.py:120: error: expected an indented block  [syntax]
Found 1 error in 1 file (errors prevented further checking)

https://github.com/pyg-team/pytorch_geometric/actions/runs/7072892589/job/19252222130?pr=8254


I would appreciate any help from the PyG community ❤️

@github-actions github-actions bot added the nn label Dec 4, 2023
@rusty1s
Copy link
Member

rusty1s commented Dec 4, 2023

Thanks @akihironitta. I fixed the # type: issue.

Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting out the pre-commit check for now due to bunch of errors, but I think it is good to get this PR in.

@rusty1s rusty1s marked this pull request as ready for review December 4, 2023 07:44
@rusty1s rusty1s merged commit 2d1f7d3 into master Dec 4, 2023
16 checks passed
@rusty1s rusty1s deleted the aki/pytyped branch December 4, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants