John Hunter wrote: > On Mon, Jan 26, 2009 at 8:40 AM, Michael Droettboom <md...@stsci.edu> wrote: > >> Support for handling NaNs in curves is now on the branch and trunk. >> >> While this solves the infinite recursion problem, it still may be better in >> your specific case to use a CirclePolygon. All my fix does is remove an >> entire bezier curve when any of its elements are non-finite -- so we're >> talking an entire eighth-wedge at least here. By using CirclePolygon, the >> amount of removal could be much less. >> > > While I think it's great that you fixed this with a scapel rather than > my blunt hammer of simply dropping the patch, I wonder if we should be > expecting the backends to handle nans. The general philosophy has > been to keep them as simple as possible, and nan handling is > definitely not simple. Most likely we would pay a price in efficiency > by moving the nan handling to the frontend, but would we be better off > passing a nan-filtered path to the backend? > I don't see this as a backend/frontend issue -- I see it as a C++/Python one.
This recent change was in C++ (in PathIterator), which is generic and not specific to Agg, other than some conventions. For the Python backends, this is handled by Path.iter_vertices. This separation of NaN-handling (in C++ and in Path.iter_vertices) has been there for ages. In fact, the non-C++ backends have supported NaNs on curves for a long time (though with a small corner-case bug that's now fixed). The Cocoa backend should probably use the common NaN-handling and simplification code, but that may require using Objective-C++, rather than just Objective-C. Alternatively, we could rewrite the NaN-handling/simplification code to use pure C, with a little shim to make it work in the highly-templatized C++ Agg world. We could (as we do now for simplification) call out to C++ for NaN-handling as well, but I would be wary of doing the opposite. Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users