Skip to content

Commit

Permalink
Fix tests for latest ASE (#381)
Browse files Browse the repository at this point in the history
* Try latest ASE

Just to see if ASE fixes its bug

* fix
  • Loading branch information
zasdfgbnm authored and farhadrgh committed Nov 11, 2019
1 parent 0449f4d commit e784666
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions ci/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions tests/test_structure_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import copy
import pickle
from ase.optimize import BFGS
from ase import Atoms


path = os.path.dirname(os.path.realpath(__file__))
Expand All @@ -24,6 +25,9 @@ def testRMSE(self):
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)
Expand Down

0 comments on commit e784666

Please sign in to comment.