Repository navigation
refactor: extract loadMS1Spectrum helper in BrukerTimsFile - #9152
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIntroduces an internal static helper Changes
Sequence Diagram(s)(omitted — changes are an internal refactor of MS1 centroiding logic) Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The centroid-or-copy branch for MS1 frame loading was duplicated across four call sites (loadDIA_, loadDDA_, loadDIAStreaming, loadFrameMode_). Extract a static loadMS1Spectrum(frame, spec, config, centroider) that runs IM-centroiding when configured and falls back to frameToSpectrum() otherwise. Each call site drops the local do_centroid bool and the if/else branch. Pure refactor: no behavior change. Existing BrukerTimsFile_test suite (13 sections including all DIA/DDA integration paths) passes unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
236b372 to
894b0d8
Compare
Summary
Dedupe the `if (do_centroid) centroidMS1Frame(...) else frameToSpectrum(..., 1)` branch that was copy-pasted in four MS1 loading loops (`loadDIA_`, `loadDDA_`, `loadDIAStreaming`, `loadFrameMode_`) into a single static helper `loadMS1Spectrum(frame, spec, config, centroider)`.
Motivation
Preparation for an upcoming `dia_ms1_n_neighbors` MS1 frame-aggregation feature. Collapsing the duplicated branch first keeps that PR focused on the aggregation logic itself rather than mechanical copy-paste fixes.
Contract
Pure refactor — no observable behavior change. The helper just dispatches on `isCentroidingEnabled(config)`.
Diff size
`src/openms/source/FORMAT/BrukerTimsFile.cpp`: +18 / −30 (net −12).
Test Plan
🤖 Generated with Claude Code
Summary by CodeRabbit