From 5386131396158deddd0a34c5f8057cbb2288f8bc Mon Sep 17 00:00:00 2001 From: Ben Rosser Date: Tue, 15 Jul 2025 09:58:19 +0100 Subject: [PATCH] Add q0 test statistic as valid option to CLI infer interface The CLI API (e.g. `pyhf cls`) allows the test statistic to be set, but it limits the options to `q` and `qtilde`. However, the discovery test statistic `q0` is also a valid option here, but it can't currently be set on the command line. This commit is a simple fix; it adds `q0` to the list of allowed arguments to `pyhf cls --test-stat`. --- docs/contributors.rst | 1 + src/pyhf/cli/infer.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/contributors.rst b/docs/contributors.rst index 9554373417..8c3bb6fa06 100644 --- a/docs/contributors.rst +++ b/docs/contributors.rst @@ -36,3 +36,4 @@ Contributors include: - Lorenz Gaertner - Melissa Weber Mendonça - Matthias Bussonnier +- Ben Rosser diff --git a/src/pyhf/cli/infer.py b/src/pyhf/cli/infer.py index f2b0dce107..627c29aa14 100644 --- a/src/pyhf/cli/infer.py +++ b/src/pyhf/cli/infer.py @@ -144,7 +144,7 @@ def fit( @click.option('--measurement', default=None) @click.option('-p', '--patch', multiple=True) @click.option('--test-poi', default=1.0) -@click.option('--test-stat', type=click.Choice(['q', 'qtilde']), default='qtilde') +@click.option('--test-stat', type=click.Choice(['q', 'qtilde', 'q0']), default='qtilde') @click.option( '--calctype', type=click.Choice(['asymptotics', 'toybased']), default='asymptotics' )