Personally, I like the use of decorators for this -- it seems to be a nice clean tool for the job -- but it could be controversial. Fortunately, this is a nice self-contained usage that could be considered an experimental foray into decorators, and it doesn't affect outward-facing code.
As for a mechanism to register before/after draw callbacks, I think what you've done already certainly paves the way for that. Callbacks in general are something that we've looked at using Enthought Traits for. I don't know if that's applicable here, but I would be nice to use something general and consistent for all callbacks in mpl so they all look and behave the same. Since we haven't really settled on that, it's no major shortcoming that your patch doesn't address that yet. It will now be much easier when we do. (And yes, it was only the start/stop rendering pair in QuadMesh that I was referring to pulling out.) Thanks, Mike Eric Bruning wrote: > I've added get/set_rasterized in Artist. > > The decorator is called @hook_before_after_draw. I wanted to put in a > mechanism that allowed for registration of before/after draw > callbacks, but couldn't figure out how. Might still be possible with > some decorator magic that I don't understand. Each artist with a > draw(self, renderer) method has been decorated. > > I pulled out the start/stop rendering pair in QuadMesh. I presume > those two lines were all I needed to touch. I'll assume so unless I > hear otherwise. > > Patch at: > http://deeplycloudy.com/patches/20080507-mpl-mixed-mode-decorator-r5110.diff > > (I moved the patch mentioned at the beginning of this thread into the > patches directory as well.) > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Matplotlib-devel mailing list > Matplotlib-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- 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 the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel