Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 555b8a6

Browse files
authored
Enable vars argument in misc._print.stanfit
Removed `if-else` block and moved the `pars` handling to `_summary` function. Now one can print summary for chosen pars. `print(pystan.misc._print_stanfit(fit, pars=['alpha', 'beta[0]', 'sigma'], probs=(0.025, 0.50, 0.975), digits_summary=3))`
1 parent 4683bc1 commit 555b8a6

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

pystan/misc.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ def _print_stanfit(fit, pars=None, probs=(0.025, 0.25, 0.5, 0.75, 0.975), digits
5656
"sampling is not conducted.".format(fit.model_name)
5757
elif fit.mode == 2:
5858
return "Stan model '{}' does not contain samples.".format(fit.model_name)
59-
if pars is None:
60-
pars = fit.sim['pars_oi']
61-
fnames = fit.sim['fnames_oi']
62-
else:
63-
# FIXME: does this case ever occur?
64-
# need a way of getting fnames matching specified pars
65-
raise NotImplementedError
6659

6760
n_kept = [s - w for s, w in zip(fit.sim['n_save'], fit.sim['warmup2'])]
6861
header = "Inference for Stan model: {}.\n".format(fit.model_name)

0 commit comments

Comments
 (0)