stfc / janus-core

Tools for machine learnt interatomic potentials
https://stfc.github.io/janus-core/
BSD 3-Clause "New" or "Revised" License
6 stars 7 forks source link

Custom output file names #198

Closed MBartkowiakSTFC closed 1 month ago

MBartkowiakSTFC commented 1 month ago

I would like to be able to specify the exact name of the file containing the final MD simulation frame.

At the moment the file name is generated automatically from struct_name, ensemble type and simulation parameters. Since I would like to use the last frame of one MD run as the starting point of another MD run, it would make it easier to write scripts and input files if I could fix the name of this output file to something arbitrary.

ElliottKasoar commented 1 month ago

That sounds useful, we'll have to think a bit about the best way of implementing this.

Until then, there are a couple of workarounds:

  1. You can read the final image from the trajectory, if the frequency is set to align with the final MD step. You can define that file name through --traj-file in the CLI
  2. If you're using the Python interface, the _final_file attribute of the MD object will tell you the Path that will be used
  3. Currently this will still include the temperature for MD, but you can set --file_prefix, which removes the struct_name, ensemble etc. For example, --file-prefix example will save the final file to example-T300.0-final.xyz

This last point is where the slight complication for a perfect solution comes in. We can (and may) remove the temperature in this case, but we also need to distinguish between -final files if carrying out heating, which limits how much we can easily allow users to specify for these.