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

Fix support for dataclasses with ClassVar/InitVar in apply_to_collection #9702

Merged
merged 15 commits into from Nov 10, 2021

Conversation

a-gardner1
Copy link
Contributor

@a-gardner1 a-gardner1 commented Sep 25, 2021

What does this PR do?

Adds/fixes support for ClassVar and InitVar fields in dataclasses to apply_to_collection

Fixes #9208

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

None

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 internal minor changes/refactorings)

PR review

Anyone in the community is welcome to review the PR.
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 🙃

@codecov
Copy link

codecov bot commented Sep 25, 2021

Codecov Report

Merging #9702 (fc77d6c) into master (45f6a3b) will decrease coverage by 4%.
The diff coverage is 94%.

❗ Current head fc77d6c differs from pull request most recent head 50db279. Consider uploading reports for the commit 50db279 to get more accurate results

@@           Coverage Diff           @@
##           master   #9702    +/-   ##
=======================================
- Coverage      93%     89%    -4%     
=======================================
  Files         181     181            
  Lines       16370   16381    +11     
=======================================
- Hits        15144   14526   -618     
- Misses       1226    1855   +629     

tests/utilities/test_apply_func.py Outdated Show resolved Hide resolved
tests/utilities/test_apply_func.py Outdated Show resolved Hide resolved
tests/utilities/test_apply_func.py Outdated Show resolved Hide resolved
@awaelchli awaelchli added the bug Something isn't working label Sep 26, 2021
@awaelchli awaelchli added this to the v1.4.x milestone Sep 26, 2021
@awaelchli awaelchli changed the title Fix support for dataclasses with ClassVar/InitVar in apply_to_collection.' Fix support for dataclasses with ClassVar/InitVar in `apply_to_collection? Sep 26, 2021
@awaelchli awaelchli changed the title Fix support for dataclasses with ClassVar/InitVar in `apply_to_collection? Fix support for dataclasses with ClassVar/InitVar in apply_to_collection Sep 26, 2021
CHANGELOG.md Outdated Show resolved Hide resolved
@tchaton
Copy link
Contributor

tchaton commented Oct 19, 2021

Dear @a-gardner1,

Would you mind resolving the conflicts ?

Best,
T.C

@a-gardner1
Copy link
Contributor Author

Dear @a-gardner1,

Would you mind resolving the conflicts ?

Best, T.C

Sure. Just a heads-up, though, that I'm unlikely to have time to get back to this before November.

@carmocca carmocca modified the milestones: v1.4.x, v1.6.x Oct 27, 2021
@awaelchli awaelchli modified the milestones: v1.6.x, 1.5.x Nov 3, 2021
…s-initvar

Conflicts resolved:
	CHANGELOG.md
	pytorch_lightning/utilities/apply_func.py
	tests/utilities/test_apply_func.py
@mergify mergify bot removed the has conflicts label Nov 6, 2021
@carmocca
Copy link
Member

carmocca commented Nov 7, 2021

Approved the CI to run - you can ping me on Slack if you need it again. It's no longer necessary after the first contribution.

@a-gardner1
Copy link
Contributor Author

I cannot reproduce the failed test. To the best of my knowledge, it does not use anything that this PR has modified.

Local environment vs failed CI environment:

  • CentOS 8.2.2004 vs Ubuntu 18.0.4,
  • Python 3.9.8 vs Python 3.9.7,
  • torch 1.10.0 vs torch 1.10.0

@mergify mergify bot added the ready PRs ready to be merged label Nov 9, 2021
@carmocca carmocca self-assigned this Nov 9, 2021
@mergify mergify bot added the has conflicts label Nov 9, 2021
@mergify mergify bot removed the has conflicts label Nov 9, 2021
@carmocca carmocca enabled auto-merge (squash) November 10, 2021 04:10
@carmocca carmocca merged commit ce149f6 into Lightning-AI:master Nov 10, 2021
awaelchli added a commit that referenced this pull request Nov 10, 2021
…tion` (#9702)

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
lexierule pushed a commit that referenced this pull request Nov 16, 2021
…tion` (#9702)

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
Raalsky pushed a commit to neptune-ai/pytorch-lightning that referenced this pull request Nov 23, 2021
…tion` (Lightning-AI#9702)

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: Carlos Mocholi <carlossmocholi@gmail.com>
@rohitgr7 rohitgr7 mentioned this pull request Feb 7, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dataclass ClassVars are not correctly handled in apply_to_collection
5 participants