Has nxutils been removed from mpl?

Hi,
I've had an import error with some of my code, specifically with nxutils (I need
it for using points_inside_poly).

In [1]: import matplotlib.nxutils as nx

···

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/home/jscandal/<ipython-input-1-c56b9729b42e> in <module>()
----> 1 import matplotlib.nxutils as nx

ImportError: No module named nxutils

I built mpl from trunk and tried also version 1.1 from my distro, but neither
seems to have nxutils. I still find the examples in the docs using it, though,
so I am confused.
Has nxutils been replaced or removed?

Thanks

Jorge

Last I heard, it was supposed to be deprecated in master (although it was accidentially removed at one point). Indeed, it appears to be missing from the current master. The deprecation process must be followed! Personally, I think such removal is short-sighted (nxutil’s functions are much faster than their python counter-parts).

However, it was still in v1.1.x. I suspect that when you tested v1.1.x, you were really running the source build. Verify which version you are testing with:

import matplotlib
print matplotlib.version

print matplotlib.file

Ben Root

···

On Wed, Mar 7, 2012 at 10:46 AM, Jorge Scandaliaris <jorgesmbox-ml@…1664…> wrote:

Hi,

I’ve had an import error with some of my code, specifically with nxutils (I need

it for using points_inside_poly).

In [1]: import matplotlib.nxutils as nx


ImportError Traceback (most recent call last)

/home/jscandal/ in ()

----> 1 import matplotlib.nxutils as nx

ImportError: No module named nxutils

I built mpl from trunk and tried also version 1.1 from my distro, but neither

seems to have nxutils. I still find the examples in the docs using it, though,

so I am confused.

Has nxutils been replaced or removed?

Thanks

Jorge

I agree that the deprecation process should have been followed
better. However, I’m not sure what you mean by them being faster
than their Pyhton counterparts. Both functions in nxutils are
replaced by functions in _path.cpp, which are also written in C++
but are more complete and don’t have broken corner cases. They may
be slightly slower because they have a few more checks and handle
Bezier curves, but they are not significantly slower.

Mike
···

On 03/07/2012 11:59 AM, Benjamin Root wrote:

    On Wed, Mar 7, 2012 at 10:46 AM, Jorge > Scandaliaris <jorgesmbox-ml@...1664...> >         wrote:

Hi,

      I've had an import error with some of my code, specifically

with nxutils (I need

      it for using points_inside_poly).



      In [1]: import matplotlib.nxutils as nx

      ImportError                               Traceback (most

recent call last)

      /home/jscandal/<ipython-input-1-c56b9729b42e> in

()

      ----> 1 import matplotlib.nxutils as nx



      ImportError: No module named nxutils



      I built mpl from trunk and tried also version 1.1 from my

distro, but neither

      seems to have nxutils. I still find the examples in the docs

using it, though,

      so I am confused.

      Has nxutils been replaced or removed?



      Thanks



      Jorge
      Last I heard, it was supposed to be deprecated in master

(although it was accidentially removed at one point). Indeed,
it appears to be missing from the current master. The
deprecation process must be followed! Personally, I think such
removal is short-sighted (nxutil’s functions are much faster
than their python counter-parts).

What about providing a python module nxutils in master (1.2) that has the same signature as the old nxutils extension code, calls the path functionality, and raises a deprecation warning with suggested a suggested code migration? And then remove it for 1.3

JDH

···

On Wed, Mar 7, 2012 at 12:31 PM, Michael Droettboom <mdroe@…120…86…> wrote:

I agree that the deprecation process should have been followed

better. However, I’m not sure what you mean by them being faster
than their Pyhton counterparts. Both functions in nxutils are
replaced by functions in _path.cpp, which are also written in C++
but are more complete and don’t have broken corner cases. They may
be slightly slower because they have a few more checks and handle
Bezier curves, but they are not significantly slower.

Yeah. I think that’s a good way out of this. I’ll file a bug and
self-assign.

Mike
···

On 03/07/2012 01:39 PM, John Hunter wrote:

    On Wed, Mar 7, 2012 at 12:31 PM, Michael > Droettboom <mdroe@...86...> >         wrote:
          I agree that the deprecation process should

have been followed better. However, I’m not sure what you
mean by them being faster than their Pyhton counterparts.
Both functions in nxutils are replaced by functions in
_path.cpp, which are also written in C++ but are more
complete and don’t have broken corner cases. They may be
slightly slower because they have a few more checks and
handle Bezier curves, but they are not significantly
slower.

    What about providing a python module nxutils in master (1.2)

that has the same signature as the old nxutils extension code,
calls the path functionality, and raises a deprecation warning
with suggested a suggested code migration? And then remove it
for 1.3

Thanks for that. As for timing, I have no hard numbers. In fact, after some checking, I just realized that my app that has been using nxutils still even though I am on master! Maybe my slowdown was a coincidence with other changes I have made?

Everyone should remember to clear out nxutils.so because the build/clean process won’t necessarially do it unless you blow away your install dir.

Ben Root

···

On Wed, Mar 7, 2012 at 12:44 PM, Michael Droettboom <mdroe@…120…86…> wrote:

On 03/07/2012 01:39 PM, John Hunter wrote:

    On Wed, Mar 7, 2012 at 12:31 PM, Michael > > Droettboom <mdroe@...86...> > >         wrote:
          I agree that the deprecation process should

have been followed better. However, I’m not sure what you
mean by them being faster than their Pyhton counterparts.
Both functions in nxutils are replaced by functions in
_path.cpp, which are also written in C++ but are more
complete and don’t have broken corner cases. They may be
slightly slower because they have a few more checks and
handle Bezier curves, but they are not significantly
slower.

    What about providing a python module nxutils in master (1.2)

that has the same signature as the old nxutils extension code,
calls the path functionality, and raises a deprecation warning
with suggested a suggested code migration? And then remove it
for 1.3

Yeah.  I think that's a good way out of this.  I'll file a bug and

self-assign.

Mike