-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This looks good to me at a glance - is there still interest in merging this? It's currently marked as draft. |
I'd still like to see this, or something like it, merged! |
d623524
to
3b60169
Compare
3b60169
to
81f6ba3
Compare
lib/matplotlib/figure.pyi
Outdated
@@ -25,6 +25,9 @@ from matplotlib.lines import Line2D | |||
from matplotlib.patches import Rectangle, Patch | |||
from matplotlib.text import Text | |||
from matplotlib.transforms import Affine2D, Bbox, BboxBase, Transform | |||
if TYPE_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
Thank you! |
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 type checking, I am currently using [ty](https://docs.astral.sh/ty/) -- it lines up well with Ruff in terms of being really fast. However, ty is not quite production ready, so support for it in pre-commit and other tools is not quite ready yet (e.g., ALE: dense-analysis/ale#4971). However, I found it mostly sufficient for my purposes. In the future, the goal will be to add type annotations everywhere else in 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 will accomplish. --> - [x] Add ty to dev deps - [x] Add ty to pre-commit -- see astral-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; see matplotlib/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