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

[RFC] Add missing names to pl_bolts/datasets/__init__.py #493

Merged
merged 12 commits into from
Jan 19, 2021

Conversation

akihironitta
Copy link
Contributor

@akihironitta akihironitta commented Jan 4, 2021

What does this PR do?

It seems strange to me that pl_bolts/datasets/__init__.py has only dummy datasets. This PR adds missing items to the init.py to make all dataset classes (and functions) available right under pl_bolts.datasets.

In short, this PR enables:

from pl_bolts.datasets import BinaryMNIST  # This doesn't work on the current master branch.

where we have to write on the master branch:

from pl_bolts.datasets.mnist_dataset import BinaryMNIST

I'd like to merge this PR since this change can make the tests for imports in #428 easier.
If not having dataset classes in pl_bolts/datasets/__init__.py on purpose, please just close this PR...

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 your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

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 🙃

@akihironitta akihironitta added enhancement New feature or request refactoring labels Jan 4, 2021
@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #493 (a3a9f00) into master (6b2136b) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
- Coverage   77.53%   77.51%   -0.03%     
==========================================
  Files         114      114              
  Lines        6664     6670       +6     
==========================================
+ Hits         5167     5170       +3     
- Misses       1497     1500       +3     
Flag Coverage Δ
cpu 25.87% <100.00%> (+0.06%) ⬆️
pytest 25.87% <100.00%> (+0.06%) ⬆️
unittests 76.98% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pl_bolts/datasets/__init__.py 100.00% <100.00%> (ø)
pl_bolts/datasets/cifar10_dataset.py 70.96% <100.00%> (ø)
pl_bolts/models/self_supervised/amdim/datasets.py 56.89% <100.00%> (-0.74%) ⬇️
...l_bolts/models/rl/vanilla_policy_gradient_model.py 92.79% <0.00%> (-2.71%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b2136b...a3a9f00. Read the comment docs.

@akihironitta
Copy link
Contributor Author

akihironitta commented Jan 4, 2021

@Borda Do you find this change reasonable? If so, I'll move forward by adding some changes to the docs in this PR.

@Borda
Copy link
Member

Borda commented Jan 4, 2021

@Borda Do you find this change reasonable? If so, I'll move forward by adding some changes to the docs in this PR.

not sure how this helps, would it work if you have not installed all packages needed for other datamodules?

@akihironitta
Copy link
Contributor Author

@Borda Do you find this change reasonable? If so, I'll move forward by adding some changes to the docs in this PR.

not sure how this helps, would it work if you have not installed all packages needed for other datamodules?

Yes. Before #338, ModuleNotFoundError was raised as soon as modules cannot find optional packages, which led to importing problems in the past, but #338 replaced the ModuleNotFoundError with warnings, so it should work without any optional packages installed.
related diff: https://github.com/PyTorchLightning/pytorch-lightning-bolts/pull/338/files#diff-30bd8712b62d3a1204186cc19600041c03996ddd4998d1fbe567843d010c7e69

Shall I keep going then?

@akihironitta
Copy link
Contributor Author

@Borda @ananyahjha93 Would love to hear your thoughts on this.

@akihironitta akihironitta changed the title [RFC][wip] Add missing names to pl_bolts/datasets/__init__.py [RFC] Add missing names to pl_bolts/datasets/__init__.py Jan 18, 2021
@akihironitta akihironitta marked this pull request as ready for review January 18, 2021 04:29
@Borda Borda added this to the v0.3 milestone Jan 18, 2021
@Borda
Copy link
Member

Borda commented Jan 18, 2021

@akihironitta I have added nb of workers but not sure if it is the reason for failing the test...

@akihironitta
Copy link
Contributor Author

@Borda I guess this is ready to go once the tests pass in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants