-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model parameter index for components of non-scalar parameters #1637
Comments
would you say
and if so .. should we also allow slices?
|
Sorry for the possible confusion about Regarding For the slicing: I would say why not. I do not have a concrete use case for this in mind, but it seems like it could become useful as well. The main use case I am thinking of is to get slices for single parameters to modify them separately, e.g. to set them to constant for a NLL scan. |
Partially implemented in #994 no? |
As far as I remember, yes #994 allows for this too. I opened this issue because I think it makes sense to have it in the model.config.par_slice("staterror_SR[0]") # KeyError: 'staterror_SR[0] not working could almost be viewed as a bug, since |
I think arguably, if you want to support that, we could have experimental query language support plugged in, so that the |
Summary
With the addition of
model.config.par_names
, there is a well-defined name for components of non-scalar parameters available withinpyhf
. It would be useful ifmodel.config.par_slice
would support parameter indexing to access components of non-scalar parameters. At the moment it will return the slice of all components, and return aKeyError
when using it with the name of a component.This can be worked around (example utility in
cabinetry
: model_utils._parameter_index), but it would be convenient to support this in thepyhf
API.related:
model.config.par_names
:Additional Information
Example usage for a model with multiple bins for a channel and
staterror
modifierCode of Conduct
The text was updated successfully, but these errors were encountered: