I'm using a PetscBag to store the input parameters of my program. At some point, I'm going to need to use python to plot these parameters against some output parameters, and dicts along with matplotlib seem to be the way to go with this.
Basically, I want to use PetscBagView() or something like it to write a petsc bag to a file, and then use some python thing (built-in part of the standard library, external package especially for this purpose, whatever works) to read it into a dict. The idea is to make it easy to write matplotlib code that plots various input parameters against certain output parameters.
If dicts are the wrong thing to use for plotting the inputs of several simulations against their outputs, what should I use?
Is there an easy way to read a (binary or ascii) serialized PetscBag into python as a dict ?
structmodule the in the Python standard library. You can check the source code for PetscBagView to get an idea of how to unpack it. I think Matt implemented this functionality so he might have a more complete answer. – Aron Ahmadia Apr 11 '12 at 22:09