Q2MM / q2mm

Quantum to Molecular Mechanics (Q2MM)
MIT License
24 stars 9 forks source link

Division by zero error when penalty score reaches 0 #55

Open jeherr opened 5 years ago

jeherr commented 5 years ago

Per @peonor

I did a small subset optimization in this benzene project (actually very good as a test case). I managed to achieve a score of zero, which causes the program to crash… It’s because we report change in percent of total score…

Traceback (most recent call last):
  File "/home/kcjh508/Q2MM/q2mm-master/q2mm/loop.py", line 425, in <module>
    main(sys.argv[1:])
  File "/home/kcjh508/Q2MM/q2mm-master/q2mm/loop.py", line 419, in main
    loop.run_loop_input(lines)
  File "/home/kcjh508/Q2MM/q2mm-master/q2mm/loop.py", line 140, in run_loop_input
    self.ff = loop.opt_loop()
  File "/home/kcjh508/Q2MM/q2mm-master/q2mm/loop.py", line 67, in opt_loop
    change = (last_score - self.ff.score) / last_score
ZeroDivisionError: float division by zero