Skip to content

Commit

Permalink
Fix duplicate calculated results
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Nov 28, 2024
1 parent 73f03db commit 4a56b0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions abcd/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ def from_atoms(cls, atoms: Atoms, extra_info=None, store_calc=True):
}
arrays_keys = set(atoms.arrays.keys())
info_keys = set(atoms.info.keys())
results_keys = (
set(atoms.calc.results.keys()) if store_calc and atoms.calc else {}
)
if store_calc and atoms.calc:
results_keys = atoms.calc.results.keys() - (arrays_keys | info_keys)
else:
results_keys = {}

all_keys = (reserved_keys, arrays_keys, info_keys, results_keys)
if len(set.union(*all_keys)) != sum(map(len, all_keys)):
Expand Down

0 comments on commit 4a56b0b

Please sign in to comment.