Uh oh!
There was an error while loading. Please reload this page.
Add seaborn stubs - #10721
Conversation
This comment has been minimized.
This comment has been minimized.
AlexWaygood
commented
Sep 17, 2023
For the Line 152 in cecab9c If need be, we could probably just add some hacky special-casing for pandas-stubs to the function, e.g. ifreq_name=="pandas-stubs":
return ["pandas"] |
The We may need to consider adding a |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
hamdanal
commented
Sep 17, 2023
Thanks for looking into this. Should we open an issue about this to see what other maintainers say? |
AlexWaygood
commented
Sep 17, 2023
Yes, that would be great! |
This comment has been minimized.
This comment has been minimized.
I've triggered a rerun of the stub-uploader tests now typeshed-internal/stub_uploader#102 has been merged. EDIT: They pass now; just |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AlexWaygood
commented
Sep 24, 2023
All green now 🥳 though I think we should also wait for typeshed-internal/stub_uploader#103 before we can consider merging this |
hamdanal
commented
Sep 24, 2023
I'll mark the PR as "Ready for review" because it is ready for review :P. |
AlexWaygood
commented
Sep 25, 2023
typeshed-internal/stub_uploader#103 was merged 🎉 |
JelleZijlstra
commented
Oct 8, 2023
It seems like seaborn has a lot of inline types, and these stubs closely track them. Have you considered asking whether they would ship a py.typed? I don't see any discussion of that in their issue tracker. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JelleZijlstra
left a comment
There was a problem hiding this comment.
Thanks for clarifying, indeed the files outside _core are mostly not annotated. I reviewed up to cm.pyi now, mostly by spot-checking and reading along with the implementation.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| *, | ||
| hue: str | None = None, | ||
| vars: Iterable[str] | None = None, | ||
| x_vars: Iterable[str] | None = None, |
There was a problem hiding this comment.
This check seems to indicate a broader type:
if np.isscalar(x_vars):
x_vars = [x_vars]
(Same for y_vars)
There was a problem hiding this comment.
These are documented as "lists of variable names" but I annotated them as iterables because they are casted to list at runtime. The isscalar check seems to allow str to be accepted but this is already covered by Iterable[str]. I think no change is needed here?
There was a problem hiding this comment.
Doesn't feel great to rely on the fact that str is an Iterable[str], as usually that isn't what you want. As I recall pytype generally disallows str for Iterable[str]. So let's be explicit:
| x_vars: Iterable[str] |None=None, | |
| x_vars: Iterable[str] |str|None=None, |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JelleZijlstra
left a comment
There was a problem hiding this comment.
Got to the end this time! A few more comments.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
JelleZijlstra
commented
Oct 28, 2023
Thanks for your work @hamdanal! |
Requires