-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor plot tests #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the BayesTools test suite by adding new reference outputs for JAGS model tests and strengthening test organization guidelines to prevent duplication. The changes ensure reproducibility through updated reference tables and clarify protocols for maintaining test consistency.
Key changes:
- Added/updated reference output files for JAGS model summary tables, ensemble tables, and marginal distribution estimates
- Strengthened duplication avoidance guidelines in test organization documentation with explicit AI agent protocols
- Updated environment variable assignment in test files from local to global scope
Reviewed changes
Copilot reviewed 30 out of 572 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/results/JAGS-summary-tables/*.txt |
New reference tables for weight function, PET/PEESE, orthonormal contrast, mixed models, and marginal models |
tests/results/JAGS-marginal-distributions/*.txt |
New marginal estimate tables with diagnostic warnings for spike-slab and model averaging |
tests/results/JAGS-ensemble-tables/*.txt |
Updated spike factor estimates and inference tables, plus new mixed posteriors estimates |
.github/instructions/tests.instructions.md |
Strengthened anti-duplication guidelines and added AI agent protocol for test creation |
| # Define at the top of test files with reference outputs | ||
| # Load common test helpers that define test_reference_table() and test_reference_text() | ||
| REFERENCE_DIR <- testthat::test_path("..", "results", "print") | ||
| REFERENCE_DIR <<- testthat::test_path("..", "results", "print") |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the global assignment operator <<- for REFERENCE_DIR is unconventional for test setup. Consider using regular assignment <- within test files, or if global scope is needed, document why this specific scoping is required. Global assignment can make tests harder to reason about and may cause unexpected side effects in the test environment.
| REFERENCE_DIR <<- testthat::test_path("..", "results", "print") | |
| REFERENCE_DIR <- testthat::test_path("..", "results", "print") |
This pull request updates the BayesTools test suite with new reference outputs for JAGS-based models and refines the test organization guidelines to enforce stricter duplication avoidance. The changes improve reproducibility and clarity in model testing, while also providing clearer protocols for both human and AI contributors to maintain consistency and minimize redundancy.
Test organization and maintenance guidelines:
.github/instructions/tests.instructions.md, requiring exhaustive checks before adding new models and introducing an explicit AI agent protocol for test creation and refactoring. [1] [2]REFERENCE_DIR.Reference output updates for JAGS models:
tests/results/JAGS-ensemble-tables/andtests/results/JAGS-summary-tables/. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Corrections and updates to spike factor outputs: