MobleyLab / alchemical-analysis

An open tool implementing some recommended practices for analyzing alchemical free energy calculations
MIT License
120 stars 60 forks source link

Overwriting .xvg files #95

Open jpthompson17 opened 7 years ago

jpthompson17 commented 7 years ago

When analyzing GROMACS data, uncorrupted .xvg files are overwritten with extra zeros (fmt = '%.10f'). This is unnecessary and also potentially dangerous; e.g. if the process is interrupted during writing, the result (as I found out the hard way) is replacement of a perfectly good .xvg file with a partially written one. [Perhaps the final lines of corruptxvg.py were once part of the else statement starting on line 106?]

Meanwhile, minimally corrupted files (default: <10% corrupt) are backed up to ./xvg-bak/ before being overwritten with corrupt lines removed. This is OK, but perhaps not ideal. As a user, I would prefer my input data to be neither overwritten nor moved to a new location without explicit notification.

davidlmobley commented 7 years ago

Clearly that needs fixing. If you're interested in contributing I'm open to a pull request to fix it, otherwise it will likely take us a bit of time to get to this (we're planning towards a major reworking of alchemical-analysis based on alchemlyb which is being developed, but in the meantime I don't have anyone in the group actively developing this so changes are a bit slow).

jpthompson17 commented 7 years ago

I have a quick fix (indenting line 117 in corruptxvg.py) that works for my purposes, but I don't have the time at the moment to consider a more careful revision that might warrant a pull request.

I'll keep an eye on development of alchemlyb. Thanks for the heads-up!