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

Convert lists of matrices to draws_array objects #387

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

paul-buerkner
Copy link
Collaborator

Summary

This PR allows to convert lists of matrices to draws_array objects. We had to initially revert as it was causing issues in cmdstanr models with one chain (#386).

In this PR I also fix the issue with as_array_matrix_list such that we now should no longer see any issues. Interestingly, I believe that the bug in as_array_matrix_list existed also previously (for a long time I think). Just nobody used as_array_matrix_list until I made more objects to trigger it being called. Anyway it works now.

@jgabry can you perhaps quickly check and confirm that it now works as expected? It passes all posterior and cmdstanr tests for me and works with one-chain models.

Copyright and Licensing

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

x <- abind::abind(x, along = 3L)
}
x <- aperm(x, c(1, 3, 2))
x <- abind::abind(x, along = 3L)
Copy link
Member

Choose a reason for hiding this comment

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

great, this should avoid the cmdstanr error with 1 chain

Copy link
Member

@jgabry jgabry left a comment

Choose a reason for hiding this comment

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

I accidentally broke it when fixing a merge conflict, but should be good now. Your changes look good. Will merge when it finishes running the tests.

@jgabry
Copy link
Member

jgabry commented Dec 17, 2024

Will go ahead and merge. The failure on ubuntu-latest (3.6) is unrelated.

@jgabry jgabry merged commit aeb26ba into master Dec 17, 2024
8 of 11 checks passed
@jgabry jgabry deleted the convert-list-of-matrices-to-draws_array branch December 17, 2024 20:19
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.

2 participants