-
Notifications
You must be signed in to change notification settings - Fork 768
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
Pylance slow to analyze files even in "simple" example #4514
Comments
I'm not familiar with the If this library is important to you, I recommend contacting the maintainers and requesting that they add static type annotations to the public interface. Most major Python libraries (e.g. numpy, torch, and tensorflow) have done so over the past few years. We're prepared this documentation to provide guidance to library maintainers who are interested in making this investment. |
@erictraut maybe spending a lot of time figuring out np.array overloads
note need to run 'pip install uncertainties' note clear where the time is spent.. maybe in a different part of typeEvaluator that I dont have a logger in.
|
Thanks for having a look! import numpy as np
def foo(array: np.ndarray):
return np.concatenate(([-np.inf], array, [np.inf]))
def foo2(array: np.ndarray):
return np.concatenate(([-np.inf], array, [np.inf]))
def foo3(array: np.ndarray):
return np.concatenate(([-np.inf], array, [np.inf])) So while uncertainties not having type hints certainly has some impact, the main issue seems to be somewhere with numpy. Logs in case it helps in this toggle block
|
The issue has been addressed in pyright 1.1.317, You can find more information in this issue. I've also tried with pyright 1.1.317 and the analysis time has dropped significantly on my machine. The fix will be available in pylance once pyright 1.1.317 is included. |
Thanks! Replacing pylance by the pyright extension (which ships with pyright v1.1.318) for now indeed fixes the issues (also in my actual projects). |
Environment data
Code Snippet
Some simple synthetic example I could come up with:
Repro Steps
Expected behavior
Actual behavior
Logs
The text was updated successfully, but these errors were encountered: