Skip to content

476 Reconfigure mypy and pytype #834

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

Merged
merged 4 commits into from
Aug 4, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jul 30, 2020

Iteration of #476

Description

Reconfigure mypy and pytype

  • Enable as many checks as possible

Resolve errors, Add and Update type hints

  • Update type: ignore to specify error
  • Update type hints to specify contents
  • Add type hints to parameters
  • Add type hints to returns
  • Remove unnecessary type hints
  • Remove incorrect type hints
  • Rename internal variables (redefinition)
  • Resolve errors as a result of the above

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Integration tests passed locally by running ./runtests.sh --codeformat --coverage.
  • In-line docstrings updated.

@ghost ghost changed the title Reconfigure mypy and pytype [WIP] 476 Reconfigure mypy and pytype Jul 30, 2020
@ghost ghost force-pushed the reconfigure-checks branch 3 times, most recently from 2ddb9f1 to 4cec2dd Compare August 3, 2020 15:42
@ghost ghost changed the title [WIP] 476 Reconfigure mypy and pytype 476 Reconfigure mypy and pytype Aug 3, 2020
@ghost ghost force-pushed the reconfigure-checks branch 3 times, most recently from 06294a6 to 8ae42ec Compare August 3, 2020 20:59
@ghost
Copy link
Author

ghost commented Aug 3, 2020

@hjmjohnson Updated and checks pass

Copy link
Contributor

@hjmjohnson hjmjohnson left a comment

Choose a reason for hiding this comment

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

Thanks for your attention to detail. This variant of the patch is much more transparent about what is happening to the types in each case.

@@ -183,7 +183,7 @@ def _get_up_layer(

return conv

def forward(self, x: torch.Tensor):
def forward(self, x: torch.Tensor) -> torch.Tensor:
Copy link
Contributor

Choose a reason for hiding this comment

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

Very Nice! Thanks

- Enable as many checks as possible
- Allow redefinition for mypy to match pytype
- Allow redefinition for pythonic code
@hjmjohnson
Copy link
Contributor

@benjamin-gorman This needs updating again based on recent merges.

Benjamin Gorman added 3 commits August 4, 2020 11:06
- Update type: ignore to specify error
- Update type hints to specify contents
- Add type hints to parameters
- Add type hints to returns
- Remove unnecessary type hints
- Remove incorrect type hints
- Rename internal variables (redefinition)
- Resolve errors as a result of the above
- Stick with no redefinition for stricter, explicit typing
@ghost ghost force-pushed the reconfigure-checks branch from 52a6981 to 974f14e Compare August 4, 2020 16:10
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thank you and sorry for the delay :)

@wyli wyli merged commit b154f58 into Project-MONAI:master Aug 4, 2020
@ghost ghost deleted the reconfigure-checks branch August 4, 2020 18:00
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.

2 participants