stan::services API, configuring via JSON

33 views
Skip to first unread message

Allen B. Riddell

unread,
Mar 16, 2015, 8:04:44 AM3/16/15
to stan...@googlegroups.com
Hi,

I'm trying to build a proof-of-concept for a way for Stan to provide a
service that would handle validating parameters (and setting defaults)
such that PyStan and RStan could use the service.

I was thinking that this might be possible if one added two methods to

stan/services/arguments/argument_parser

- int parse_args_json(std::string, std::ostream* out = 0, std::ostream* err = 0)
- std::string to_json() (since PyStan and RStan need a way of knowing about the values that are set)

Does this make sense as a strategy? Is anyone else working on this?

Also -- is the json based var_context used anywhere (json.hpp / json_data.hpp)?

Thanks,

Allen

Bob Carpenter

unread,
Mar 16, 2015, 8:00:22 PM3/16/15
to stan...@googlegroups.com
I was hoping Michael or Daniel would weigh in here. They've
put a lot of thought into this; see:

https://github.com/stan-dev/stan/wiki/Stan-API-Refactor

To answer your last question, no, JSON's not used
anywhere. Mitzi and I built it assuming we'd add an option
to read data in JSON format, but nobody's seen it through (Mitzi
just got a new job that's keeping her busy and I'm working on
other things that seem higher priority).

- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Michael Betancourt

unread,
Mar 16, 2015, 8:15:33 PM3/16/15
to stan...@googlegroups.com
I was going to wait until the meeting tomorrow for a proper discussion,
as there are conflicts with the current refactor (turns out non-modular
code can’t really be refactored modularly!).

Bob Carpenter

unread,
Mar 16, 2015, 8:21:23 PM3/16/15
to stan...@googlegroups.com

> On Mar 17, 2015, at 11:15 AM, Michael Betancourt <betan...@gmail.com> wrote:
>
> I was going to wait until the meeting tomorrow for a proper discussion,

Allen's not usually at the meetings, but maybe he'll be at
this week's (it's soooo confusing being in Australia since the
meeting's later today, not tomorrow).

> as there are conflicts with the current refactor (turns out non-modular
> code can’t really be refactored modularly!).

:-) Well said. This was what was holding Daniel's efforts up.

Allen B. Riddell

unread,
Mar 17, 2015, 8:18:35 AM3/17/15
to stan...@googlegroups.com
I can make it today at 3pm.

The JSON var_context looks really good to me. I'm tempted to try to use
it in PyStan instead of the Python/Cython var_context.

Best,

-a

Michael Betancourt

unread,
Mar 17, 2015, 8:25:54 AM3/17/15
to stan...@googlegroups.com
Meeting time has changed — we’re at 9 AM east coast time now
(i.e. in 35 minutes).
Reply all
Reply to author
Forward
0 new messages