stan::io::reader and stan::io::writer use

34 views
Skip to first unread message

Michael Betancourt

unread,
Apr 1, 2015, 11:01:14 AM4/1/15
to stan...@googlegroups.com
Do stan::io::reader and stan::io::writer get used anywhere besides
when the parser generates model::transform_inits? I’m planning
on cleaning these up in refactoring the var_contexts and don’t
want to have any unintended side effects.

Bob Carpenter

unread,
Apr 1, 2015, 8:25:08 PM4/1/15
to stan...@googlegroups.com
The reader is used in

write_csv()
write_array()
log_prob()

Basically, everywhere you need to do the conversion from
unconstrained to constrained.

The writer is used in:

transform_inits()
write_csv_header()
write_csv()

In general, you can just look at a compiled model to see
where things get used. It's easier than tracing through the
code generator.

- 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,
Apr 2, 2015, 4:06:32 AM4/2/15
to stan...@googlegroups.com
Follow up — nothing uses write_csv and write_csv_header, right?
This might be an excuse to deprecate them and maybe even clean
up write_array...

Bob Carpenter

unread,
Apr 2, 2015, 8:13:08 AM4/2/15
to stan...@googlegroups.com
I don't know about CmdStan, RStan, or PyStan. But
if none of those are using them, we can just get rid of
them. We don't even need to deprecate them.

- Bob

Michael Betancourt

unread,
Apr 2, 2015, 8:58:57 AM4/2/15
to stan...@googlegroups.com
CmdStan doesn’t, and I know all the places in the C++ side
of Stan that use those functions so that just leaves RStan
and PyStan. Do you guys use them at all?

Allen B. Riddell

unread,
Apr 2, 2015, 10:26:59 AM4/2/15
to stan...@googlegroups.com
PyStan doesn't. RStan has a test:

rstan/tests/cpp/blocker.hpp

-a

Daniel Lee

unread,
Apr 2, 2015, 10:44:45 AM4/2/15
to stan...@googlegroups.com
I wrote that test: it can be removed safely.

Bob Carpenter

unread,
Apr 2, 2015, 11:38:08 PM4/2/15
to stan...@googlegroups.com
The code generator's modular. All you need to do is remove
the function to write the CSVs. These are definitions of
generate_write_csv() and generate_write_csv_header(), along with
the calls to them in the generate_cpp() function.

- Bob
Reply all
Reply to author
Forward
0 new messages