Repository navigation
[TEST] LinearResamplerAlign: pin single-spike / zero-width-interval edge cases (#9460) - #9526
Conversation
…dge cases (OpenMS#9460) Adds regression guards for the folded LinearResampler spike fix (OpenMS#9127). The area-preserving raster() distributes each raw point's intensity onto its two grid neighbours and divides by the grid spacing (never by the raw-point gap), so a lone spike or coincident (zero-width interval) raw points must conserve total intensity, never be amplified into a spurious larger peak, and never produce NaN/Inf. The existing sections never exercised these degenerate inputs. Three [EXTRA] sections on raster(): - single data point (start_pos == end_pos): one output point carrying all intensity - isolated off-grid spike: area preserved, split across the two neighbours, not amplified, and not leaked to the far ends of the spectrum - coincident raw m/z (zero-width interval): total intensity conserved, all finite Verified: builds clean and the test runs PASSED. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-15 15:14:34.688853578 +0000
+++ AUTHORS.new 2026-06-15 15:14:40.006440136 +0000
@@ -23,8 +23,8 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
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)
📝 WalkthroughWalkthroughThree regression test sections are added to ChangesLinearResamplerAlign Regression Tests
Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
What
Adds three
[EXTRA]regression sections toLinearResamplerAlign_test.cppexercisingraster()on degenerate inputs:start_pos == end_pos, a zero-width resampling interval) → exactly one output point carrying the full intensity.Why
This closes the §7
[AUTO]gap in the OpenMS 3.6.0 pre-release testing plan (#9460):The existing sections only resample well-behaved multi-point spectra; none exercised a lone spike or coincident m/z.
raster()is area-preserving because it distributes each raw point's intensity onto its two grid neighbours and divides by the grid spacing (dist_left + dist_right), never by the raw-point gap — so a zero-width interval in the input must not divide by zero or fabricate a spurious peak. These tests pin exactly that contract.Test plan
Tests only — no production code changed. Verified locally three ways:
-fsyntax-onlyclean, then full target build green;rasteralgorithm (single point → intensity 7 at one bin; [email protected] → 2.5/2.5 split across m/z 2.0/2.5, sum 5, nothing far; coincident m/z → sum 10, all finite).Part of #9460. Follows #9524 (native-ID parser) and #9525 (copy independence).
🤖 Generated with Claude Code
Summary by CodeRabbit