Skip to content

Typing for Lightning Package #7035

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

Closed
wants to merge 34 commits into from
Closed

Typing for Lightning Package #7035

wants to merge 34 commits into from

Conversation

justusschock
Copy link
Member

@justusschock justusschock commented Apr 15, 2021

What does this PR do?

This should enable mypy compatible typing throughout the lightning package. At some point, I had to ignore the type checks from mypy due to known issues or no good workarounds.

Resolves #5023

Completed Packages

  • lightning.accelerators
  • lightning.callbacks
  • lightning.core
  • lightning.distributed
  • lightning.loggers
  • lightning.metrics
  • lightning.overrides
  • lightning.plugins
  • lightning.profiler
  • lightning.trainer
  • lightning.tuner
  • lightning.utilities

Edit: The remaining parts will come in separate PRs to prevent this PR from becoming even larger

Open for discussion: Should we also type the tests? I don't think we have to!

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Apr 15, 2021

Hello @justusschock! Thanks for updating this PR.

Line 334:17: E731 do not assign a lambda expression, use a def

Line 259:121: E501 line too long (152 > 120 characters)

Line 91:38: E701 multiple statements on one line (colon)

Comment last updated at 2021-04-15 10:49:31 UTC

@justusschock justusschock marked this pull request as ready for review April 15, 2021 10:25
@justusschock justusschock self-assigned this Apr 15, 2021
@justusschock justusschock added docs Documentation related refactor labels Apr 15, 2021
@Borda
Copy link
Member

Borda commented Apr 15, 2021

@justusschock seems you are shooting the types very fast a file per minute, are you using some automated tool for it?

@justusschock
Copy link
Member Author

@Borda no, that's just me :D But actually that wasn't that fast. I started 2 days ago, just didn't push it all

@Borda
Copy link
Member

Borda commented Apr 15, 2021

cool, it seems to be very large, could have each sub-package as separate PR, it will be easier to check/merge and lower the change of collision in meantime...

@carmocca
Copy link
Contributor

@justusschock I had #7022 already for accelerator and plugins

@Borda
Copy link
Member

Borda commented Apr 15, 2021

@justusschock @awaelchli @carmocca pls sync on #5023 what you are working on :]

@justusschock
Copy link
Member Author

@carmocca Accelerators was easy, basically a noop :) But good to know that i don't need to do plugins :)

@tchaton tchaton mentioned this pull request Apr 15, 2021
@Borda Borda deleted the typing branch May 10, 2021 09:38
@Borda
Copy link
Member

Borda commented Jun 30, 2021

@justusschock does this has a successor PR or how this was closed? 🐰

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.

fix typing in PL codebase - multiple PRs
4 participants