Commit e784666f authored by Gao, Xiang's avatar Gao, Xiang Committed by Farhad Ramezanghorbani
Browse files

Fix tests for latest ASE (#381)

* Try latest ASE

Just to see if ASE fixes its bug

* fix
parent 0449f4d6
......@@ -2,5 +2,4 @@
python -m pip install --upgrade pip
pip install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install tqdm pyyaml future pkbar
pip install 'ase<=3.17'
pip install tqdm pyyaml future pkbar ase
......@@ -5,6 +5,7 @@ import torchani
import copy
import pickle
from ase.optimize import BFGS
from ase import Atoms
path = os.path.dirname(os.path.realpath(__file__))
......@@ -24,6 +25,9 @@ class TestStructureOptimization(unittest.TestCase):
with open(datafile, 'rb') as f:
all_atoms = pickle.load(f)
for atoms in all_atoms:
# reconstructing Atoms object.
# ASE does not support loading pickled object from older version
atoms = Atoms(atoms.get_chemical_symbols(), positions=atoms.get_positions())
old_coordinates = copy.deepcopy(atoms.get_positions())
old_coordinates = torch.from_numpy(old_coordinates)
atoms.set_calculator(self.calculator)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment