Hi Matthieu,

On 27/04/2016 06:13, Masquelet, Matthieu (GE Global Research, US) wrote:
> How about storing the git hash and the output of git diff? If you are
> on a public branch that might be a good compromise and a valid
> reference no?

We did consider this a couple of years back.  It is a nice idea, but
unfortunately gives rise to an annoying number of edge-cases.

Firstly, the use my not be running PyFR from an Git checkout.  It could
be they run python setup.py install and are running it from elsewhere.
(One workaround is to add code to setup.py to take a diff there, but
there is still no guarantee that setup.py is being run from a checkout.)

Secondly, we would need to ensure that we grab both staged and unstaged
differences from Git --- otherwise we would miss out on newly added
files.  This is fiddly and can have unintended consequences (say if you
are doing some debugging and leave a 200 MiB profile file in the PyFR
directory; now this critter will find itself inside all of your newly
minted .pyfrs files.)

Thirdly, having a Git hash (+ diff) is no good unless you can find that
hash.  If the code is never pushed or backed up it is all too easy to
lose everything.  Hashes also do not hold up well against git rebases;
so you can end up thinking you've lost your code when you haven't.

There is also a privacy issue.  However, this is more around user
education than anything else rather than a technical problem.

As such my long term preference is to look to getting PyFR to embed its
source code in output files.  Python knows what it is currently
executing and where the code came from.  Once you have the source you
can then diff it against currently released version of PyFR to get an
idea about its genesis.  Moreover, once you have the source code you
have the source code.  It therefore becomes possible to restart
simulations and to post-process output files (hence the .pyfrs file
becomes largely self-documenting as it embeds the code required to
process itself).

Regards, Freddie.

-- 
You received this message because you are subscribed to the Google Groups "PyFR 
Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/pyfrmailinglist.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to