@@ -83,6 +83,7 @@ def determine_ess_status(output_path: str,
8383 return 'errored' , ['NoOutput' ], 'Log file could not be read' , ''
8484 forward_lines = tuple (lines )
8585 reverse_lines = tuple (lines [::- 1 ])
86+ len_reversed_lines = len (reverse_lines )
8687
8788 if software == 'gaussian' :
8889 for line in forward_lines [- 1 :- 20 :- 1 ]:
@@ -93,7 +94,7 @@ def determine_ess_status(output_path: str,
9394 if 'l9999.exe' in line or 'link 9999' in line :
9495 cycle_issue = False
9596 neg_eigenvalues = False
96- for j in range (i ,len (reverse_lines )):
97+ for j in range (i , len (reverse_lines )):
9798 if 'Number of steps exceeded' in reverse_lines [j ]:
9899 keywords = ['MaxOptCycles' , 'GL9999' ]
99100 error = 'Maximum optimization cycles reached.'
@@ -132,7 +133,7 @@ def determine_ess_status(output_path: str,
132133 # Check if Inaccurate quadrature in CalDSu
133134 inacc_quad = False
134135 for j in range (i + 300 , i , - 1 ):
135- if 'Inaccurate quadrature in CalDSu' in reverse_lines [j ]:
136+ if j < len_reversed_lines and 'Inaccurate quadrature in CalDSu' in reverse_lines [j ]:
136137 inacc_quad = True
137138 keywords = ['InaccurateQuadrature' , 'GL502' ]
138139 error = 'Inaccurate quadrature in CalDSu'
0 commit comments