Skip to content

Commit 2b84333

Browse files
committed
Do not compute convergence checks without samples
1 parent 51b70cd commit 2b84333

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pymc3/backends/report.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ def raise_ok(self, level='error'):
9999
if errors:
100100
raise ValueError('Serious convergence issues during sampling.')
101101

102-
def _run_convergence_checks(self, idata:arviz.InferenceData, model):
102+
def _run_convergence_checks(self, idata: arviz.InferenceData, model):
103+
if not hasattr(idata, 'posterior'):
104+
msg = "No posterior samples. Unable to run convergence checks"
105+
warn = SamplerWarning(WarningType.BAD_PARAMS, msg, 'info',
106+
None, None, None)
107+
self._add_warnings([warn])
108+
return
109+
103110
if idata.posterior.sizes['chain'] == 1:
104111
msg = ("Only one chain was sampled, this makes it impossible to "
105112
"run some convergence checks")

0 commit comments

Comments
 (0)