Skip to content

Commit

Permalink
Merge branch 'master' of github.com:materialsproject/pymatgen
Browse files Browse the repository at this point in the history
Former-commit-id: dfacb43c24648c4eb1ef4f7b1f4b8aa38066194f [formerly ca4af68]
Former-commit-id: fcd5a869e5e023b1badab969f5233d35f434959f
  • Loading branch information
shyuep committed Aug 15, 2014
2 parents 389cb1d + 9e109d0 commit 216677a
Show file tree
Hide file tree
Showing 3 changed files with 437 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pymatgen/io/qchemio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ def _parse_job(cls, output):
thermal_corr_pattern = re.compile("(?P<name>\S.*\S):\s+"
"(?P<correction>\d+\.\d+)\s+"
"k?cal/mol")
detailed_charge_pattern = re.compile("Ground-State (?P<method>\w+) Net"
detailed_charge_pattern = re.compile("(Ground-State )?(?P<method>\w+)( Net)?"
" Atomic Charges")
nbo_charge_pattern = re.compile("(?P<element>[A-Z][a-z]{0,2})\s+(?P<no>\d+)\s+(?P<charge>\-?\d\.\d+)"
"\s+(?P<core>\-?\d+\.\d+)\s+(?P<valence>\-?\d+\.\d+)"
Expand Down Expand Up @@ -1278,6 +1278,7 @@ def _parse_job(cls, output):
current_beta_homo = None
homo_lumo = []
bsse = None
hiershfiled_pop = False
for line in output.split("\n"):
for ep, message in error_defs:
if ep.search(line):
Expand Down Expand Up @@ -1517,8 +1518,13 @@ def _parse_job(cls, output):
parse_input = True
elif "Standard Nuclear Orientation (Angstroms)" in line:
parse_coords = True
elif "Cycle Energy DIIS Error" in line\
or "Cycle Energy RMS Gradient" in line:
elif "Performing Hirshfeld population analysis" in line:
hiershfiled_pop = True
elif "Hirshfeld: atomic densities completed" in line:
hiershfiled_pop = False
elif ("Cycle Energy DIIS Error" in line\
or "Cycle Energy RMS Gradient" in line)\
and not hiershfiled_pop:
parse_scf_iter = True
scf_iters.append([])
scf_successful = False
Expand Down
7 changes: 7 additions & 0 deletions pymatgen/io/tests/test_qchemio.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,6 +1742,13 @@ def test_bsse(self):
self.assertAlmostEqual(qcout.data[0]["bsse"], -0.164210762949, 5)
self.assertEqual(qcout.data[0]["jobtype"], "bsse")

def test_hirshfeld_charge(self):
filename = os.path.join(test_dir, "hirshfeld_population.qcout")
qcout = QcOutput(filename)
self.assertEqual(qcout.data[0]["charges"]["hirshfeld"],
[-0.286309, 0.143134, 0.143176])
self.assertFalse(qcout.data[0]["has_error"])


if __name__ == "__main__":
unittest.main()
Loading

0 comments on commit 216677a

Please sign in to comment.