Skip to content

Conversation

@donlapark
Copy link
Contributor

@donlapark donlapark commented Jul 13, 2022

What does this PR do?

Change the type of return of tune() in pytorch_lightning/trainer/trainer.py to TypedDict. (related to #13616 and #13445)
More precisely, a new type _TunerResult, as suggested by @carmocca in #13616, has been defined in pytorch_lightning/tuner/tuning.py and assigned to the output of tune().

Does your PR introduce any breaking changes? If yes, please list them.

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 list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the 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 🙃

@donlapark donlapark changed the title Change the type of return of tune() in trainer.py to TypedDict Change the return type tune() in trainer.py to TypedDict Jul 13, 2022
@donlapark donlapark changed the title Change the return type tune() in trainer.py to TypedDict Change the return type of tune() in trainer.py to TypedDict Jul 13, 2022
@otaj otaj mentioned this pull request Jul 13, 2022
52 tasks
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

Cool!

@carmocca carmocca added this to the pl:1.7 milestone Jul 13, 2022
@carmocca carmocca added tuner code quality community This PR is from the community labels Jul 13, 2022
@mergify mergify bot added the ready PRs ready to be merged label Jul 13, 2022
@rohitgr7 rohitgr7 enabled auto-merge (squash) July 14, 2022 09:46
Copy link
Contributor

@otaj otaj left a comment

Choose a reason for hiding this comment

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

Some tests seem to be not happy with NotRequired. It seems, our typing_extensions might be too old, since we require >=4.0.0, but according to this, there was a fix for making NotRequired available within __all__ only in 4.1.0

@otaj otaj self-requested a review July 14, 2022 09:52
@carmocca
Copy link
Contributor

Then let's upgrade the minimum typing_extensions version

@rohitgr7 rohitgr7 merged commit 8f56f8e into Lightning-AI:master Jul 14, 2022
@donlapark donlapark deleted the fix_type_tuner_py branch July 15, 2022 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality community This PR is from the community ready PRs ready to be merged tuner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants