Skip to content

Commit

Permalink
temp bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jla-gardner committed Feb 12, 2024
1 parent 5e6c501 commit 3c1fc3a
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/graph_pes/data/atomic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,27 @@ def convert_to_atomic_graph(
structure, atom_labels, structure_labels
)

# TODO this API is horrible and needs fixing
property_mapping = property_mapping or {}
to_remove = []
to_add = {}
for key, value in atom_info.items():
if key in property_mapping:
atom_info[property_mapping[key]] = value
del atom_info[key]
to_add[property_mapping[key]] = value
to_remove.append(key)
for key in to_remove:
del atom_info[key]
atom_info.update(to_add)

to_remove = []
to_add = {}
for key, value in structure_info.items():
if key in property_mapping:
structure_info[property_mapping[key]] = value
del structure_info[key]
to_add[property_mapping[key]] = value
to_remove.append(key)
for key in to_remove:
del structure_info[key]
structure_info.update(to_add)

i, j, offsets = neighbor_list("ijS", structure, cutoff)
return AtomicGraph(
Expand Down

0 comments on commit 3c1fc3a

Please sign in to comment.