Permalink
Browse files

Improve doc. More tests.

  • Loading branch information...
1 parent 81bdd47 commit 6140cf520c3ef44de47f3770406c16c92d6f576e @shyuep shyuep committed Jun 20, 2013
Showing with 1,655 additions and 5 deletions.
  1. +4 −5 custodian/nwchem/handlers.py
  2. +5 −0 custodian/nwchem/tests/test_handlers.py
  3. +37 −0 test_files/nwchem/Li1_1.nw
  4. +1,609 −0 test_files/nwchem/Li1_1.nwout
@@ -1,7 +1,8 @@
#!/usr/bin/env python
"""
-TODO: Change the module doc.
+This module implements error handlers for Nwchem runs. Currently tested only
+for B3LYP DFT jobs.
"""
from __future__ import division
@@ -13,12 +14,11 @@
__status__ = "Beta"
__date__ = "5/20/13"
-import shutil
-import time
from custodian.custodian import ErrorHandler
from pymatgen.serializers.json_coders import MSONable
-from pymatgen.io.nwchemio import NwOutput
+from pymatgen.io.nwchemio import NwOutput, NwInput
+from custodian.ansible.intepreter import Modder
class NwchemErrorHandler(ErrorHandler, MSONable):
@@ -62,7 +62,6 @@ def correct(self):
lambda l: "{} noautoz\n".format(l.strip()))
actions.append("Set noautoz to geometry.")
elif e == "Bad convergence":
- #Hackish solution for bad convergence error. Set cgmin.
self._mod_input(
lambda l: l.lower().strip() == "dft",
lambda l: "{}\n cgmin\n".format(l.strip()))
@@ -34,6 +34,11 @@ def test_check_correct(self):
h.check()
h.correct()
shutil.move("C1N1Cl1_1.nw.orig", "C1N1Cl1_1.nw")
+ shutil.copy("Li1_1.nw", "Li1_1.nw.orig")
+ h = NwchemErrorHandler(output_filename="Li1_1.nwout")
+ h.check()
+ h.correct()
+ shutil.move("Li1_1.nw.orig", "Li1_1.nw")
if __name__ == "__main__":
View
@@ -0,0 +1,37 @@
+start Li1
+geometry units angstroms
+ Li 0.0 0.0 0.0
+end
+
+title "Li1 dft energy"
+charge 0
+basis
+ Li library "6-31++g**"
+end
+dft
+ xc b3lyp
+ mult 2
+end
+task dft energy
+
+title "Li1 dft energy"
+charge 1
+basis
+ Li library "6-31++g**"
+end
+dft
+ xc b3lyp
+ mult 1
+end
+task dft energy
+
+title "Li1 dft energy"
+charge -1
+basis
+ Li library "6-31++g**"
+end
+dft
+ xc b3lyp
+ mult 1
+end
+task dft energy
Oops, something went wrong.

0 comments on commit 6140cf5

Please sign in to comment.