add percentiles 50-99.5 for each serie - #397
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
==========================================
+ Coverage 97.13% 97.36% +0.22%
==========================================
Files 209 213 +4
Lines 4159 4251 +92
Branches 1037 1062 +25
==========================================
+ Hits 4040 4139 +99
+ Misses 115 109 -6
+ Partials 4 3 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR extends the xNoiseSanPlot output to include computed intensity percentiles (intended to help choose contour plot minimum levels), and updates the implementation/tests accordingly.
Changes:
- Add
percentiles(positive/negative) toXNoiseSanPlotResultand compute them inxNoiseSanPlot. - Introduce
getPercentiles()to compute 50th–99.5th percentiles (0.5 step) from the pre-sorted sign arrays. - Adjust
determineCutOff()’s sigma-estimation scan to use theconsiderListrange, and update tests to assert the new percentiles output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/x/xNoiseSanPlot.ts | Adds percentile output + helper; modifies cut-off estimation loop and minor refactors/cleanup. |
| src/x/tests/xNoiseSanPlot.test.ts | Adds assertions for the new percentiles fields on the result. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for ( | ||
| let quantileFraction = 0.01; | ||
| quantileFraction <= 0.99; | ||
| let quantileFraction = from - step / 2; | ||
| quantileFraction <= to + step / 2; | ||
| quantileFraction += 0.01 | ||
| ) { |
| /** | ||
| * Calculates intensity percentiles ranging from the 50th to the 99.5th percentile | ||
| * (in 0.5 increments) from a pre-sorted array. | ||
| * @param sorted - a pre-sorted array of numbers. | ||
| * @returns An object mapping percentile labels to their corresponding values. | ||
| */ |
| expect(noiseWithoutBigPeaks.snr).toBeLessThan(noise.snr); | ||
|
|
||
| expect(Object.keys(noise.percentiles.positive)).toHaveLength(100); | ||
| expect(Object.keys(noise.percentiles.negative)).toHaveLength(100); |
There was a problem hiding this comment.
I would prefer an array of 101 elements from 0 to 100.
so positive[99] is 99%
it would be used to select the min level of contour plot.