Skip to content

Commit d6d2be9

Browse files
authored
improve error handling of sella xtb optts (#809)
2 parents 79c2aca + 639d242 commit d6d2be9

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

arc/job/adapters/xtb_adapter.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,26 @@ def opt_ts(self):
324324
executable='/bin/bash')
325325

326326
# If Sella crashed, Python’s traceback is in stderr
327-
real_errors = [line for line in stderr if not line.strip().lower().startswith('warning:') and line.strip()]
327+
ignore_keywords = [
328+
'futurewarning:',
329+
'userwarning:',
330+
'deprecationwarning:',
331+
'warnings.warn('
332+
]
333+
real_errors = []
334+
for line in stderr:
335+
line_lower = line.strip().lower()
336+
if not line_lower:
337+
continue
338+
if line_lower.startswith('warning:'):
339+
continue
340+
if any(keyword in line_lower for keyword in ignore_keywords):
341+
continue
342+
if line.startswith(' warnings.warn'):
343+
continue
344+
345+
real_errors.append(line)
346+
328347
if real_errors:
329348
raise InputError(
330349
"Sella run failed.\n\n"

0 commit comments

Comments
 (0)