posteriordb icon indicating copy to clipboard operation
posteriordb copied to clipboard

Extract model inputs directly from the compiler

Open MansMeg opened this issue 5 years ago • 2 comments

This is an issue started from the following PR #192

Ping @mandel.

MansMeg avatar Sep 28 '20 12:09 MansMeg

Thank you for opening this issue.

I have updated the fork of the Stan compiler to add an option --info which outputs on the standard output a JSON object containing information about the model. It currently generates an object a field inputs containing a dictionary where each entry corresponds to a variable in the data block. To each variable is associated an object with two fields:

  • type: the base type of the variable ("int" or "real").
  • dimensions: the number of dimensions (0 for a scalar, 1 for a vector or row vector, etc.).

The code is available in the info branch of the fork: https://github.com/mandel/stanc3/tree/info

mandel avatar Sep 28 '20 19:09 mandel

Thanks! I will try to add this to the documentation somehow. Thanks!

MansMeg avatar Sep 30 '20 09:09 MansMeg