Skip to content

Make sure metadata() has correct value for num_chains#1187

Merged
jgabry merged 1 commit into
masterfrom
bugfix-metadata-num-chains
May 5, 2026
Merged

Make sure metadata() has correct value for num_chains#1187
jgabry merged 1 commit into
masterfrom
bugfix-metadata-num-chains

Conversation

@jgabry
Copy link
Copy Markdown
Member

@jgabry jgabry commented May 4, 2026

Submission Checklist

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

Summary

fixes #1186
Fixes num_chains in fit$metadata(). Previously it was always returning 1. I suppose it should really be chains instead of num_chains to match CmdStanR's arguments, but since we've been using num_chains (inherited from the CmdStan CSV names) I'll leave it as num_chains for backwards compatibility.

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
Copy Markdown

codecov-commenter commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.19%. Comparing base (48b825d) to head (3b3fbc6).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1187      +/-   ##
==========================================
- Coverage   91.21%   91.19%   -0.02%     
==========================================
  Files          15       15              
  Lines        6121     6121              
==========================================
- Hits         5583     5582       -1     
- Misses        538      539       +1     

☔ 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
Copy link
Copy Markdown
Member Author

jgabry commented May 4, 2026

@VisruthSK I think this windows run is failing at the spot that you changed in #1182

https://github.com/stan-dev/cmdstanr/actions/runs/25310119846/job/74194792020?pr=1187#step:13:7723

Seems like it's not deterministic. I think it also initially failed in your roxygen2 PR but then passed when I reran it (and it failed again after I merged it into master). Rerunning again now to see if it passes. We also have some non-determinism in the Mac tests that I'd like to sort out at some point (if possible). I tried at one point, but then got distracted with other work. I can try again at some point, or if you're interested you can take a look. Not super urgent.

@jgabry jgabry merged commit 5576fd7 into master May 5, 2026
33 of 36 checks passed
@jgabry jgabry deleted the bugfix-metadata-num-chains branch May 5, 2026 06:31
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.

fit$metadata()$num_chains does not return number of chains

2 participants