Skip to content

Commit

Permalink
Do not compute convergence checks without samples
Browse files Browse the repository at this point in the history
  • Loading branch information
aseyboldt committed Jul 1, 2020
1 parent 51b70cd commit 2b84333
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pymc3/backends/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ def raise_ok(self, level='error'):
if errors:
raise ValueError('Serious convergence issues during sampling.')

def _run_convergence_checks(self, idata:arviz.InferenceData, model):
def _run_convergence_checks(self, idata: arviz.InferenceData, model):
if not hasattr(idata, 'posterior'):
msg = "No posterior samples. Unable to run convergence checks"
warn = SamplerWarning(WarningType.BAD_PARAMS, msg, 'info',
None, None, None)
self._add_warnings([warn])
return

if idata.posterior.sizes['chain'] == 1:
msg = ("Only one chain was sampled, this makes it impossible to "
"run some convergence checks")
Expand Down

0 comments on commit 2b84333

Please sign in to comment.