Skip to content

Commit

Permalink
Element symbols are now used when generating an ase atom.
Browse files Browse the repository at this point in the history
  • Loading branch information
JPBergsma committed Mar 25, 2023
1 parent 61386dd commit 6f75b8a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 3 additions & 1 deletion optimade/adapters/structures/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def get_ase_atoms(optimade_structure: OptimadeStructure) -> Atoms:
if current_species.mass:
mass = current_species.mass[0]

atoms.append(Atom(symbol=species_name, position=site, mass=mass))
atoms.append(
Atom(symbol=current_species.chemical_symbols[0], position=site, mass=mass)
)

info = {}
for key in attributes.dict().keys():
Expand Down
15 changes: 12 additions & 3 deletions optimade/server/data/test_structures.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,16 @@
"concentration": [
1.0
],
"name": "Ac"
"name": "Ac1"
},
{
"chemical_symbols": [
"Ac"
],
"concentration": [
1.0
],
"name": "Ac2"
},
{
"chemical_symbols": [
Expand All @@ -289,8 +298,8 @@
}
],
"species_at_sites": [
"Ac",
"Ac",
"Ac1",
"Ac2",
"Ag",
"Pb"
],
Expand Down

0 comments on commit 6f75b8a

Please sign in to comment.