On 8/24/07, David Tremouilles <[EMAIL PROTECTED]> wrote:
> OK I see... nothing straightforward...
>
> Best way for me is maybe to implement such a system myself:
> The system would collect the information to be saved by kind of
> introspection of the figure.
> I'm planning to save data and plot properties in an hdf5 file. Kind of
> inverted process will be used to restore the figure.
> Of course I will not cover the whole possible figure case but only
> what I'm currently using for my work.
> If somebody did similar work and is eager to share or
> if somebody have any suggestion please let me know.

A huge +1 for this approach.  Pickle is NOT meant to be a persistent,
on-disk file format, but rather a way to serialize the *current* state
of an object in memory.  Emphasis on current: if you unpickle an old
pickle in an environment where the class layout of your object (or any
object the parent holds a reference to) has changed, the unpickling
fails, completely and irrecoverably.

As someone who has already had to write pickle loader functions to
salvage old pickles (because computing them had been very expensive),
I've learned my lesson.  Pickle works well as a way to quickly
dump/load data that is either made up of simple python types *only*
(since they don't change often) or for objects that you have good
reason to expect won't be changing their API while you care about the
pickles.

But pickling is NOT a 'data format', and using it as such will
inevitably lead to much pain and suffering.  HDF5 *is* a data format.
In our project we precisely went to hdf5 instead of pickling.

Cheers,

f

-------------------------------------------------------------------------
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