rugnux: a report for a live serial merge, without claims about what it did not measure

StillsLiveResult makes the ProcessResult the report is read from out of a
merge of StillsLiveMerge: cell and group merged in, the merge's statistics
and error model, frames analysed and indexed. ProcessResult::powder_measured
(true everywhere else) lets that result say powder rings were not looked
for, so the SUMMARY lists Powder as not measured instead of "no rings
detected". PathologyIsSerious names the codes behind the FAILED/UNUSABLE
verdicts (NO_LATTICE, UNUSABLE_MERGE).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HVeDQsU5a8AJUdJPgWevAK
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-11-11 16:13:30 +01:00
1 parent 3611ce3281
commit b7d35eb3bd
5 files changed
+39 -1

No files matched your search

+6
View File
@@ -61,6 +61,12 @@ namespace PathologyCode {
constexpr const char *OVERLAPS = "OVERLAPS"; // neighbouring spots share signal pixels
}
// The pathologies that leave no result to use - no lattice, or a merge without signal: the report's verdict
// is then FAILED or UNUSABLE. Every other code needs attention, with a result there to use.
inline bool PathologyIsSerious(const std::string &code) {
return code == PathologyCode::NO_LATTICE || code == PathologyCode::UNUSABLE_MERGE;
}
// A closed type plus an open description. The type is what machinery switches on; the text is what a
// person reads, and it is free-form on purpose - the vocabulary must not have to grow a code every
// time a sentence gains a number.
+3 -1
View File
@@ -3455,7 +3455,9 @@ ReportDocument BuildReportDocument(const std::string &output_prefix,
checked_row("Overloads", {PathologyCode::OVERLOADS}, overload_row);
if (!overlap_row.empty())
checked_row("Overlaps", {PathologyCode::OVERLAPS}, overlap_row);
if (!result.powder.rings_q_recipA.empty() || result.consensus_cell) {
if (!result.powder_measured)
untested("Powder", {PathologyCode::POWDER_RINGS});
else if (!result.powder.rings_q_recipA.empty() || result.consensus_cell) {
const auto &pw = result.powder;
checked_row("Powder", {PathologyCode::POWDER_RINGS}, pw.rings_q_recipA.empty() ? std::string("no rings detected")
: fmt::format("{} rings holding {:.0f}% of the spots found - {} ice ({:.0f}%), {} other "
+3
View File
@@ -829,6 +829,9 @@ struct ProcessResult {
// Powder contamination measured in the pre-scan: a crystalline phase other than the crystal,
// diffracting as rings among its reflections. Measured and reported on every run.
PowderRings powder;
// False where nothing measured it - the live serial analysis, which has no pre-scan: then the summary
// does not say "no rings detected".
bool powder_measured = true;
// Whether this run acted on it - left the rings out of indexing - and the resolution it stopped
// the indexing spot list at where it did.
bool powder_excluded_from_indexing = false;
+20
View File
@@ -236,3 +236,23 @@ StillsMergeOutput ReplayLiveStillsMerge(const DiffractionExperiment &experiment,
outcomes = live.TakeOutcomes();
return out;
}
ProcessResult StillsLiveResult(const DiffractionExperiment &experiment, const StillsMergeOutput &out,
int64_t images_analysed, int64_t images_indexed) {
ProcessResult result;
result.images_processed = static_cast<uint64_t>(images_analysed);
if (images_analysed > 0)
result.indexing_rate = static_cast<float>(images_indexed) / static_cast<float>(images_analysed);
result.consensus_cell = experiment.GetUnitCell();
result.space_group = experiment.GetGemmiSpaceGroup();
result.powder_measured = false;
result.has_merge_statistics = true;
result.merge_statistics = out.merge.statistics;
result.resolution_fit_A = out.merge.resolution_fit_A;
result.error_model_isa = out.merge.isa;
result.error_model_isa_resolved = out.merge.isa_resolved;
result.error_model_a = out.merge.a;
result.error_model_b = out.merge.b;
result.error_model_c = out.merge.c;
return result;
}
+7
View File
@@ -99,3 +99,10 @@ StillsMergeOutput ReplayLiveStillsMerge(const DiffractionExperiment &experiment,
const std::optional<UnitCell> &given_cell,
const std::optional<StillsRunWidth> &run_width, bool flag_ice, float ice_width,
const std::vector<double> &checkpoints, int nthreads, Logger &logger);
// The result the report is read from (BuildReportDocument), of a merge made here: the cell and group merged in
// (`experiment`), the merge's statistics and error model, the frames analysed and indexed. What this merge does
// not look at - powder rings, ice, further lattices, twinning, pseudo-translation, anisotropy - is left
// unmeasured, so the report's checklist says "not measured" for it, never a verdict.
ProcessResult StillsLiveResult(const DiffractionExperiment &experiment, const StillsMergeOutput &out,
int64_t images_analysed, int64_t images_indexed);