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

Controller n2p2 write #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Controller n2p2 write #3

wants to merge 1 commit into from

Conversation

dave452
Copy link
Collaborator

@dave452 dave452 commented Oct 24, 2022

Minor changes to make reading xyz files work more generally.

I think this PR contains code from the other pull request. Should probably change some of the code to work as an option of the old code.

if n2p2_units["length"] != "Ang":
for j, lattice in enumerate(lattice_list):
lattice_list[j] = float(lattice) / UNITS[n2p2_units["length"]]
n_structures = int(len(xyz_lines)/ (n_atoms+ 2))
Copy link
Member

Choose a reason for hiding this comment

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

Very minor but formatting is slightly inconsistent here.

We could also consider assertions to check values that we've inferred are valid e.g. n_atoms

@ElliottKasoar
Copy link
Member

Note before merging: some changes shared with #2 and will be removed after rebasing

@ElliottKasoar
Copy link
Member

Could you expand on the different types of input .xyz files, and how your changes fit in to the workflows?

I think some updates are needed, e.g. scripts/cp2k.ipybn and cp2k_input/template.inp (I get KeyError: 'basis_set' when calling write_cp2k(), which I think comes from template.inp). There may be other files that need similar updates.

for k, position in enumerate(atom_xyz[1:], 1):
atom_xyz[k] = float(position) / UNITS[n2p2_units["length"]]
if(n_structures<= 1):
force = force_lines[j + 4].split()[-4:]
Copy link
Member

Choose a reason for hiding this comment

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

Should be force = force_lines[j + 4].split()[-3:] here and in the else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants