[petsc-dev] Example cleanup

Jed Brown jedbrown at mcs.anl.gov
Sun Feb 10 09:17:21 CST 2013


On Sun, Feb 10, 2013 at 9:09 AM, Matthew Knepley <knepley at gmail.com> wrote:

> Don't disagree with any of your reasons, however, there is very little
> work wasted here. Most of the coding
> is adding new methods, hooking up Python, etc. and not writing the two
> lines for output. Thus, adding JSON
> later will be all new work, and will invalid hardly anything. This is
> modularity :)
>

Sounds good, though I don't understand "hooking up Python". Are you doing
the validation itself in C or Python? If the latter, then just write JSON
(no library needed, basically identical to python dict and array notation)
and parse it using the Python standard library:

import json
python_dict = json.load(open('the-file.json'))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20130210/ded1ca6d/attachment.html>


More information about the petsc-dev mailing list