pyjanitor-devs / pandas_flavor

The easy way to write your own flavor of Pandas
https://zsailer.github.io/software/pandas-flavor/
MIT License
298 stars 17 forks source link

Autocomplete in IDE #1

Open hmelberg opened 6 years ago

hmelberg commented 6 years ago

First of all thank you for making pandas_flavor. It is very useful.

One issue: Is it possible to make it so that registering the method also enables tab/autocomplete for that method in some common IDEs (spyder, pycharm, vs)?

Relevant link: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000665110-auto-completion-for-dynamic-module-attributes-in-python

Registering the method in the dir may also work?

Again, thank you for pandas_flavour.

Zsailer commented 6 years ago

Hi @hmelberg,

Thanks for pointing out this issue. You're absolutely right, this needs to be added! It would make pandas_flavor so much more useful.

I'm currently finishing up my doctoral work-- I'm actually defending in two days. So I won't get a chance to dive into this issue for a few days. However, I'd love to see this feature land in pandas_flavor soon.

If you have any interest in adding this feature, that would be great! I can help with the PR. No pressure either way.

Otherwise, I'll try to add fix this issue in the next couple of weeks. I'm planning to talk about this project (among others) with developers at SciPy in July.

hmelberg commented 6 years ago

Some good news: Tab/Autocompletion works in IPython (so the tab-completion works in the console in Spyder or Jupyter notebook), but it does not work in the IDE itself.

It may be difficult to make it work since it is really a problem related to the IDE and package doing the autocompletion (often jedi) and it does not pick up on methods that are added after an import. I do not know if it is possible to get around the issue.

edited: typos

Zsailer commented 6 years ago

Looking at this again, I think you're right--this is specific to IDEs. Most autocomplete engines should be able to handle the addition of methods after import with no problems (i.e., IPython uses Jedi).

However, it's likely that this feature is turned off in IDE's to save on performance. Environments like IPython and Jupyter can assume that code cells won't get too large. Each block is it's own smaller chunk of code. Programs like Jedi process each cell separately and quickly.

In an IDE, however, scripts may get really large. Perhaps running Jedi on these files may bog down the editor?

This is all speculation, of course. I know very little about IDE development.

Zsailer commented 4 years ago

I'm cross-linking ericmjl/pyjanitor#660 where there is discussion around higher-order autocomplete using Jedi with pandas extensions.

This might be something we could add to pandas-flavor that would improve the extension API of pandas.