Skip to content

feat: re-add simplify= to print.compare.loo (#366)#369

Open
LeonidasZhak wants to merge 2 commits into
stan-dev:masterfrom
LeonidasZhak:feature/re-add-print-compare-loo-simplify
Open

feat: re-add simplify= to print.compare.loo (#366)#369
LeonidasZhak wants to merge 2 commits into
stan-dev:masterfrom
LeonidasZhak:feature/re-add-print-compare-loo-simplify

Conversation

@LeonidasZhak

@LeonidasZhak LeonidasZhak commented Jun 6, 2026

Copy link
Copy Markdown

Summary

This follow-up keeps the simplify restoration on print.compare.loo() and adds the missing focused coverage for the full-output path.

Thanks to maintainers

Thanks for the review and for pointing out the missing tests, scope cleanup, and AI disclosure requirement.

Issue or motivation

This PR follows up on #366 by restoring simplify = FALSE for print.compare.loo(), while keeping the default simplified output unchanged.

Root cause

The earlier branch restored the argument and print-path behavior, but it did not include focused test coverage for the full-output branch and it also carried an unrelated generated-file change.

Change

  • restore simplify in print.compare.loo() with default TRUE
  • document the restored full-output mode
  • add focused tests for print(comp2, simplify = FALSE) and the full comparison columns
  • keep the PR diff scoped by excluding the unrelated loo-package.Rd drift

Tests

  • Rscript -e 'devtools::test(filter = "compare", stop_on_failure = TRUE)'
  • R CMD build --no-build-vignettes .
  • _R_CHECK_FORCE_SUGGESTS_=false R CMD check --no-manual --ignore-vignettes --no-build-vignettes loo_2.9.0.9000.tar.gz

I used AI assistance to help check for issues, refine the code, and run tests.

Scope

This follow-up does not change the default printed output, does not alter model-comparison calculations, and does not expand the feature beyond the existing print.compare.loo() path discussed here.

@codecov-commenter

codecov-commenter commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.50000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.49%. Comparing base (286263d) to head (beec4b6).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
R/loo_compare.R 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #369      +/-   ##
==========================================
- Coverage   92.70%   92.49%   -0.22%     
==========================================
  Files          31       31              
  Lines        3029     3037       +8     
==========================================
+ Hits         2808     2809       +1     
- Misses        221      228       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

This is how benchmark results would change (along with a 95% confidence interval in relative change) if beec4b6 is merged into master:

  • ✔️loo_function: 1.89s -> 1.89s [-0.6%, +0.33%]
  • ✔️loo_matrix: 1.7s -> 1.7s [-0.58%, +0.67%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@florence-bockting

Copy link
Copy Markdown
Contributor

Thank you @LeonidasZhak for opening this PR. We had some discussion about whether to include/exclude this argument from loo_compare in this PR.
Therefore, we (@avehtari, @jgabry) need probably to discuss first how we want to handle this aspect and then we will come back to your PR.

@florence-bockting

florence-bockting commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Thanks again @LeonidasZhak for the PR.
Please read our AI contribution policy and disclose any use of AI.
Additionally, please add tests for any changes you make to functions; stating "manual verification" is not sufficient.
Finally, please avoid making changes to files unrelated to this PR, as was done in loo-package.Rd.

@LeonidasZhak

Copy link
Copy Markdown
Author

Thanks for the guidance. I pushed a follow-up commit that adds focused test coverage for print(comp2, simplify = FALSE), keeps the assertions narrow, and removes the unrelated loo-package.Rd drift from the PR diff.

I used AI assistance to help check for issues, refine the code, and run tests.

Local checks I ran before pushing:

  • Rscript -e 'devtools::test(filter = "compare", stop_on_failure = TRUE)'\n- R CMD build --no-manual --no-build-vignettes .\n- _R_CHECK_FORCE_SUGGESTS_=false R CMD check --ignore-vignettes --no-manual loo_2.9.0.9000.tar.gz\n- git diff --check

Add a 'simplify' parameter (default TRUE) to print.compare.loo().
When simplify=FALSE, the full comparison table is printed including
pointwise ELPD, LOOIC/WAIC, and their standard errors for each model.

This restores functionality that was available in previous versions
of loo, where users could see the complete model comparison output.

Changes:
- R/loo_compare.R: Add simplify parameter with documentation
- man/loo_compare.Rd: Regenerated by roxygen2
- man/loo-package.Rd: Minor roxygen2 update
@LeonidasZhak LeonidasZhak force-pushed the feature/re-add-print-compare-loo-simplify branch from 875df6f to 806dcf7 Compare June 12, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants