Skip to content

Commit

Permalink
FChk: printing for unknown jobtype
Browse files Browse the repository at this point in the history
  • Loading branch information
berquist committed Apr 11, 2024
1 parent fc60559 commit 95caa7a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cclib/parser/fchkparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def parse_aonames(self, line, inputfile):
), f"Length of atombasis != natom: {len(atombasis)} != {self.natom}"
self.set_attribute("atombasis", atombasis)

def after_parsing(self):
def after_parsing(self) -> None:
"""Correct data or do parser-specific validation after parsing is finished."""

# Q-Chem will write the fchk file no matter what happens to the
Expand All @@ -393,21 +393,24 @@ def after_parsing(self):
self.success = False

if hasattr(self, "program"):
unknown_jobtype = False
self.metadata["package"] = f"FChk[{self.program}]"
if self.program == "Gaussian":
assert self.jobtype in ("sp", "freq", "fopt", "scan")
unknown_jobtype = self.jobtype not in ("sp", "freq", "fopt", "scan")
if self.jobtype == "sp":
self.success = True
elif self.program == "Psi4":
assert self.jobtype in ("sp", "force")
unknown_jobtype = self.jobtype not in ("sp", "force")
# The calculation will halt before making it to the fchk(wfn,
# ...) call in the input file, so the file's existence always
# signifies success.
self.success = True
elif self.program == "QChem":
assert self.jobtype in ("sp", "freq", "force", "fopt")
unknown_jobtype = self.jobtype not in ("sp", "freq", "force", "fopt")
else:
self.logger.info(f"Unknown originating program for fchk file: {self.program}")
if unknown_jobtype:
self.logger.info(f"Unknown job type for fchk file: {self.jobtype}")
else:
self.logger.info("Couldn't determine originating program for fchk file")

Expand Down

0 comments on commit 95caa7a

Please sign in to comment.