@@ -173,17 +173,22 @@ def warnings(self):
173
173
if n_divs and self ._samples_after_tune == n_divs :
174
174
message = ('The chain contains only diverging samples. The model '
175
175
'is probably misspecified.' )
176
+ warning = SamplerWarning (
177
+ WarningType .DIVERGENCES , message , 'error' , None , None , None )
178
+ warnings .append (warning )
176
179
elif n_divs == 1 :
177
180
message = ('There was 1 divergence after tuning. Increase '
178
181
'`target_accept` or reparameterize.' )
182
+ warning = SamplerWarning (
183
+ WarningType .DIVERGENCES , message , 'error' , None , None , None )
184
+ warnings .append (warning )
179
185
elif n_divs > 1 :
180
186
message = ('There were %s divergences after tuning. Increase '
181
187
'`target_accept` or reparameterize.'
182
188
% n_divs )
189
+ warning = SamplerWarning (
190
+ WarningType .DIVERGENCES , message , 'error' , None , None , None )
191
+ warnings .append (warning )
183
192
184
- warning = SamplerWarning (
185
- WarningType .DIVERGENCES , message , 'error' , None , None , None )
186
- warnings .append (warning )
187
193
warnings .extend (self .step_adapt .warnings ())
188
-
189
194
return warnings
0 commit comments