-
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
np.errstate triggers error warning #15
Comments
I also have an error while loading the server, I don't know if this might be connected. I opened an issue with the full log: #17 |
Same issue with:
|
Is your |
|
In both of these cases, if you hover, is it correct that the signature displayed does not include the parameters the diagnostic is warning about? |
FYI I see similar errors. Testing Pylance on https://github.com/pydata/xarray/tree/5377687473ecb78db085b47f4f5774eb1df93970 raises a lot of errors, many related to numpy, e.g. values = np.asarray(values, dtype=dtype) # <- `dtype` here ...gives...
Also related to def transpose(self, *dims: Hashable, transpose_coords: bool = True) -> "DataArray":
# [...]
if dims:
dims = tuple(utils.infix_dims(dims, self.dims))
variable = self.variable.transpose(*dims) # <- `dims` here ...gives...
And it seems microsoft/python-language-server#1732 causes a total of 57 (!) errors in I expect these will reproduce by pulling the repo, but let me know if I can be helpful with logs etc. And thanks again for this and all of Microsoft's work on python dev tools — both open and closed source — greatly valued & appreciated & excited to see what's next! |
@max-sixty I'd appreciate a screenshot or two of the hovers on the functions with this message, just to see what signature we are inferring. That'd likely be the quickest way to narrow it down. There are two things:
This seems like a separate issue; are you saying that |
Numpy in particular is tricky because we need stubs to make it work, due to so much of the code being compiled. Thankfully they merged their stubs directly into their codebase (!!) which I believe will improve things greatly when released. |
@jakebailey when I hover I don't actually see the signature. This is what I see: For Is there a way like |
It's a fairly specific case with that file, and us using |
Thanks for the screenshots, this would confirm that the signature we find does not contain those things. Feasibly we can hide those messages (by sticking them into the "general type issues" category which is disabled in "off" mode), but there's a tradeoff as that'd prevent any other helpful messages where the signature actually is correct and you want to know the call is wrong. The best thing would be to get these signatures correct.
Yes, you can use |
I'd appreciate another issue specifically for that |
@max-sixty Sorry, I should have been more clear, it's the functions themselves I want to see, for the signatures. |
I'd also be fine with disabling numpy until their stubs are up to date! False negatives are way better than false positives, particularly in a shared project where it's difficult to add annotations. |
I think there are multiple issues being stated here. I was interested in the signature determined for The |
This issue has been fixed in version 2020.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202070-9-july-2020 |
Environment data
Expected behaviour
This
triggers an error warning in the problems pane:
while the line runs without issues.
The text was updated successfully, but these errors were encountered: