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

Fix a bug in AtomsBase interface #38

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

tjjarvinen
Copy link
Contributor

This fixes a bug in AtomsBase interface that caused extra vector data, like forces, to not load into Atoms structure.

To see the bug you can use this as an input

using ExtXYZ

text = """2
Lattice="2.614036117884091 0.0 0.0 0.0 2.6528336296738044 0.0 0.0 0.0 3.8250280122051756" Properties=species:S:1:pos:R:3:force:R:3:tags:I:1 config_type=FLD_TiAl spacegroup="P 1" virial="5.072173561696366 0.1220123768779895 0.6518229755809941 0.1220123768779895 4.667636799854875 0.5969893898844183 0.6518229755809941 0.5969893898844183 4.700422750506493" energy=-1703.64063822 unit_cell=conventional n_minim_iter=2 pbc="T T T"
Ti       1.30924260       1.32316179       1.62637131       0.86219000       0.78737000       2.65969000        0
Al       0.11095015       0.09471147      -0.05013464      -0.86219000      -0.78737000      -2.65969000        1
"""

fname=tempname()
open(fname, "w") do io
    print(io, text)
end

atoms = ExtXYZ.load(fname)
@show atoms[1][:force]

I also fixed writing AtomsBase data vectors, like force, and added tests for both cases.

As a context of this bug. This peace is the final part to allow training ACE models using AtomsBase interface.

cc @cortner

@jameskermode
Copy link
Member

Thank you for fixing this. I've tested locally and in CI and am happy to merge. I will then tag a new release.

@jameskermode jameskermode merged commit cf6bc43 into libAtoms:master Sep 20, 2023
7 checks passed
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.

2 participants