Map_rect wish list

Hi Stan developers -

I have a proposal for what I hope would be a small change to the map_rect function, which I have come to use a lot. Currently the function takes an array of integers, an array of reals, each varying by shard, an array of shard-varying parameters and a vector of non-varying parameters.

What would be really great is a vector of non-varying integers. The reason is because with more complicated models, a number of parameters need to be passed to the function to determine what kind of model to run, etc. While it is possible to append these on to the varying integer, the code would be much cleaner/logical with a separate vector.

Anyhow just a suggestion, I know you guys have a lot of other stuff going on.

all best,

Bob

Thanks for the suggestion. I created an issue to go along with it in the math repo, which is where it would have to be developed first:

Wow thanks so much Bob! I appreciate it. I’ll add a comment to the issue.

Could we solve this issue by allowing functions to see the data/transformed data blocks?

This was discussed a while ago and the decision was that this obstructs too much the current design and encapsulation concepts… for example, the functions block is declared before the data blocks.

(but I do agree that this would be super-useful to do)