Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Type annotation add_subplot for projection="3d"#29341
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dstansby commentedApr 30, 2025
This looks good to me at a glance - is there still interest in merging this? It's currently marked as draft. |
stefanv commentedApr 30, 2025
I'd still like to see this, or something like it, merged! |
Uh oh!
There was an error while loading.Please reload this page.
lib/matplotlib/figure.pyi Outdated
| frommatplotlib.patchesimportRectangle,Patch | ||
| frommatplotlib.textimportText | ||
| frommatplotlib.transformsimportAffine2D,Bbox,BboxBase,Transform | ||
| ifTYPE_CHECKING: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Actually, this guard is not needed in .pyi files, because they are only used for tyoechecking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
OK, removed
abda9dd intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
stefanv commentedMay 2, 2025
Thank you! |
galah92 commentedJun 14, 2025
Is there a timeline for this to be available in an official release? |
…606)## Description<!-- Provide a brief description of the PR's purpose here. -->Proof of concept for adding type annotations to pyribs. For typechecking, I am currently using [ty](https://docs.astral.sh/ty/) -- itlines up well with Ruff in terms of being really fast. However, ty isnot quite production ready, so support for it in pre-commit and othertools is not quite ready yet (e.g., ALE:dense-analysis/ale#4971). However, I found itmostly sufficient for my purposes.In the future, the goal will be to add type annotations everywhere elsein pyribs.This regex is helpful for catching docstrings that have old types:```grep -r "^ *[a-z_]* (.*):" ribs```## TODO<!-- Notable points that this PR has either accomplished or willaccomplish. -->- [x] Add ty to dev deps- [x] Add ty to pre-commit -- seeastral-sh/ty#269- [x] Skip ty in pre-commit CI- [x] Add ty instructions to docs- [x] Add type annotations in ribs.visualize- [x] Matplotlib imports in ribs.visualize had to be made more specific;see notes on submodules here:astral-sh/ty#445- [x] `plt.axes(projection="3d")` isn't typed for the correct `Axes3D`object, so I had to add some ignores; seematplotlib/matplotlib#29341- [x] Add py.typed and include it in MANIFEST.in## Status- [x] I have read the guidelines in[CONTRIBUTING.md](https://github.com/icaros-usc/pyribs/blob/master/CONTRIBUTING.md)- [x] I have linted and formatted my code with `ruff`- [x] I have tested my code by running `pytest`- [x] I have added a description of my change to the changelog in`HISTORY.md`- [x] This PR is ready to go
This is a proof-of-concept PR to address#29334