Skip to content

[data] add autocompletion to datapipes#86960

Closed
edward-io wants to merge 2 commits intopytorch:masterfrom
edward-io:master
Closed

[data] add autocompletion to datapipes#86960
edward-io wants to merge 2 commits intopytorch:masterfrom
edward-io:master

Conversation

@edward-io
Copy link
Contributor

@edward-io edward-io commented Oct 14, 2022

In REPLs (e.g. jupyter notebook) autocomplete now works:

image

even with custom data pipes:

image

Unfortunately I wasn't able to figure out how to get autocomplete to work for non-REPLs (e.g. VSCode) - may need to generate fake pyi stubs, which 1) won't work for custom datapipes and 2) is a larger project to tackle :)

@edward-io edward-io requested a review from NivekT October 14, 2022 06:25
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 14, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86960

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit ac383e5:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: dataloader release notes category label Oct 14, 2022
@edward-io edward-io requested review from ejguan and wenleix October 14, 2022 06:26
@facebook-github-bot
Copy link
Contributor

@edward-io has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@ejguan ejguan left a comment

Choose a reason for hiding this comment

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

The changes look good to me. Could you please remove the changes of submodules and fix mypy.

cc: @NivekT

Copy link
Contributor

@NivekT NivekT left a comment

Choose a reason for hiding this comment

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

LGTM! @edward-io can you check if the autocomplete is still working with VSCode or PyCharm? I believe it should still work but it doesn't hurt to double check.

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 14, 2022
@edward-io
Copy link
Contributor Author

edward-io commented Oct 14, 2022

@NivekT do you mean autocomplete for the actual methods like register_function, set_getstate_hook? looks like it still works, it relies on the actual method signatures

image

@facebook-github-bot
Copy link
Contributor

@edward-io has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@NivekT
Copy link
Contributor

NivekT commented Oct 14, 2022

@NivekT do you mean autocomplete for the actual methods like register_function, set_getstate_hook? looks like it still works, it relies on the actual method signatures

image

I assume something like .map, .batch shows up in the drop down as well?

@edward-io
Copy link
Contributor Author

edward-io commented Oct 14, 2022

I assume something like .map, .batch shows up in the drop down as well?

I don't think this has ever been supported because the static analyzer in PyCharm/VSCode can't interpret dynamic attributes, which prompted this investigation. Let me know if thats not the case.

@edward-io
Copy link
Contributor Author

discussed with @NivekT offline, he'll follow up with investigation on why pyi stubs aren't being generated properly in nightlies

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: dataloader release notes category topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants