Skip to content

Commit

Permalink
BUG: qhull: allow propagating exceptions out of _get_delaunay_info
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Jun 4, 2012
1 parent 07b0a87 commit 24ad9d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scipy/spatial/qhull.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ ctypedef struct DelaunayInfo_t:
double *max_bound
double *min_bound

cdef void _get_delaunay_info(DelaunayInfo_t *, obj,
int compute_transform,
int compute_vertex_to_simplex)
cdef int _get_delaunay_info(DelaunayInfo_t *, obj,
int compute_transform,
int compute_vertex_to_simplex) except -1

#
# N-D geometry
Expand Down
10 changes: 6 additions & 4 deletions scipy/spatial/qhull.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1261,10 +1261,10 @@ def tsearch(tri, xi):
# Delaunay triangulation interface, for low-level C
#------------------------------------------------------------------------------

cdef void _get_delaunay_info(DelaunayInfo_t *info,
obj,
int compute_transform,
int compute_vertex_to_simplex):
cdef int _get_delaunay_info(DelaunayInfo_t *info,
obj,
int compute_transform,
int compute_vertex_to_simplex) except -1:
cdef np.ndarray[np.double_t, ndim=3] transform
cdef np.ndarray[np.npy_int, ndim=1] vertex_to_simplex
cdef np.ndarray[np.double_t, ndim=2] points = obj.points
Expand Down Expand Up @@ -1295,3 +1295,5 @@ cdef void _get_delaunay_info(DelaunayInfo_t *info,
info.vertex_to_simplex = NULL
info.min_bound = <double*>min_bound.data
info.max_bound = <double*>max_bound.data

return 0

0 comments on commit 24ad9d0

Please sign in to comment.