Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
[MNT]: Add type stubs for proj3d.pyi to resolve inconsistent type ann…#30716
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
base:main
Are you sure you want to change the base?
Conversation
timhoffm left a comment
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.
Thanks for your willingness to contribute. However, please take more care when submitting a pull request. There are several errors in the types, some of which are quite obvious.
Also, please format the file appropriately. While we do not enforce strict formatting, excessive long lines and missing spaces like inM:np.ndarray reduce readability. You may run black/ruff format over the file or just look at existing .pyi files how we do this.
| def _view_transformation_uvw(u: np.ndarray, v: np.ndarray, w: np.ndarray, E:np.ndarray) -> np.ndarray: ... | ||
| def _persp_transformation(zfront: np.typing.ArrayLike, zback: np.typing.ArrayLike, focal_length: np.typing.ArrayLike) -> np.ndarray: ... |
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.
| def_persp_transformation(zfront:np.typing.ArrayLike,zback:np.typing.ArrayLike,focal_length:np.typing.ArrayLike)->np.ndarray: ... | |
| def_persp_transformation(zfront:float,zback:float,focal_length:float)->np.ndarray: ... |
| def _ortho_transformation(zfront, zback) -> np.ndarray: ... |
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.
| def_ortho_transformation(zfront,zback)->np.ndarray: ... | |
| def_ortho_transformation(zfront:float,zback:float)->np.ndarray: ... |
| def _proj_transform_vectors(vecs: np.ndarray, M: np.ndarray) -> np.ndarray: ... | ||
| def _proj_transform_vec_clip(vec: np.typing.ArrayLike, M: np.ndarray, focal_length:np.typing.ArrayLike) -> tuple[np.ndarray, np.ndarray, np.ndarray]: ... |
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.
| def_proj_transform_vec_clip(vec:np.typing.ArrayLike,M:np.ndarray,focal_length:np.typing.ArrayLike)->tuple[np.ndarray,np.ndarray,np.ndarray]: ... | |
| def_proj_transform_vec_clip(vec:np.ndarray,M:np.ndarray,focal_length:float)->tuple[np.ndarray,np.ndarray,np.ndarray]: ... |
Also the return type cannot be correct because it has 4 elements. Please fix this as well for the functions that propagate this return value.
| def _proj_transform_vec(vec: np.typing.ArrayLike, M: np.typing.ArrayLike) -> tuple[float, float, float]: ... |
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.
The return type is not correct the three tuple elements are not simple floats. Likely ndarrays, but please recheck.
| @_api.deprecated("3.10") | ||
| def proj_transform_clip(xs: np.typing.ArrayLike, ys: np.typing.ArrayLike, zs: np.typing.ArrayLike, M:np.ndarray) -> tuple[np.ndarray, np.ndarray, np.ndarray]: ... | ||
| def _proj_transform_clip(xs: np.typing.ArrayLike, ys: np.typing.ArrayLike, zs: np.typing.ArrayLike, M:np.ndarray, focal_length: np.typing.ArrayLike) -> tuple[np.ndarray, np.ndarray, np.ndarray]: ... |
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.
| def_proj_transform_clip(xs:np.typing.ArrayLike,ys:np.typing.ArrayLike,zs:np.typing.ArrayLike,M:np.ndarray,focal_length:np.typing.ArrayLike)->tuple[np.ndarray,np.ndarray,np.ndarray]: ... | |
| def_proj_transform_clip(xs:np.typing.ArrayLike,ys:np.typing.ArrayLike,zs:np.typing.ArrayLike,M:np.ndarray,focal_length:float)->tuple[np.ndarray,np.ndarray,np.ndarray]: ... |
Zrahay commentedNov 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@timhoffm I am so terribly sorry for the mistake from my end. I understand your frustration and will close my PR in some time. Thanks for the feedback! Since I am new to Open Source, your feedback is only going to help me get better. |
rcomer commentedNov 2, 2025
@Zrahay you do not need to close this PR. Please make the corrections on this branch and push them. They will show up here. |
PR summary
Adds type stub file (.pyi) for
mpl_toolkits/mplot3d/proj3d.pyto improve type checking and IDE support for 3D projection functions.closes #XXXX
PR checklist