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

Add file prefix options to singlepoint and geomopt #452

Merged
merged 11 commits into from
Feb 28, 2025

Conversation

k-harris27
Copy link
Contributor

Adds the option to provide a file prefix that is used for all of the files produced by single point and geometry optimisations. Since this can include a directory, it helps to allow the option to create a results directory for #359 (comment).

@ElliottKasoar ElliottKasoar added the enhancement New/improved feature or request label Feb 27, 2025
@ElliottKasoar
Copy link
Member

ElliottKasoar commented Feb 27, 2025

Do we want to set a (partial?) default file prefix, as part of this PR or otherwise e.g. to save everything to ./results?

In that case, we may want an additional option, to specify the output directory, which prepends the file prefix?

Otherwise we'd lose the more descriptive part of the file prefix.

@k-harris27
Copy link
Contributor Author

In that case, we may want an additional option, to specify the output directory, which prepends the file prefix?

I feel like an output directory option that doesn't affect the file name would be a good addition. I was thinking that making sure all the files work consistently with file_prefix should help make a directory option relatively easy to add.

Copy link
Member

@ElliottKasoar ElliottKasoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @k-harris27!

Could you:

  • Summarise the changes to how the trajectory file can now be saved (in the comments here)
  • Update the CLI docs (docs/source/user_guide/command_line.rst) to make sure the example is correct

@ElliottKasoar ElliottKasoar mentioned this pull request Feb 28, 2025
1 task
@k-harris27
Copy link
Contributor Author

Summarise the changes to how the trajectory file can now be saved (in the comments here)

In geomopt, the trajectory is now written if the write_traj option is True.

By default, the trajectory filename is inferred from file_prefix as with other output files, and only a .extxyz file is written.

The filename can be specified manually by setting traj_kwargs["filename"].

The binary .traj file written by ASE can be retained by manually setting its output path using opt_kwargs["trajectory"].

If traj_kwargs["filename"] or opt_kwargs["trajectory"] are given when write_traj is False, an error is raised.

Co-authored-by: Jacob Wilkins <46597752+oerc0122@users.noreply.github.com>
@ElliottKasoar ElliottKasoar merged commit 54286e1 into stfc:main Feb 28, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New/improved feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants