From cb4240767e9b018a9f638fa71279da99f2d03596 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 18 Nov 2026 10:32:50 +0100 Subject: [PATCH] Refinement: REFINE_ADP_MODEL keeps a round's displacement model where its U are held After a second round whose weight trials held the U the first round's TLS or U-per-atom choice made, the label was reset to "isotropic" (or "the model's U held") because the kept trial carried no hypothesis name. It now keeps the first round's model with ", U held"; and a model whose per-atom U are held also drops the input's TLS groups, as one that refined them does. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UqXYdHHZ4cogS1mrGUtfN7 --- image_analysis/structure_refinement/Refinement.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/image_analysis/structure_refinement/Refinement.cpp b/image_analysis/structure_refinement/Refinement.cpp index 71d66f645..3ab866fba 100644 --- a/image_analysis/structure_refinement/Refinement.cpp +++ b/image_analysis/structure_refinement/Refinement.cpp @@ -3291,7 +3291,7 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector *groups = ctx.st.meta.get_tls_groups()) @@ -4380,9 +4380,12 @@ RefinementResult RefineOnce(const gemmi::Structure &placed, const std::vector(k); } - // (the model where the weights ended keeps the displacement model a round before chose for it) - if (result.adp_model.empty() || state.trial.adp.empty()) + // (the model where the weights ended keeps the displacement model a round before chose for it, its U held by + // the weight trials since) + if (result.adp_model.empty()) result.adp_model = result.adp_input == "isotropic" ? "isotropic" : "the model's U held"; + else if (state.trial.adp.empty() && result.adp_model != "isotropic" && !result.adp_model.ends_with("held")) + result.adp_model += ", U held"; if (best >= 0) { result.adp_model = outcomes[best].trial.adp; state = std::move(outcomes[best]);