Skip to content
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

BUG: fix Vor/Delaunay segfaults #20633

Merged
merged 1 commit into from
May 3, 2024

Conversation

tylerjereddy
Copy link
Contributor

  • Deals with the spatial part of BUG: scipy.spatial.Delaunay, scipy.interpolate.LinearNDInterpolator segfault on invalid shapes #20623 (Voronoi was also affected beyond the originally-reported Delaunay segfault).

  • Both classes are documented to accept arrays with two dimensions only, so raise a ValueError in cases with other dimensions to avoid the segfault.

  • Other potential points of confusion here are the differences between arrays with two dimensions and two dimensional arrays that represent generators with more than two dimensions via the number of columns, but this is just how things are for most array programming languages of course. Also, the docs don't explicitly say array-like for the generators I don't think, but this patch only worked if I placed it after the coercion to array type.

[skip circle]

* Deals with the `spatial` part of scipygh-20623 (`Voronoi`
was also affected beyond the originally-reported `Delaunay`
segfault).

* Both classes are documented to accept arrays with two dimensions
only, so raise a `ValueError` in cases with other dimensions to
avoid the segfault.

* Other potential points of confusion here are the differences
between arrays with two dimensions and two dimensional arrays
that represent generators with more than two dimensions via
the number of columns, but this is just how things are for
most array programming languages of course. Also, the docs
don't explicitly say array-like for the generators I don't think, but this patch
only worked if I placed it after the coercion to array type.

[skip circle]
@tylerjereddy tylerjereddy added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.spatial backport-candidate This fix should be ported by a maintainer to previous SciPy versions. labels May 2, 2024
@github-actions github-actions bot added the Cython Issues with the internal Cython code base label May 2, 2024
@tylerjereddy tylerjereddy added this to the 1.14.0 milestone May 2, 2024
@ev-br ev-br merged commit c100886 into scipy:main May 3, 2024
31 checks passed
@ev-br
Copy link
Member

ev-br commented May 3, 2024

LGTM. Merged, thanks Tyler

@tylerjereddy tylerjereddy deleted the treddy_issue_20623_spatial branch May 3, 2024 12:44
@tylerjereddy tylerjereddy modified the milestones: 1.14.0, 1.13.1 May 5, 2024
@tylerjereddy tylerjereddy mentioned this pull request May 5, 2024
10 tasks
@tylerjereddy tylerjereddy removed the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cython Issues with the internal Cython code base defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.spatial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants