On Fri, Jul 18, 2008 at 10:11 AM, Jeff Whitaker <[EMAIL PROTECTED]> wrote:
> I'd like to see griddata functionality and Ryan May's wind barb patch in > 0.98.3. OK things seem to be moving pretty fast right now on several fronts, so we may want to wait until mid next week before pushing anything out. Robert and I exchanged a few emails last night about his delaunay code. We have two choices on the dependency -- require an external scikits.delaunay that the user will install, or ship it *internally* in matplotlib, eg as matplotlib.delaunay (he is not too keen to see us repeat the mistakes we made with enthought.traits installing it ourselves externally). I prefer the matplotlib.delaunay solution since many win32, os x or naive users will not be comfortable with the svn download and source install. But Robert pointed out to me that one reason he has avoided pushing this further, eg into scipy, is that there are known degenerate cases arising from floating point precision issues that need to be worked out He wrote: My apologies, it does not segfault; it just returns an impossible triangulation. def test_slightly_degenerate(self): data = np.array([[-1, -1], [-1, 0], [-1, 1], [ 0, -1], [ 0, 0], [ 0, 1], [ 1, -1 - np.finfo(np.float_).eps], [ 1, 0], [ 1, 1], ]) tri = dlny.Triangulation(data[:,0], data[:,1]) I thought it possible that one of our developers may be interested in working on this, and he gave the following advice: Basically, Fortune's sweepline algorithm for Delaunay triangulation simply needs to be replaced with an algorithm that can be formulated using Jonathan Shewchuck's robust predicates: http://www.cs.cmu.edu/~quake/robust.html Divide and conquer or incremental insertion are reasonable candidates. Personally, I am willing to include the code in its current imperfect form in mpl with your griddata wrapper, provided that we make clear in the docstring that there are known degenerate cases (eg include Robert's example). Caveat emptor: this is an oft requested piece of code and I think many users would like to have something that works in most cases. But I think everyone would be well served by having a bullet-proof algorithm and Robert won't have time to work on this in the upcoming months, so perhaps one of us could spend some time looking at following Robert's suggestion and incorporating Jonathan Shewchuck's robust predicates into the implementation. So my advice is: let's fold the delaunay code into matplotlib.delaunay for 0.98.3 while providing copious warnings in your griddata interface, and get to work improving the algorithm for future releases, making sure we send Robert patches to the scikit.delaunay module if we manage to do anything useful so his implementation will remain the official branch as long as he wants it to be. If everyone agrees with this plan, I'll assume you'll take the lead on importing the code, and providing some examples/tests. And we can hold for Ryan's wind barbs too -- it looks like Eric is on the case. JDH ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel