Fernando Perez wrote:
> On Mon, Jul 7, 2008 at 10:28 AM, Michael Droettboom <[EMAIL PROTECTED]> wrote:
>   
>> Thank you for finding this!  That is indeed the case.
>>
>> I think we need to rework the plot generation code to avoid side effects
>> by forcibly resetting state between plots.  Maybe we should just fork
>> another Python process for each plot.  Darren, since (I believe) you
>> wrote the initial documentation plotting code, do you have any thoughts?
>>     
>
> Isn't that unnecessarily slow?  Why not have each plot simply make a
> call to load a clean state?  rc_defaults() or somesuch?  This little
> call could even be auto-run by the doc generation code, without
> requiring a full process restart.
>   
Agreed, and that does seem to fix this particular issue.
> Basically I think MPL should be stateless enough to tolerate working
> in a long-lived process with repeatable results. Anything else should
> be considered a bug IMHO ;) (I know rcParams is precisely a stateful
> system, but it should be trivial to obtain a known clean state always,
> with a single call).
>   
For the most part, I think that's correct.  There are still some 
lingering uses where certain objects and values are cached at startup 
time based on rcParams.  (For example, in backend_pdf, and some things 
mathtext used to do).  But that's sort of a different issue, because 
there the problem is with some values being immutable after startup, not 
being unable to reset back to the startup state.

Cheers,
Mike

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to