[Scipy-tickets] [SciPy] #376: [PATCH] sandbox.delaunay crashes on duplicate points

SciPy scipy-tickets@scipy....
Mon Mar 5 07:00:14 CST 2007


#376: [PATCH] sandbox.delaunay crashes on duplicate points
--------------------+-------------------------------------------------------
 Reporter:  pv      |        Owner:  somebody
     Type:  defect  |       Status:  new     
 Priority:  normal  |    Milestone:          
Component:  Other   |      Version:  0.5.2   
 Severity:  normal  |   Resolution:          
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by pv):

 It turns out that the above patches do not fix the problem, there are
 still some issues with the algorithm.

 Triangulation fails for the attached data file ''data.txt'', which
 basically is an equispaced grid [-pi,pi]x[-pi,pi]. All data points are
 well-separated, but some are jittered off the exact grid positions by some
 machine epsilons.

 I now get that (both patched and unpatched delaunay)
 {{{
 import scipy as S
 import delaunay
 S.pkgload('io')

 data = S.io.read_array('data.txt')
 tri = delaunay.Triangulation(data[:,0], data[:,1])
 }}}
 results to
 {{{
 Traceback (most recent call last):
   File "test.py", line 6, in ?
     tri = delaunay.Triangulation(data[:,0], data[:,1])
   File
 "/home/pauli/tmp/scipy/Lib/sandbox/delaunay/build/lib.linux-x86_64-2.4/delaunay/triangulate.py",
 line 68, in __init__
     self.hull = self._compute_convex_hull()
   File
 "/home/pauli/tmp/scipy/Lib/sandbox/delaunay/build/lib.linux-x86_64-2.4/delaunay/triangulate.py",
 line 89, in _compute_convex_hull
     hull.append(edges.pop(hull[-1]))
 KeyError: 0
 }}}

 Rounding the jitter off the data fixes this problem.

-- 
Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/376#comment:4>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list