suppressing or redirecting pystan output?

507 views
Skip to first unread message

Jesse Bloom

unread,
Oct 28, 2014, 2:50:16 PM10/28/14
to stan-...@googlegroups.com
Hi,

I am running pystan (currently through the StanModel.sampling function). This creates a huge amount of output. Even when I put refresh=-1, I still get some output at the terminal, such as the Informational Messages and the Elapsed Time.

Is there a way for me to either suppress this output or redirect it to a file. Right now having so much output generated by pystan is inhibiting my efforts to print more limited and informative messages within my actual Python program.

Thanks,
Jesse

Allen Riddell

unread,
Oct 28, 2014, 5:00:32 PM10/28/14
to stan-...@googlegroups.com
Hi Jesse,

Solving this is on the list of TODOs
(https://github.com/stan-dev/pystan/issues/98).

You might be able to stop the output by manipulating standard error. See
file:///usr/share/doc/python3.4/html/library/sys.html?highlight=stderr#sys.stderr

Is refresh=-1 indicated as an option somewhere that should suppress output?
I don't see it in the docs immediately.

Thanks,

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

Jesse Bloom

unread,
Oct 28, 2014, 6:48:07 PM10/28/14
to stan-...@googlegroups.com, a...@ariddell.org
Hi Allen,

The refresh=-1 reduces the output.

I don't think redirecting Python's standard error via sys.stderr works, since this only works for the process but not for any spawned child processes. It appears that pystan spawns child processes that are writing the output.

Thanks,
Jesse

Allen Riddell

unread,
Oct 28, 2014, 8:17:39 PM10/28/14
to Jesse Bloom, stan-...@googlegroups.com
Hi Jesse,

You can specify n_jobs=1 in the call to sampling and PyStan will not spawn any
additional processes.

Thanks,

-a
> > an email to stan-users+...@googlegroups.com <javascript:>.
Reply all
Reply to author
Forward
0 new messages