aiidateam / aiida-common-workflows

A repository for the implementation of common workflow interfaces across materials-science codes and plugins
https://aiida-common-workflows.readthedocs.io
MIT License
52 stars 31 forks source link

cp2k: pull original structure for ref_cell generation #286

Closed dev-zero closed 1 year ago

dev-zero commented 2 years ago

@mkrack @yakutovicha this is an (untested) alternative to the first implementation as discussed via email.

The logic I've implemented is:

  1. if there is a reference workchain, use whatever is there (if it has a cell_ref, use that one, if it doesn't do NOT add one)
  2. as a reference for the cell use the parent/source structure as a reference and the value of cell_ref_scale_factor if present, 1.0 otherwise
  3. the parent/source structure is determined by: a) being an input to the creator of the given structure with the name 'structure', b) the creator being named scale_structure and the caller of the creator containing the string common_workflows.eos. Which should contain it very well to the EOS workchain, with the downside that it will break on a refactoring.

Let me know what you think and I'll finalize and test this PR.

yakutovicha commented 1 year ago

@dev-zero, honestly, I forgot this discussion. Do you still want to finalize the PR? I believe it shouldn't be too hard to cherry-pick this commit on top of the master branch.