Skip to content
Snippets Groups Projects
Commit 02f63d18 authored by Nicolas Essing's avatar Nicolas Essing
Browse files

Corrected the python version in the KKRnano regression tests.

The run_test.sh script explicitly used python2.7, and the shebang
of the tests.py script was just python, which is normally also
python2, while the script was clearly a python3 script.

Also repalced the nonexistend ArgumentError with a ValueError.
parent 24b073e2
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ day=`date "+%Y%m%d%H%M"`
rm -f ./last
## run the test scripts
nohup python2.7 ./tests.py < /dev/null > ${day}_tests.txt
nohup python3 ./tests.py < /dev/null > ${day}_tests.txt
## clean the working directory
./clearfiles.sh
......
#!/usr/bin/python
#!/usr/bin/env python3
import unittest
import subprocess
......@@ -40,11 +40,11 @@ def get_energy(string):
match = list(re.finditer(r"^.*TOTAL ENERGY in ryd. :(.*)$", string, re.M))[-1] # get last match only
except:
print(string)
raise ArgumentError
raise ValueError("Error getting energy from output")
if match is not None:
return float(match.group(1))
else:
raise ArgumentError
raise ValueError("Error getting energy from output")
def KKRnano(inputdir, nranks=DEFAULT_nranks, nthreads=DEFAULT_nthreads, solver=DEFAULT_solver, lmax=DEFAULT_lmax, Lly=DEFAULT_Lly, **kwargs):
"""Run KKR-calculation with input from 'inputdir' and returns the total energy"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment