mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 06:05:29 -04:00
protect diff_cp2k for the cases when there is no final energy
svn-origin-rev: 17824
This commit is contained in:
parent
0ec224b870
commit
07b718113d
1 changed files with 9 additions and 8 deletions
|
|
@ -216,14 +216,15 @@ def main():
|
|||
|
||||
print("")
|
||||
|
||||
ref=float(files[args.file_lists[args.base-1]][1])
|
||||
color='\033[0m'
|
||||
endc='\033[0m'
|
||||
for filename in args.file_lists:
|
||||
comp=(float(files[filename][1])-ref)/ref
|
||||
if abs(comp)>1e-14: color='\033[91m'
|
||||
else: color='\033[0m'
|
||||
print(('{0} ==> {1} : {2} : '+color+'{3}'+endc).format(files[filename][0],filename,files[filename][1],(float(files[filename][1])-ref)/ref))
|
||||
if len(files[args.file_lists[args.base-1]][1])>0:
|
||||
ref=float(files[args.file_lists[args.base-1]][1])
|
||||
color='\033[0m'
|
||||
endc='\033[0m'
|
||||
for filename in args.file_lists:
|
||||
comp=(float(files[filename][1])-ref)/ref
|
||||
if abs(comp)>1e-14: color='\033[91m'
|
||||
else: color='\033[0m'
|
||||
print(('{0} ==> {1} : {2} : '+color+'{3}'+endc).format(files[filename][0],filename,files[filename][1],(float(files[filename][1])-ref)/ref))
|
||||
|
||||
print("")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue