feat(pragmastat): add compare1 and compare2 options#3591
Merged
jqnatividad merged 3 commits intomasterfrom Mar 8, 2026
Merged
Conversation
…ysis Leverage pragmastat v12.0.0's compare module to test one-sample (center/spread) and two-sample (shift/ratio/disparity) estimates against user-defined thresholds, producing a verdict of less/greater/inconclusive per metric. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…clusivity tests Extract fallback closures in compute_compare1 and compute_compare2 to eliminate repeated struct construction across error/empty paths. Add test cases for --compare1 + --compare2 and --compare2 + --twosample mutual exclusivity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new confirmatory-analysis modes to qsv pragmastat to compare one-sample or two-sample estimates against user-specified thresholds, including updated CLI help text and an expanded test suite.
Changes:
- Introduces
--compare1(center/spread) and--compare2(shift/ratio/disparity) CLI options with threshold parsing and CSV outputs. - Implements compare1/compare2 computation + writers alongside existing one-sample/two-sample paths.
- Adds comprehensive integration tests covering basic behavior, selection, non-numeric inputs, error cases, and mutual exclusivity.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/cmd/pragmastat.rs |
Adds CLI flags, mutual-exclusion validation, threshold parsing, and compare1/compare2 compute + output paths. |
tests/test_pragmastat.rs |
Adds end-to-end tests for the new compare1/compare2 modes and their error handling. |
Trim metric/value after colon split, reject NaN/Inf thresholds, and add many-pairs warning to compare2 matching twosample behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
No description provided.