From efe4ba2aef887fa5465df6138b51ba1249b39485 Mon Sep 17 00:00:00 2001 From: Lorenz Gaertner Date: Fri, 8 Dec 2023 11:28:43 +0100 Subject: [PATCH] change warning message to include API information, where kwarg can be set --- src/pyhf/infer/test_statistics.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pyhf/infer/test_statistics.py b/src/pyhf/infer/test_statistics.py index 2dc41c086d..cf11e09c86 100644 --- a/src/pyhf/infer/test_statistics.py +++ b/src/pyhf/infer/test_statistics.py @@ -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, @@ -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,