Skip to content

Typing for model config properties #2576

Open
@alexander-held

Description

@alexander-held

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat/enhancementNew feature or requestneeds-triageNeeds a maintainer to categorize and assigntype checkingRelated to types and type checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions