From f3ac6d6df8c382b3c342217c58a601470cc6dc11 Mon Sep 17 00:00:00 2001 From: anoop Date: Thu, 27 Jun 2024 12:32:00 +0530 Subject: [PATCH] modified: pyar/interface/mopac.py modified: requirements.txt --- pyar/interface/mopac.py | 10 +++++----- requirements.txt | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) 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