Skip to content

ENH: Improve the scipy.spatial.qhull annotations #14214

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

Merged
merged 5 commits into from
Jun 12, 2021
Merged

Conversation

BvB93
Copy link
Contributor

@BvB93 BvB93 commented Jun 9, 2021

Reference issue

Follow up on #13313.

What does this implement/fix?

This PR implements a number of improvements to qhull annotations (see commit messages).
Most notably among them are the addition of annotations for various attributes, all of which were previously missing.

Additional information

The behavior prior to this PR (due to the missing attribute annotation):

import numpy as np
from scipy.spatial import Voronoi

point = np.array([[0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2]])
vor = Voronoi(points)

vor.regions  # error: "Voronoi" has no attribute "regions"

@BvB93
Copy link
Contributor Author

BvB93 commented Jun 10, 2021

scipy/stats/_qmc.py:892: error: unused "type: ignore" comment

There is currently an (unrelated) mypy error in stats._qmc.
I can address it here if so desired.

@rgommers rgommers added scipy.spatial static typing Items related to static typing labels Jun 12, 2021
@rgommers rgommers added this to the 1.8.0 milestone Jun 12, 2021
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Bas!


@final
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful - I can remember quite a few problems that could have been prevented by judicious use of @final.

@rgommers rgommers merged commit 359ee68 into scipy:master Jun 12, 2021
@BvB93 BvB93 deleted the qhull branch June 12, 2021 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scipy.spatial static typing Items related to static typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants