Skip to content

Commit

Permalink
Likewise for cell parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
elinscott committed Oct 10, 2024
1 parent 0decc9d commit efcfffc
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/koopmans/workflows/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1680,13 +1680,14 @@ def read_atoms_dict(dct: Dict[str, Any]) -> Tuple[Atoms, List[Atoms]]:
subdct = dct.pop('atomic_positions')
snapshots = ase_read(subdct['snapshots'], index=':')

# If periodic is manually provided, ovveride what is provided in the xyz file
periodic = dct.get('cell_parameters', {}).get('periodic', None)
if periodic is not None:
for s in snapshots:
s.pbc = periodic

atoms = snapshots[0]

# If cell parameters are manually provided, override what is provided in the xyz file
if 'cell_parameters' in dct:
utils.read_cell_parameters(atoms, dct['cell_parameters'])
for s in snapshots[1:]:
s.cell = atoms.cell
s.pbc = atoms.pbc
else:
atoms = Atoms()
snapshots = None
Expand Down

0 comments on commit efcfffc

Please sign in to comment.