Skip to content

Add classes to all loo warnings - #417

Open
florence-bockting wants to merge 4 commits into
masterfrom
add-loo-warning-classes
Open

florence-bockting wants to merge 4 commits into
masterfrom
add-loo-warning-classes

Conversation

@florence-bockting

Copy link
Copy Markdown
Contributor

Description

This PR adds a class to each loo warning, following up on our corresponding work in the posteriorpackage: stan-dev/posterior#470.

  • Every warning has the class loo_warning and a class for its cause.
  • Diagnostic warnings have the class loo_warning_diagnostic.
  • The warning text is unchanged and, similar to posterior, a list of warning classes and messages is provided in R/loo-package.R
  • Adds rlang to Imports.
  • Deletes the unused throw_psis_r_eff_warning() and throw_loo_r_eff_warning() (this was dead code)

This PR is related to Issue #353 (but does not fully solve it).
The PR was assisted by an LLM.

@codecov-commenter

codecov-commenter commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.27273% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.92%. Comparing base (d18de1f) to head (4b90398).

Files with missing lines Patch % Lines
R/loo_compare.psis_loo_ss_list.R 35.71% 9 Missing ⚠️
R/loo_subsample.R 0.00% 7 Missing ⚠️
R/psis_approximate_posterior.R 50.00% 2 Missing ⚠️
R/psislw.R 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
+ Coverage   92.65%   92.92%   +0.26%     
==========================================
  Files          31       31              
  Lines        3240     3249       +9     
==========================================
+ Hits         3002     3019      +17     
+ Misses        238      230       -8     

☔ 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 Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Status Name Current Incoming Interval
✔️ loo_matrix 1.44s 1.44s [-0.54%, +0.45%]
✔️ loo_function 1.31s 1.3s [-0.56%, +0.16%]

Further explanation regarding interpretation and methodology can be found in the documentation.

@florence-bockting
florence-bockting marked this pull request as ready for review November 3, 2026 06:15

@jgabry jgabry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I made a few suggestions, but pretty small.

Comment thread R/psis.R Resolved
Comment thread R/psis.R Resolved
Comment thread R/loo-package.R Resolved
Comment thread NEWS.md Resolved
Comment thread R/loo-package.R Resolved
Comment thread tests/testthat/test_warning_classes.R Resolved
Comment thread R/loo_subsample.R Resolved

This branch has not been deployed

No deployments
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.

3 participants