Skip to content

Commit

Permalink
change warning message to include API information, where kwarg can be…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
lorenzennio committed Dec 8, 2023
1 parent 25ecdfb commit efe4ba2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pyhf/infer/test_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def qmu(mu, data, pdf, init_pars, par_bounds, fixed_params, return_fitted_pars=F
if par_bounds[pdf.config.poi_index][0] == 0:
log.warning(
'qmu test statistic used for fit configuration with POI bounded at zero.\n'
+ 'Use the qmu_tilde test statistic (pyhf.infer.test_statistics.qmu_tilde) instead. Set test_stat="qtilde".'
+ 'Use the qmu_tilde test statistic (pyhf.infer.test_statistics.qmu_tilde) instead.\n'
+ 'If you called this from pyhf.infer.mle or pyhf.infer.hypotest, set test_stat="qtilde".'
)
return _qmu_like(
mu,
Expand Down Expand Up @@ -229,7 +230,8 @@ def qmu_tilde(
if par_bounds[pdf.config.poi_index][0] != 0:
log.warning(
'qmu_tilde test statistic used for fit configuration with POI not bounded at zero.\n'
+ 'Use the qmu test statistic (pyhf.infer.test_statistics.qmu) instead. Set test_stat="q".'
+ 'Use the qmu test statistic (pyhf.infer.test_statistics.qmu) instead.\n'
+ 'If you called this from pyhf.infer.mle or pyhf.infer.hypotest, set test_stat="q".'
)
return _qmu_like(
mu,
Expand Down

0 comments on commit efe4ba2

Please sign in to comment.