From f00f8c12ca12cc7d14d5168101dd89c681d74922 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 21 Jan 2022 11:32:25 +0100 Subject: [PATCH] Fixed gaussian AO block infinite loop --- resultsFile/Modules/gaussianFile.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/resultsFile/Modules/gaussianFile.py b/resultsFile/Modules/gaussianFile.py index 09487f1..2cf0fa5 100755 --- a/resultsFile/Modules/gaussianFile.py +++ b/resultsFile/Modules/gaussianFile.py @@ -385,7 +385,8 @@ class gaussianFile(resultsFile.resultsFileX): pass pos += 1 basis_read = [] - line = self.text[pos].split() + full_line = self.text[pos] + line = full_line.split() iatom=0 atom = line[1] while pos < end: @@ -398,7 +399,8 @@ class gaussianFile(resultsFile.resultsFileX): atom = line[1] bf = [] pos+=1 - line = self.text[pos].split() + full_line = self.text[pos] + line = full_line.split() for k in range(nfunc): expo = float(line[0].replace('D','E')) coef = float(line[1].replace('D','E')) @@ -408,10 +410,11 @@ class gaussianFile(resultsFile.resultsFileX): else: bf.append( [expo,coef] ) pos += 1 - line = self.text[pos].split() + full_line = self.text[pos] + line = full_line.split() if len(bf) > 0: basis_read.append( [index,sym,bf,iatom] ) - if line[0].startswith('==============='): + if "basis functions" in full_line or "=" in full_line: pos = end else: print("GFPRINT should be present in the gaussian keywords.")