Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
e784666f
Commit
e784666f
authored
Nov 11, 2019
by
Gao, Xiang
Committed by
Farhad Ramezanghorbani
Nov 11, 2019
Browse files
Fix tests for latest ASE (#381)
* Try latest ASE Just to see if ASE fixes its bug * fix
parent
0449f4d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
ci/install_dependencies.sh
ci/install_dependencies.sh
+1
-2
tests/test_structure_optim.py
tests/test_structure_optim.py
+4
-0
No files found.
ci/install_dependencies.sh
View file @
e784666f
...
...
@@ -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
tests/test_structure_optim.py
View file @
e784666f
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment