Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MD stats files appends by default #431

Open
ElliottKasoar opened this issue Feb 18, 2025 · 0 comments
Open

MD stats files appends by default #431

ElliottKasoar opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ElliottKasoar
Copy link
Member

As part of #230, we append the MD stats header when writing in all cases: https://github.com/stfc/janus-core/blob/main/janus_core/calculations/md.py#L849

This means running the same calculation e.g.

janus md --ensemble nvt --struct tests/data/NaCl.cif --steps 2 --stats-every 1 --traj-every 1 
janus md --ensemble nvt --struct tests/data/NaCl.cif --steps 2 --stats-every 1 --traj-every 1 

creates two sets of headers in the same file:

# Step | Real_Time [s] | Time [fs] | Epot/N [eV] | EKin/N [eV] | T [K] | ETot/N [eV] | Density [g/cm^3] | Volume [Ang^3] | P [GPa] | Pxx [GPa] | Pyy [GPa] | Pzz [GPa] | Pyz [GPa] | Pxz [GPa] | Pxy [GPa] | Target_T [K]
         0 0.252          0.00 -3.37939097e+00 4.25131948e-02 328.897 -3.33687778e+00 2.164 1.79406144e+02 9.68851553e-01 9.32855803e-01 1.03079033e+00 9.42908522e-01 -3.80292164e-02 -2.35372733e-02 1.10649754e-01 300.00000
         1 0.229          1.00 -3.37935448e+00 4.13830343e-02 320.154 -3.33797145e+00 2.164 1.79406144e+02 9.64304008e-01 9.26742310e-01 1.02031498e+00 9.45854731e-01 -1.74348173e-02 -1.07082055e-02 9.71744091e-02 300.00000
         2 0.072          2.00 -3.37924838e+00 3.80714726e-02 294.534 -3.34117691e+00 2.164 1.79406144e+02 9.50926794e-01 9.10987322e-01 1.02354153e+00 9.18251529e-01 -2.87410219e-02 -4.01354358e-03 8.88494687e-02 300.00000
# Step | Real_Time [s] | Time [fs] | Epot/N [eV] | EKin/N [eV] | T [K] | ETot/N [eV] | Density [g/cm^3] | Volume [Ang^3] | P [GPa] | Pxx [GPa] | Pyy [GPa] | Pzz [GPa] | Pyz [GPa] | Pxz [GPa] | Pxy [GPa] | Target_T [K]
         0 0.273          0.00 -3.37939097e+00 3.28890051e-02 254.441 -3.34650197e+00 2.164 1.79406144e+02 9.23012464e-01 1.02846213e+00 8.62384128e-01 8.78191129e-01 5.81712201e-02 -2.37951393e-02 1.51360932e-02 300.00000
         1 0.220          1.00 -3.37935900e+00 3.17246846e-02 245.433 -3.34763432e+00 2.164 1.79406144e+02 9.18364561e-01 1.02950056e+00 8.65033703e-01 8.60559418e-01 5.34354353e-02 -2.80580164e-02 1.27991633e-02 300.00000
         2 0.069          2.00 -3.37926359e+00 3.08789967e-02 238.891 -3.34838459e+00 2.164 1.79406144e+02 9.17023822e-01 1.03640370e+00 8.72749112e-01 8.41918661e-01 4.24732115e-02 -2.35075712e-02 2.43917085e-02 300.00000

I think, if we're writing the header (which may not be the case for restarting, etc.), we usually want to overwrite the file, as we used to?

@ElliottKasoar ElliottKasoar added the bug Something isn't working label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant