[yt-dev] Issue #764: matplotlib.delaunay deprecated in matplotlib 1.4 (yt_analysis/yt)

Nathan Goldbaum issues-reply at bitbucket.org
Sat Jan 25 00:30:12 PST 2014


New issue 764: matplotlib.delaunay deprecated in matplotlib 1.4
https://bitbucket.org/yt_analysis/yt/issue/764/matplotlibdelaunay-deprecated-in

Nathan Goldbaum:

When running with the current matplotlib github master, importing yt produces the following error:

```
/Users/goldbaum/Documents/matplotlib/lib/matplotlib/cbook.py:133: MatplotlibDeprecationWarning: The matplotlib.delaunay module was deprecated in version 1.4. Use matplotlib.tri.Triangulation instead.
```

We use matplotlib.delaunay in three places:

```
goldbaum at ROUS in ~/Documents/yt-hg on yt-3.0 at tip?
☿ grin matplotlib.delaunay
./yt/visualization/plot_modifications.py:
  254 :         from matplotlib.delaunay.triangulate import Triangulation as triang
./yt/visualization/plot_types.py:
  539 :         import matplotlib.delaunay.triangulate as de
./yt/visualization/plot_window.py:
   23 : from matplotlib.delaunay.triangulate import Triangulation as triang
```

I attempted to patch this, hoping it would be quick, but unfortunately it looks like the underlying Triangulation class has a somewhat different API now.  For example [this example](https://bitbucket.org/yt_analysis/yt/src/84b551a47ac462d646963f0b13e4dd0e85bd9751/yt/visualization/plot_modifications.py?at=yt#cl-311) from `plot_modifications.py` no longer works:

```
zi = self.triang(x,y).nn_interpolator(z)(xi,yi)
```

because nn_interpolator is no longer defined in the new interface.

There's some explanatory background on this in the matplotlib PR that deprecates matplotlib.delaunay:

https://github.com/matplotlib/matplotlib/pull/2504

which seems to indicate that nearest-neighbor interpolations has been completely removed from matplotlib...





More information about the yt-dev mailing list