Permalink
Browse files

Fix findif freq file cleaning. Remove gcp scratch directory. (#1326)

  • Loading branch information...
loriab authored and robertodr committed Nov 2, 2018
1 parent 56b8841 commit 217d7d79d53f27fb4261396549afc41776455950
Showing with 9 additions and 4 deletions.
  1. +3 −0 psi4/driver/driver.py
  2. +6 −4 psi4/driver/qcdb/interface_gcp.py
@@ -165,6 +165,9 @@ def _process_displacement(derivfunc, method, molecule, displacement, n, ndisp, *
geom_array = np.reshape(displacement["geometry"], (-1, 3))
molecule.set_geometry(core.Matrix.from_array(geom_array))
# clean possibly necessary for n=1 if its irrep (unsorted in displacement list) different from initial G0 for freq
core.clean()
# Perform the derivative calculation
derivative, wfn = derivfunc(method, return_wfn=True, molecule=molecule, **kwargs)
displacement["energy"] = core.get_variable('CURRENT ENERGY')
@@ -32,6 +32,7 @@
import os
import re
import uuid
import shutil
import socket
import subprocess
@@ -278,11 +279,12 @@ def run_gcp(self, func=None, dertype=None, verbose=False): # dashlvl=None, dash
# if defmoved is True:
# os.rename(defaultfile + '_hide', defaultfile)
# clean up files and remove scratch directory
os.chdir('..')
# try:
# shutil.rmtree(dftd3_tmpdir)
# except OSError as e:
# ValidationError('Unable to remove dftd3 temporary directory %s' % e)
try:
shutil.rmtree(gcp_tmpdir)
except OSError as err:
raise OSError('Unable to remove gcp temporary directory: {}'.format(gcp_tmpdir)) from err
os.chdir(current_directory)
# return -D & d(-D)/dx

0 comments on commit 217d7d7

Please sign in to comment.