Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of single-length inits for containers #857

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

andrjohns
Copy link
Collaborator

Submission Checklist

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

Summary

Resolves the bug report in #855, which identified a more general issue that passing initial values for single-element containers would fail due to the auto_unbox setting in jsonlite treating them as scalars, resulting in cmdstan throwing a dimension-mismatch error.

This PR updates the processing of init-lists to check whether the initial value is for a single dimension-container and then format the value appropriately

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):
Andrew Johnson

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 Sep 25, 2023

Codecov Report

Merging #857 (881ef6e) into master (17678d5) will increase coverage by 0.00%.
Report is 31 commits behind head on master.
The diff coverage is 100.00%.

❗ Current head 881ef6e differs from pull request most recent head 50616d0. Consider uploading reports for the commit 50616d0 to get more accurate results

@@           Coverage Diff           @@
##           master     #857   +/-   ##
=======================================
  Coverage   88.19%   88.20%           
=======================================
  Files          12       12           
  Lines        4218     4221    +3     
=======================================
+ Hits         3720     3723    +3     
  Misses        498      498           
Files Coverage Δ
R/args.R 97.77% <100.00%> (+0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@andrjohns
Copy link
Collaborator Author

@rok-cesnovar would you be able to have a look over this when you get a minute? It's a bugfix for #855

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

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

Thanks, was a quick review :)

@andrjohns
Copy link
Collaborator Author

Brilliant, thanks!

@andrjohns andrjohns merged commit 77a1443 into master Sep 27, 2023
12 checks passed
@jgabry jgabry deleted the single-length-init branch September 27, 2023 16:21
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.

unconstrain_draws: mismatch in number dimensions declared and found in context
3 participants