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

added warning for None dataloader #1745

Merged
merged 4 commits into from
May 7, 2020

Conversation

ybrovman
Copy link
Contributor

@ybrovman ybrovman commented May 5, 2020

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

This is follow up PR from PR #1560. Logs a warning if there are any validation dataloaders that are None.

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented May 5, 2020

Hello @ybrovman! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-05-06 15:17:45 UTC

@mergify mergify bot requested a review from a team May 5, 2020 23:32
@codecov
Copy link

codecov bot commented May 5, 2020

Codecov Report

Merging #1745 into master will decrease coverage by 0%.
The diff coverage is 75%.

@@          Coverage Diff           @@
##           master   #1745   +/-   ##
======================================
- Coverage      88%     88%   -0%     
======================================
  Files          69      69           
  Lines        4156    4161    +5     
======================================
+ Hits         3666    3670    +4     
- Misses        490     491    +1     

raise MisconfigurationException(
f'Your {mode}_dataloader has shuffle=True, it is best practice to turn'
' this off for validation and test dataloaders.')
dataloadersClean.append(loader)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be dataloaders_clean, i'm surprised our pep8speaks bot didn't mention this
https://www.python.org/dev/peps/pep-0008/#function-and-variable-names

@mergify mergify bot requested a review from a team May 6, 2020 00:21
f'Your {mode}_dataloader has shuffle=True, it is best practice to turn'
' this off for validation and test dataloaders.')
dataloaders_clean.append(loader)
else:
Copy link
Member

Choose a reason for hiding this comment

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

I would keep the previous logic and here add simply:

if any([dl is None for dl in dataloaders]):
    rank_zero_warn("One of given dataloaders is None and it will be skipped.")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok sure, makes sense

@mergify mergify bot requested a review from a team May 6, 2020 14:44
@Borda Borda added docs Documentation related ready PRs ready to be merged labels May 6, 2020
@Borda Borda added this to the 0.7.6 milestone May 6, 2020
@mergify mergify bot requested a review from a team May 6, 2020 15:47
@mergify mergify bot requested a review from a team May 7, 2020 01:40
@williamFalcon williamFalcon merged commit 3a64260 into Lightning-AI:master May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants