diff --git a/rugnux/Rugnux.cpp b/rugnux/Rugnux.cpp index 7ebc3be7..4b742832 100644 --- a/rugnux/Rugnux.cpp +++ b/rugnux/Rugnux.cpp @@ -286,6 +286,11 @@ ProcessResult Rugnux::Run(RugnuxObserver *observer) { force_rotation_result_.reset(); } } + // The space group was DECIDED in pass 1 and only reused by pass 2, which therefore has no search + // of its own to report. Carry pass 1's over, or the evidence behind the decision (operator CCs, + // absence counts, the refused higher symmetry) is never shown on the default rotation path. + if (!pass2.space_group_search.has_value()) + pass2.space_group_search = pass1.space_group_search; return pass2; } return RunPipeline(observer, /*write_output=*/true, /*geometry_prepass=*/false); @@ -1351,6 +1356,15 @@ ProcessResult Rugnux::RunPipeline(RugnuxObserver *observer, bool write_output, b // cell we reindex into - otherwise the space group and the written cell disagree. if (chosen.centring_type() == cand.centering) { sg_search = s2; + // Swap the metric-matching candidate into the answer and leave the one it + // displaced among the alternatives, so the reported "or ..." list stays the + // set of groups the data cannot separate, each named once. + if (chosen.number != s2.best_space_group->number) { + sg_search.alternatives.push_back(*s2.best_space_group); + std::erase_if(sg_search.alternatives, [&](const gemmi::SpaceGroup &a) { + return a.number == chosen.number; + }); + } sg_search.best_space_group = chosen; commit_reindex = reindex; commit_cell = cand.conventional.GetUnitCell();