Skip to content
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

Typing for model config properties #2576

Open
1 task done
alexander-held opened this issue Mar 11, 2025 · 0 comments
Open
1 task done

Typing for model config properties #2576

alexander-held opened this issue Mar 11, 2025 · 0 comments
Labels
feat/enhancement New feature or request needs-triage Needs a maintainer to categorize and assign type checking Related to types and type checking

Comments

@alexander-held
Copy link
Member

alexander-held commented Mar 11, 2025

Summary

For upstream use in cabinetry, typing of some model config pieces would be convenient. I added something back in #1706 but only just realized that this does not carry through as intended:

import pyhf

model = pyhf.simplemodels.uncorrelated_background(
    signal=[12.0, 11.0], bkg=[50.0, 52.0], bkg_uncertainty=[3.0, 7.0]
)

reveal_type(model.config.suggested_fixed())

results in a Revealed type is "Any" by mypy. I imagine it gets lost somewhere through how the _ModelConfig structure is a property of Model?

Code of Conduct

  • I agree to follow the Code of Conduct
@alexander-held alexander-held added feat/enhancement New feature or request needs-triage Needs a maintainer to categorize and assign type checking Related to types and type checking labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat/enhancement New feature or request needs-triage Needs a maintainer to categorize and assign type checking Related to types and type checking
Projects
None yet
Development

No branches or pull requests

1 participant