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

Commit 278620d

Browse files
authored
renamed _print_stanfit to misc.stansummary
linked `_print_stanfit` to `stansummary` function and added deprecation warning.
1 parent a872387 commit 278620d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pystan/misc.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
logger = logging.getLogger('pystan')
5151

5252

53-
def _print_stanfit(fit, pars=None, probs=(0.025, 0.25, 0.5, 0.75, 0.975), digits_summary=2):
53+
def stansummary(fit, pars=None, probs=(0.025, 0.25, 0.5, 0.75, 0.975), digits_summary=2):
5454
if fit.mode == 1:
5555
return "Stan model '{}' is of mode 'test_grad';\n"\
5656
"sampling is not conducted.".format(fit.model_name)
@@ -76,6 +76,11 @@ def _print_stanfit(fit, pars=None, probs=(0.025, 0.25, 0.5, 0.75, 0.975), digits
7676
s['summary_colnames'], digits_summary)
7777
return header + body + footer
7878

79+
def _print_stanfit(fit, pars=None, probs=(0.025, 0.25, 0.5, 0.75, 0.975), digits_summary=2):
80+
# warning added in PyStan 2.17.0
81+
warnings.warn('Function `_print_stanfit` is deprecated and will be removed in a future version. '\
82+
'Use `stansummary` instead.', DeprecationWarning)
83+
return stansummary(fit, pars=None, probs=(0.025, 0.25, 0.5, 0.75, 0.975), digits_summary=2)
7984

8085
def _array_to_table(arr, rownames, colnames, n_digits):
8186
"""Print an array with row and column names

0 commit comments

Comments
 (0)