[jaspQualityControl] Add clearer error message for Time Weighted Charts when too many...#437
Open
sisyphus-jasp wants to merge 1 commit intojasp-stats:masterfrom
Open
Conversation
…ts when too many...
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #437 +/- ##
==========================================
- Coverage 81.09% 80.93% -0.17%
==========================================
Files 17 17
Lines 9347 9376 +29
==========================================
+ Hits 7580 7588 +8
- Misses 1767 1788 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes: https://github.com/jasp-stats/INTERNAL-jasp/issues/3114
Root cause
cbindrow mismatch.What changed
R/TimeWeightedCharts.Ronly..Cusumchart()and.EWMA()for staged, data-based SD runs..controlChart()and crashing..stageHasTooFewObservationsForMovingRange().timeWeightedStagesMovingRangeErrorMessage()Why
Verification
/workspace/attachment/ControlChartsTest.jaspbefore fix: fatal error.complete; CUSUM plot now shows clear stage/moving-range error.testAll()after changes:[ FAIL 877 | WARN 16 | SKIP 0 | PASS 240 ](improved vs provided baseline[ FAIL 883 | WARN 16 | SKIP 0 | PASS 234 ]; remaining failures are pre-existing broad-suite issues).Caveats for review
Implementation Plan
Root cause
In
R/commonQualityControl.R(CUSUM/EWMA sigma-from-moving-range path), code buildsmrMatrixwithcbind()assuming each stage has enough points for selected moving-range length. With many stages and only one point per stage, generated vectors have incompatible lengths and.controlChart()throws a fatal error.Proposed changes
R/TimeWeightedCharts.R.controlChart()in.Cusumchart()and.EWMA()..controlChart()internals.Expected test impact
Add clearer error message for Time Weighted Charts when too many stages result in only one data point per stage
Attachment files available in: /workspace/attachment/
Files: ControlChartsTest.jasp
Test Results
Automated Code Review
Approved after 1 review iteration(s).