Skip to content

Fix #579: re-enable approx inference vignette evaluation#591

Merged
seabbs merged 5 commits intoepinowcast:mainfrom
seabbs-bot:fix-vi
Apr 9, 2026
Merged

Fix #579: re-enable approx inference vignette evaluation#591
seabbs merged 5 commits intoepinowcast:mainfrom
seabbs-bot:fix-vi

Conversation

@seabbs-bot
Copy link
Copy Markdown
Contributor

@seabbs-bot seabbs-bot commented Apr 8, 2026

This is entirely from an agent so do not review until I have pinged for review as I will do a first pass

Summary

  • Re-enabled code evaluation in the approximate inference vignette (eval = TRUE)
  • Added paul-buerkner/brms to Remotes in DESCRIPTION to use the development version which includes the pathfinder path fix (Account for new path__ variable in CmdStan 2.37 with algorithm="pathfinder" paul-buerkner/brms#1831)
  • Pre-compile the Stan model before timing comparisons so compilation cost is excluded from all methods
  • Use update() throughout for all inference methods (HMC, Laplace, ADVI, Pathfinder)
  • Removed outdated Pathfinder stability warning as the issue has been fixed in recent brms/cmdstanr versions
  • Added NEWS.md entry

Context

The vignette was disabled because brms had a path issue when reading Stan files with CmdStan 2.37's pathfinder algorithm. This has been fixed in the development version of brms but not yet released to CRAN (current CRAN version 2.23.0 was published 2025-09-09, fix merged 2025-10-31).

Test plan

Closes #579

This was opened by a bot. Please ping @seabbs for any questions.

The vignette was disabled due to a brms path issue with CmdStan 2.37's
pathfinder algorithm (paul-buerkner/brms#1831). This has been fixed in
the development version of brms, so add brms to Remotes and re-enable
vignette evaluation.

Closes epinowcast#579

Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Walkthrough

The pull request adds a remote dependency entry to the package DESCRIPTION file, specifying paul-buerkner/brms, and enables code chunk execution in the approx-inference vignette by changing the global knitr evaluation option from FALSE to TRUE.

Changes

Cohort / File(s) Summary
Package Metadata
DESCRIPTION
Added paul-buerkner/brms to the Remotes field to declare an additional remote dependency alongside the existing cmdstanr remote.
Vignette Configuration
vignettes/approx-inference.Rmd
Changed global knitr chunk option from eval = FALSE to eval = TRUE, enabling code execution during vignette rendering by default.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop, a skip, a dependency new—
brms joins the party, the Remotes crew!
And chunks shall compute, no longer confined,
This vignette awakens, no longer blind! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: re-enabling vignette evaluation and fixing issue #579. It accurately reflects both key changes in the PR (the vignette eval flag flip and the contextual purpose).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Add NEWS.md entry for the approx inference vignette re-enablement.
Created epinowcast#592 to track removing brms from Remotes once CRAN catches up.

Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
DESCRIPTION (1)

73-73: If retaining the GitHub dependency, pin to a specific commit; otherwise, consider removing it.

The GitHub dependency was added to access the pathfinder fix before CRAN release. However, brms 2.23.0 (released September 2025) includes pathfinder support and any related fixes as of that date. As of April 2026, this dependency may now be unnecessary.

If the dependency must remain, pin to a specific commit or tag to ensure build reproducibility:

Suggested pin format
-    paul-buerkner/brms,
+    paul-buerkner/brms@<commit-sha>,

Otherwise, verify that CRAN brms can be used directly and remove this entry. If removal is planned, ensure issue #579 tracks the cleanup.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DESCRIPTION` at line 73, The DESCRIPTION entry currently lists the GitHub
dependency "paul-buerkner/brms,"; either remove this dependency if CRAN brms >=
2.23.0 (which contains pathfinder) can be used, or pin the GitHub reference to a
specific commit or tag to ensure reproducible builds (replace
"paul-buerkner/brms" with a commit-pinned ref); if you remove it, add a note
referencing issue `#579` to track the cleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@DESCRIPTION`:
- Line 73: The DESCRIPTION entry currently lists the GitHub dependency
"paul-buerkner/brms,"; either remove this dependency if CRAN brms >= 2.23.0
(which contains pathfinder) can be used, or pin the GitHub reference to a
specific commit or tag to ensure reproducible builds (replace
"paul-buerkner/brms" with a commit-pinned ref); if you remove it, add a note
referencing issue `#579` to track the cleanup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 013cebc9-2ba7-4b06-a453-449a5beb378c

📥 Commits

Reviewing files that changed from the base of the PR and between 3d6ee3e and 5b0cf07.

📒 Files selected for processing (2)
  • DESCRIPTION
  • vignettes/approx-inference.Rmd

@seabbs seabbs self-requested a review April 8, 2026 16:30
seabbs
seabbs previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

Not ideal we need to rely on an unreleased version but seems like a reasonable solution for now. I have had @seabbs-bot make an issue for tracking the release of brms so we can move to using that when released.

@seabbs seabbs enabled auto-merge (squash) April 8, 2026 16:42
Pre-compile the Stan model before timing comparisons so compilation
cost is not included in HMC time. Use update() throughout for all
inference methods. Remove outdated Pathfinder stability warning as
the issue has been fixed in recent brms/cmdstanr versions.

Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
auto-merge was automatically disabled April 8, 2026 16:55

Head branch was pushed to by a user without write access

seabbs-bot and others added 2 commits April 8, 2026 17:58
Use brms empty = TRUE pass-through to compile the model without
fitting, rather than running a minimal fit with chains = 1, iter = 5.

Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
update() doesn't work on empty brmsfits, so use a minimal fit
(chains = 1, iter = 5) for pre-compilation instead.

Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
Copy link
Copy Markdown
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

LGTM

@seabbs seabbs enabled auto-merge (squash) April 8, 2026 17:00
@seabbs seabbs disabled auto-merge April 9, 2026 09:52
@seabbs seabbs merged commit 6b4f91f into epinowcast:main Apr 9, 2026
9 of 10 checks passed
@seabbs
Copy link
Copy Markdown
Contributor

seabbs commented Apr 9, 2026

@athowes I added precompilation here and that changed the timing difference by about 5 times. Also note that with the newest release of pathfinder things seem much more stable.

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.

Approx bayes vignette fails due to a path issue in reading in the stan file

2 participants