Skip to content

Commit

Permalink
use new pymatgen (Structure|Molecule).to_ase_atoms() convenience methods
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Oct 23, 2023
1 parent 7c22ab1 commit b8d734b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chgnet/model/dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def relax(
A dictionary with 'final_structure' and 'trajectory'.
"""
if isinstance(atoms, Structure):
atoms = AseAtomsAdaptor.get_atoms(atoms)
atoms = atoms.to_ase_atoms()

atoms.calc = self.calculator # assign model used to predict forces

Expand Down Expand Up @@ -432,7 +432,7 @@ def __init__(
self.ensemble = ensemble
self.thermostat = thermostat
if isinstance(atoms, (Structure, Molecule)):
atoms = AseAtomsAdaptor.get_atoms(atoms)
atoms = atoms.to_ase_atoms()

self.atoms = atoms
if isinstance(model, CHGNetCalculator):
Expand Down

0 comments on commit b8d734b

Please sign in to comment.