Skip to content

Commit

Permalink
A few minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristaps Ermanis committed Jul 4, 2019
1 parent ab9fbea commit 90beef4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def SetupOptCalcs(Isomers, settings):

if os.path.exists(filename + '.out'):
if IsGausCompleted(filename + '.out'):
if IsGausConverged(filename + '.out'):
if IsGausConverged(filename + '.out') or (settings.AssumeConverged == True):
iso.OptOutputFiles.append(filename + '.out')
continue
else:
Expand Down
5 changes: 5 additions & 0 deletions GaussianDarwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ def RunBatchOnDarwin(findex, GausJobs, settings):
os.getcwd() + '/'], \
stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]

print("\nDeleting checkpoint files...")
print('ssh darwin rm ' + fullfolder + '/*.chk')
outp = subprocess.Popen(['ssh', 'darwin', 'rm', fullfolder + '/*.chk'], \
stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0]

fullscrfolder = settings.DarwinScrDir + scrfolder
print("\nDeleting scratch folder...")
print('ssh darwin rm -r ' + fullscrfolder)
Expand Down
6 changes: 4 additions & 2 deletions MacroModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ def SetupMacroModel(settings):
convinp = '"' + settings.SCHRODINGER + '/utilities/sdconvert" -isd '
else:
convinp = settings.SCHRODINGER + '/utilities/sdconvert -isd '
outp = subprocess.check_output(convinp + f + '.sdf -omae ' + f +
'.mae', shell=True)

if not os.path.exists(f + '.mae'):
outp = subprocess.check_output(convinp + f + '.sdf -omae ' + f +
'.mae', shell=True)
MacroModelInputs.append(f + '.mae')

#Copy default com file to directory
Expand Down
9 changes: 7 additions & 2 deletions PyDP4.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Settings:
NMRsource = '' # File or folder containing NMR description or data
Title = 'DP4molecule' # Title of the calculation, set to NMR file name by default on launch
AssumeDone = False # Assume all computations done, only read DFT output data and analyze (use for reruns)
AssumeConverged = False # Assume all optimizations have converged, do NMR and/or energy calcs on existing DFT geometries
UseExistingInputs = False # Don't regenerate DFT inputs, use existing ones. Good for restarting a failed calc

# --- Diastereomer generation ---
Expand Down Expand Up @@ -158,7 +159,7 @@ def __init__(self, InputFile, Charge=-100):
self.NMROutputFiles = [] # list of DFT NMR output file names
self.ShieldingLabels = [] # A list of atom labels corresponding to the shielding values
self.ConformerShieldings = [] # list of calculated NMR shielding constant lists for every conformer
self.BolztmannShieldings = [] # Boltzmann weighted NMR shielding constant list for the isomer
self.BoltzmannShieldings = [] # Boltzmann weighted NMR shielding constant list for the isomer
self.Cshifts = [] # Calculated C NMR shifts
self.Hshifts = [] # Calculated H NMR shifts

Expand Down Expand Up @@ -249,7 +250,7 @@ def main(settings):
Isomers = DFT.ReadGeometries(Isomers)

#Add convergence check here before continuing with calcs!
if DFT.Converged(Isomers) == False:
if (DFT.Converged(Isomers) == False) and (settings.AssumeConverged == False):
print('Some of the conformers did not converge, quitting...')
quit()

Expand Down Expand Up @@ -431,6 +432,8 @@ def getScriptPath():

parser.add_argument("--AssumeDFTDone", help="Assume RMSD pruning, DFT setup\
and DFT calculations have been run already", action="store_true")
parser.add_argument("--AssumeConverged", help="Assume DFT optimizations have" + \
" converged and can be used for NMR and or energy calcs", action="store_true")
parser.add_argument("--UseExistingInputs", help="Use previously generated\
DFT inputs, avoids long conf pruning and regeneration", action="store_true")
parser.add_argument("--NoConfPrune", help="Skip RMSD pruning, use all\
Expand Down Expand Up @@ -503,6 +506,8 @@ def getScriptPath():
settings.ConfPrune = False
if args.AssumeDFTDone:
settings.AssumeDone = True
if args.AssumeConverged:
settings.AssumeConverged = True
if args.UseExistingInputs:
settings.UseExistingInputs = True
if args.solvent:
Expand Down

0 comments on commit 90beef4

Please sign in to comment.