array-valued transform arguments#552
Conversation
|
I don't quite feel prepared to review the OCaml, but this is huge! We've been wanting to do this for ages. We've been improving indexing into error messages every place we can, so that'll also be great if that can be fixed. |
|
With develop cmdstan you can set this in make/local to test this PR: STANC3_TEST_BIN_URL = https://jenkins.mc-stan.org/job/stanc3-test-binaries/106/artifact I can review but would like some help testing if everything is fine in terms of modelling. |
|
@nhuurre can you merge master in? I can review this today. |
|
whow 10k lines of code! |
rok-cesnovar
left a comment
There was a problem hiding this comment.
The changes look good. I think the checks should go in the stan repo.
| } | ||
|
|
||
| template <typename T> | ||
| void FnCheckShape__(const char* var_name, size_t depth, |
There was a problem hiding this comment.
Could we move this functions to the stan-dev/stan repo? Not sure of the best location but I guess under /model/checks.hpp and then add that header to the model_header? They would probably have to be named more in the style of math / stan C++ conventions we use. So something like check_shape().
The other functions that dont depend on model specific should probably also go there but that is not this PRs fault and most of them can actually just be removed.
There was a problem hiding this comment.
Yeah, I was definitely being lazy. I think this actually belongs in the math library. FnCheckShape__ is a generalization of check_consistent_size. Alternatively it could be replaced by check_matching_dims if that recursed into arbitrary arrays.
There was a problem hiding this comment.
I am fine with either of the proposed solutions.
rok-cesnovar
left a comment
There was a problem hiding this comment.
One minor thing then its good to go.
|
Thanks! |
|
Hey, @rok-cesnovar ,just curious, why do you squash the history when merging these? |
|
No reason, its the default option I think. |
|
I don't think that's a good default. It doesn't matter for small fixes like this PR but optimization debugging was a sequence of small changes with associated explanations and now all of that is a single huge blob. Good luck figuring out which parts of the code those bullet points refer to. |
|
I don't think it is the default. At least it wasn't when I set things up. We had a long go around on this ages ago and decided to keep all the commit and merge history bubbles. If you are going to squash history, whatever you do, don't rewrite it on the origin (GitHub)---only collapse commits locally before pushing to origin. |
|
stanc3 has these three options on: Allow merge commits Allow squash merging Allow rebase merging Should we just allow the first option then? I am fine with that. |
|
Yes, I think the first is the preferred action. |
|
Done. |
Fix #547
Non-scalar values are now allowed in
lower,upper,offsetandmultipliertransforms if the value has the same type and size as the declared variable.Note that container bounds check error messages have always been kind of bogus.
The opaque indexing is being fixed in math (stan-dev/math#1635) but it doesn't support array-valued bounds.