Skip to content

Port NumPy typing testing style to PyTorch#54234

Closed
guilhermeleobas wants to merge 9 commits intopytorch:masterfrom
guilhermeleobas:test_typing
Closed

Port NumPy typing testing style to PyTorch#54234
guilhermeleobas wants to merge 9 commits intopytorch:masterfrom
guilhermeleobas:test_typing

Conversation

@guilhermeleobas
Copy link
Copy Markdown
Collaborator

This is a follow-up PR of #52408 and includes the pass/ and fail/ directories.

@guilhermeleobas guilhermeleobas added the module: typing Related to mypy type annotations label Mar 18, 2021
@guilhermeleobas guilhermeleobas self-assigned this Mar 18, 2021
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Mar 18, 2021

💊 CI failures summary and remediations

As of commit d1cacd6 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@guilhermeleobas guilhermeleobas changed the title [WIP] Port NumPy typing testing style to PyTorch Port NumPy typing testing style to PyTorch Mar 26, 2021
@guilhermeleobas
Copy link
Copy Markdown
Collaborator Author

Hi @rgommers, can you do an initial review? I'll add more examples to the fail/ dir in the upcoming days.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2021

Codecov Report

Merging #54234 (04ddeb9) into master (6145ac0) will increase coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 04ddeb9 differs from pull request most recent head 97468cb. Consider uploading reports for the commit 97468cb to get more accurate results

@@            Coverage Diff             @@
##           master   #54234      +/-   ##
==========================================
+ Coverage   77.38%   77.44%   +0.05%     
==========================================
  Files        1896     1893       -3     
  Lines      186911   186081     -830     
==========================================
- Hits       144646   144111     -535     
+ Misses      42265    41970     -295     

@guilhermeleobas guilhermeleobas marked this pull request as ready for review March 30, 2021 02:49
Copy link
Copy Markdown
Collaborator

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks @guilhermeleobas, overall this looks good. A number of small things to fix. Would also be good to merge with master to get a fresh CI run.

Comment thread test/test_typing.py


def _strip_filename(msg: str) -> str:
"""Strip the filename from a mypy message."""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change is helpful

Comment thread test/typing/pass/creation_ops.py Outdated
Comment thread test/typing/pass/creation_ops.py
Comment thread test/typing/pass/math_ops.py Outdated
Comment thread test/typing/pass/math_ops.py
Comment thread test/typing/pass/math_ops.py Outdated
Comment thread test/typing/reveal/tensor_sampling.py Outdated
Comment thread torch/quasirandom.py Outdated
@guilhermeleobas guilhermeleobas requested a review from rgommers April 1, 2021 22:37
@guilhermeleobas
Copy link
Copy Markdown
Collaborator Author

guilhermeleobas commented Apr 1, 2021

Hi Ralf, thanks for the review! I've addressed all your comments

Copy link
Copy Markdown
Collaborator

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks @guilhermeleobas, this LGTM now.

@rgommers rgommers requested review from malfet and walterddr April 9, 2021 15:59
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in 6eeffc6.

krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
Summary:
This is a follow-up PR of pytorch#52408 and includes the `pass/` and `fail/` directories.

Pull Request resolved: pytorch#54234

Reviewed By: walterddr

Differential Revision: D27681410

Pulled By: malfet

fbshipit-source-id: e6817df77c758f4c1295ea62613106c71cfd3fc3
malfet added a commit that referenced this pull request Oct 17, 2023
`test_typing.py` was written to use `pytest` in #54234 which unfortunately rendered it incompatible with run_test.py, and therefore it was not running in CI all this time.

In this PR, same functionality is re-written using unittest framework, and `parametrize` from `torch.testing._internal._common_utils`.

Disable `fail/bitwise_ops.py` as it regressed at some point as well as one of examples in `namedtuple.py` as `torch.linalg.qr` type is no longer revealed correctly.

[ghstack-poisoned]
malfet added a commit that referenced this pull request Oct 17, 2023
`test_typing.py` was written to use `pytest` in #54234 which unfortunately rendered it incompatible with run_test.py, and therefore it was not running in CI all this time.

In this PR, same functionality is re-written using unittest framework, and `parametrize` from `torch.testing._internal._common_utils`.

Disable `fail/bitwise_ops.py` as it regressed at some point as well as one of examples in `namedtuple.py` as `torch.linalg.qr` type is no longer revealed correctly.

[ghstack-poisoned]
malfet added a commit that referenced this pull request Oct 17, 2023
`test_typing.py` was written to use `pytest` in #54234 which unfortunately rendered it incompatible with run_test.py, and therefore it was not running in CI all this time.

In this PR, same functionality is re-written using unittest framework, and `parametrize` from `torch.testing._internal._common_utils`.

Disable `fail/bitwise_ops.py` as it regressed at some point as well as one of examples in `namedtuple.py` as `torch.linalg.qr` type is no longer revealed correctly.

[ghstack-poisoned]
malfet added a commit that referenced this pull request Oct 17, 2023
`test_typing.py` was written to use `pytest` in #54234 which unfortunately rendered it incompatible with run_test.py, and therefore it was not running in CI all this time.

In this PR, same functionality is re-written using unittest framework, and `parametrize` from `torch.testing._internal._common_utils`.

Valid `test_typing.py` with ufmt

Disable `fail/bitwise_ops.py` and `pass/jit.py` as it regressed at some point as well as one of examples in `namedtuple.py` as `torch.linalg.qr` type is no longer revealed correctly.

[ghstack-poisoned]
malfet added a commit that referenced this pull request Oct 17, 2023
`test_typing.py` was written to use `pytest` in #54234 which unfortunately rendered it incompatible with run_test.py, and therefore it was not running in CI all this time.

In this PR, same functionality is re-written using unittest framework, and `parametrize` from `torch.testing._internal._common_utils`.

Valid `test_typing.py` with ufmt

Disable `fail/bitwise_ops.py` and `pass/jit.py` as it regressed at some point as well as one of examples in `namedtuple.py` as `torch.linalg.qr` type is no longer revealed correctly.

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Oct 18, 2023
`test_typing.py` was written to use `pytest` in #54234 which unfortunately rendered it incompatible with run_test.py, and therefore it was not running in CI all this time.

In this PR, same functionality is re-written using unittest framework, and `parametrize` from `torch.testing._internal._common_utils`.

Valid `test_typing.py` with ufmt

Disable `fail/bitwise_ops.py` and `pass/jit.py` as it regressed at some point as well as one of examples in `namedtuple.py` as `torch.linalg.qr` type is no longer revealed correctly.
Pull Request resolved: #111428
Approved by: https://github.com/clee2000
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
This is a follow-up PR of pytorch#52408 and includes the `pass/` and `fail/` directories.

Pull Request resolved: pytorch#54234

Reviewed By: walterddr

Differential Revision: D27681410

Pulled By: malfet

fbshipit-source-id: e6817df77c758f4c1295ea62613106c71cfd3fc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants