Skip to content

Conversation

TC01
Copy link

@TC01 TC01 commented Jul 15, 2025

Description

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 (as described in the documentation), 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. With this change one can do something like this to quickly test a workspace on the command line:

cat workspace.json | | pyhf cls --test-stat q0 --test-poi 0

Since this is a one-line fix, I didn't open an issue first; hopefully that's okay!

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR

@matthewfeickert
Copy link
Member

matthewfeickert commented Jul 17, 2025

Thanks for the PR 👍. Please follow the contribution guide (https://github.com/scikit-hep/pyhf/blob/main/CONTRIBUTING.md) in the future.

I'm pretty sure this has been discussed in the past, but we can take a look at why this wasn't previously implemented next week and get back to you. If I'm wrong and this is missing then we can probably add this, given that you have a use case for it.

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`.
@alexander-held
Copy link
Member

We discussed this a bit in #1712. While the math is correct, I think it's not ideal to have this live under the cls CLI because this does not use $CL_s$ for discovery significance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants