Battery: SHELXL's K row may start negative

The top-group K was parsed with a pattern that stopped at a minus sign,
so a weak first group (K -4.6) raised IndexError and lost the set's
SHELXL numbers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5K8jvPPbmCrbqnWkddTuB
This commit is contained in:
2026-10-04 16:21:42 +02:00
co-authored by Claude Opus 5.5
parent 58a4bf7302
commit df2ee77e50
+1 -1
View File
@@ -181,7 +181,7 @@ def run_shelxl(shelxl, name, cwd):
k_top = None
i = lst.rfind("Analysis of variance for reflections employed in refinement")
if i >= 0:
m = re.search(r"\n\s+K\s+([\d. ]+)", lst[i:i + 3000])
m = re.search(r"\n\s+K\s+([-\d. ]+)", lst[i:i + 3000])
k_top = num(m.group(1).split()[-1]) if m else None
n4 = last(r"R1 =\s*[\d.]+ for\s+(\d+) Fo > 4sig")
return {"shx_r1": num(last(r"R1 =\s*([\d.]+) for\s+\d+ Fo > 4sig")),