Skip to content

Don't error when fitting a model using reloaded CmdStanModel with compiled model methods#1158

Merged
jgabry merged 3 commits intomasterfrom
fix-reloaded-model-with-methods
Mar 19, 2026
Merged

Don't error when fitting a model using reloaded CmdStanModel with compiled model methods#1158
jgabry merged 3 commits intomasterfrom
fix-reloaded-model-with-methods

Conversation

@jgabry
Copy link
Member

@jgabry jgabry commented Mar 17, 2026

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

Closes #1157

CmdStanModel objects created using compile_model_methods = TRUE that are
then saved and reloaded no longer error in model fitting methods. Model methods
are recompiled lazily if needed.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Jonah Gabry

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.64%. Comparing base (47596d3) to head (ed3dd1f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
R/utils.R 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1158      +/-   ##
==========================================
+ Coverage   90.57%   90.64%   +0.07%     
==========================================
  Files          14       14              
  Lines        5921     5934      +13     
==========================================
+ Hits         5363     5379      +16     
+ Misses        558      555       -3     

☔ View full report in Codecov by Sentry.
📢 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.

@jgabry jgabry merged commit 962dd83 into master Mar 19, 2026
12 checks passed
@jgabry jgabry deleted the fix-reloaded-model-with-methods branch March 19, 2026 00:04
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.

Optimize fails to return model fit with precompiled model

2 participants