-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Scikit-learn has autocomplete type "module" when it should seemingly be "function" #1486
Comments
Jedi version? |
I doubt that this is a Jedi issue. This might be a JupyterLab issue or you might have an old version. Closing, because this is probably not a Jedi issue, but happy to help you find your issue, so feel free to keep responding. |
Thank you @davidhalter -- Jupyter installed Jedi version 13 automatically, so manually upgrading to version 16 solved the problem for me.
For some background, I'm working on a drag-n-drop graphical programming application that first converts functions and classes into a set of "nodes" with ports representing inputs/outputs. The first step is to create the full set of nodes, so it would be great to have this JSON file to cache and work with. It would also be very useful to have both the parameter type and value... I browsed issue #1039 and it seems that both parameter type and value might not be available yet? |
I'm not sure you need type inference. If you don't, you don't need to use Jedi. Just use https://github.com/davidhalter/parso. It's what Jedi uses as well to parse source code. Does that make sense? |
The type inference is necessary for my application in order to know whether an output is compatible with an input on these nodes. For example, if one function returns type "bool" and another accepts type "int" for a specific parameter, I need to leverage that type information in order to prevent a user connecting ports with different types. |
Yeah, I can probably not help you with that. In some distant future, #1059 might be a good option for you. But for now this is just not really working. Mostly for performance reasons I decided not to make certain APIs public. Maybe |
Speaking of |
It's definitely defined on master. I just checked again. |
Yes, you're right - I foolishly did not uninstall my PyPI installed version before installing the repo-built version and my environment was still picking up the old install. Thanks! |
@gramster Do you have a specific usage in mind for this? |
Hi @davidhalter, I'm also not seeing the type (module/class/function) for this Tensorflow autocomplete, and the Interpreter returns empty: I'm using Jedi 0.16.0 Please let me know what could be the reason/workaround, as it's important for my application, thank you! |
Can you give me |
|
I'll get back to you. But please don't take pictures anymore of stuff. I want to copy things, this way I have to re-type it ;-). |
Thanks for the support. And you got it, no more screenshots. |
Can you retry with 0.17.0, just so we are sure that it wasn't fixed along the line? |
Hi, I just tried 0.17.0, but unfortunately |
Just checked again why this is happening: Tensorflow 2.1.0 uses a directory that pretty much contains nothing (especially no keras folder). It then modifies the sys modules (see code below). Sys module modifications are not understood by Jedi. And if you read the code below, you can probably understand why. So if don't undo this change, I guess they should just write stubs. For now I'm not going to do anything. This is an issue with tensorflow code IMO. Most of the time these kind of structures are pretty stupid and don't really provide a benefit.
|
Please let us continue the tensorflow discussion in #1391. |
Hi, I'm wondering why, for example,
load_iris
insklearn
is being autocompleted with a type "module" instead of a "function"? I'm building an application that uses this type information, so it causes me a problem that the type isn't what I expect.load_iris
documentation: https://scikit-learn.org/stable/modules/generated/sklearn.datasets.load_iris.html#sklearn.datasets.load_irisBelow I have a screenshot showing use of the autocomplete in JupyterLab:
![image](https://user-images.githubusercontent.com/15185105/73460291-40abe400-4346-11ea-833c-b3695c2d7579.png)
Screenshot from load_iris source code (https://github.com/scikit-learn/scikit-learn/blob/b194674c42d54b26137a456c510c5fdba1ba23e0/sklearn/datasets/_base.py#L326):
![image](https://user-images.githubusercontent.com/15185105/73460885-3a6a3780-4347-11ea-950a-0e40f1b3a61a.png)
The text was updated successfully, but these errors were encountered: