diff --git a/pyar/interface/mopac.py b/pyar/interface/mopac.py index 54f914c..82326e5 100644 --- a/pyar/interface/mopac.py +++ b/pyar/interface/mopac.py @@ -59,13 +59,13 @@ def prepare_input(self, keyword=""): """ keyword_line = '-xkPM7' if not keyword else '-xk' + keyword - with open(self.inp_file, 'w') as fminp: + with open(self.inp_file, 'w') as fminp, open('tmp.log', 'w') as ferr: out = subp.Popen(["obabel", "-ixyz", self.start_xyz_file, "-omop", keyword_line], - stdout=fminp) - output, error = out.communicate() - poll = out.poll() + stdout=fminp, stderr=ferr) + output, error = out.communicate() exit_status = out.returncode - os.remove('tmp.log') + if exit_status == 0: + os.remove('tmp.log') return exit_status def optimize(self, max_cycles=350, gamma=0.0, restart=False, convergence='normal'): diff --git a/requirements.txt b/requirements.txt index b2708d6..61871f2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ pandas>=1.0.5 scipy>=1.5.2 scikit-learn>=0.23.2 autograd>=1.3 -mendeleev>=0.9.0 dscribe ase pyh5md