Skip to content

Commit

Permalink
Improved error message when no NMR output files could be found
Browse files Browse the repository at this point in the history
  • Loading branch information
KristapsE committed May 12, 2020
1 parent 7f1e0bc commit c227fd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,11 @@ def ReadShieldings(Isomers):

for iso in Isomers:

if len(iso.NMROutputFiles) < 1:
print("Gaussian.py, ReadShieldings: No NMR DFT output" +
" files found, NMR data could not be read. Quitting.")
quit()

for GOutpFile in iso.NMROutputFiles:

gausfile = open(GOutpFile, 'r')
Expand Down
5 changes: 5 additions & 0 deletions NWChem.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ def ReadShieldings(Isomers):

for iso in Isomers:

if len(iso.NMROutputFiles) < 1:
print("NWChem.py, ReadShieldings: No NMR DFT output" +
" files found, NMR data could not be read. Quitting.")
quit()

for NWOutpFile in iso.NMROutputFiles:
nwfile = open(NWOutpFile, 'r')
NWOutp = nwfile.readlines()
Expand Down

0 comments on commit c227fd1

Please sign in to comment.