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

ase/quippy interoperability I/O issue #4

Closed
jameskermode opened this issue May 29, 2015 · 2 comments
Closed

ase/quippy interoperability I/O issue #4

jameskermode opened this issue May 29, 2015 · 2 comments

Comments

@jameskermode
Copy link
Member

Reported by Noam Bernstein:

If you convert from ase to quippy and back, the info field is not written in the extxyz:

cat t.py

import ase, ase.io, sys, quippy

at1 = ase.io.read("t.extxyz", 0)

at1.info['test'] = "bob"

print "print ase.Atoms with ase.io.write"
ase.io.write(sys.stdout, at1, format='extxyz')

at1q = quippy.Atoms(at1)
print "convert ase.Atoms to quippy.Atoms, print with ase.io.write"
ase.io.write(sys.stdout, at1q, format='extxyz')

at1 = ase.Atoms(at1q)

print "convert ase.Atoms to quippy.Atoms, convert back, print with ase.io.write"
ase.io.write(sys.stdout, at1, format='extxyz')

python t.py

ase.Atoms with ase.io.write
2
Lattice="2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 2.0" Properties=species:S:1:pos:R:3:Z:I:1 test=bob pbc="T T T"
Si      0.00000000       0.00000000       9.00000000       14 
Si      1.00000000       1.00000000       1.00000000       14 
convert ase.Atoms to quippy.Atoms, print with ase.io.write
2
Lattice="2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 2.0" Properties=species:S:1:pos:R:3:Z:I:1 test=bob pbc="T T T"
Si      0.00000000       0.00000000       9.00000000       14 
Si      1.00000000       1.00000000       1.00000000       14 
convert ase.Atoms to quippy.Atoms, convert back, print with ase.io.write
2
Lattice="2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 2.0" Properties=species:S:1:pos:R:3:Z:I:1 pbc="T T T"
Si      0.00000000       0.00000000       9.00000000       14 
Si      1.00000000       1.00000000       1.00000000       14```
@jameskermode
Copy link
Member Author

This turns out to be a bug in the ase.Atoms constructor which ignores the info attribute when copying from an existing Atoms object. Patch submitted to ASE developers.

@jameskermode
Copy link
Member Author

Fixed in ASE in commit 4470:
https://trac.fysik.dtu.dk/projects/ase/changeset/4470/trunk/ase

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

No branches or pull requests

1 participant