> > 
> > I am but a humble newbie, but why not simply take your figure
> > object/reference and Pickle it (see
> > http://docs.python.org/lib/module-pickle.html)?
> > 
> 
> Won't work.  Pickling only works for objects that have been designed for 
> it.  Such design is not trivial for extension code, and has not been 
> done for mpl.

I keep coming back to this from time-to-time and have a go a poking
around in the mpl codebase but I've never figured out exactly what state
the matplotlib "Lazy Values" and "BinOps" store. 

If this internal state could be retrieved and then later restored, then
python can pickle the extension objects using the copy-reg module. It
might be enough if methods were added to the BinOp objects to retrieve
internal objects to which they link. You could then recursively walk
through the whole lazy-value tree. To make this work, you would need to
retrieve the underlying C++ objects with it's python wrapper object
intact (i.e. with the same IDs) so that python references to that object
created elsewhere still work.

While the concept of Lazy Values is easy enough to understand,
understanding how and where these objects fit in to the MPL architecture
is hard. I think a little documentation or explanation of this could go
a long way to helping implement this. If I could understand all the
places the Lazy Values are used, I'm keen to attempt the implementation
of pickle-ability. One problem for me is my C++ knowledge is ~ 0.

BC
> 
> Eric
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to