From: Ian T. <ian...@gm...> - 2014-01-28 08:59:30
|
Hi Nathan, To deal with your immediate problem of not wanting to see the deprecation warnings you can continue to use matplotlib.delaunay and suppress the warnings using e.g. http://docs.python.org/2/library/warnings.html#temporarily-suppressing-warnings. This will be OK for a year or two, but eventually we will completely remove matplotlib.delaunay. It will however give you time to come up with a solution. The short answer is 1) replace all use of matplotlib.delaunay.Triangulation with matplotlib.tri.Triangulation, and 2) use some other form of interpolation than natural neighbour! Matplotlib has linear and cubic triangular grid interpolators ( http://matplotlib.org/dev/api/tri_api.html); if these are acceptable your code changes should be minimal. scipy.interpolate has a few more options (but no natural neighbour) which will be a little more work. Even if you were to like the natgrid approach I would steer you away from it as I can see us removing it completely from matplotlib sometime in the future. Alternatively you could incorporate the matplotlib.delaunay code into your project and hence carry on using it as you are, but this would be madness as you would have to deal with the building of a C python extension, plus the delaunay code is 'not very robust'. You will no doubt have observed this to be the case, and it is the reason why matplotlib and scipy have moved away from it to use qhull instead. I expect we will add more triangular grid interpolators to matplotlib in due course and I am happy to receive suggestions on this. However, this will not include natural neighbour. Natural neighbour interpolation is specific to delaunay triangulation, and as we also support user-specified triangulations I am only interested in interpolation that covers all triangulations. I hope this has been of some help, but I fear not... Ian Thomas |