pyhs3.parameter_context.ParameterContext

class pyhs3.parameter_context.ParameterContext(parameter_set, domain=<factory>, parameters_of_interest=())[source]

Resolved parameter context: starting values, const set, bounds and POIs.

The context is fixed when a model is built: const parameters become graph constants, every other parameter a graph input.

Variables:
  • parameter_set – The referenced parameter point (an analysis init or an explicit override); gives the starting values and the const flags.

  • domain – The domain giving the parameter bounds (for an analysis, its domains merged into one).

  • parameters_of_interest – Names of the parameters of interest, in the order the analysis lists them; empty when there is no analysis or it lists none.

Examples

>>> from pyhs3.domains import ProductDomain
>>> from pyhs3.parameter_points import ParameterPoint, ParameterSet
>>> context = ParameterContext(
...     parameter_set=ParameterSet(
...         name="init",
...         parameters=[
...             ParameterPoint(name="mu", value=1.0),
...             ParameterPoint(name="lumi", value=1.0, const=True),
...         ],
...     ),
...     domain=ProductDomain(
...         name="dom", axes=[{"name": "mu", "min": 0.0, "max": 5.0}]
...     ),
...     parameters_of_interest=("mu",),
... )
>>> context.values
{'mu': 1.0, 'lumi': 1.0}
>>> sorted(context.const)
['lumi']
>>> context.bounds
{'mu': (0.0, 5.0)}
Parameters:
__init__(parameter_set, domain=<factory>, parameters_of_interest=())
Parameters:

Methods

__init__(parameter_set[, domain, ...])

Attributes

bounds

(lower, upper) of every coordinate axis of the domain; -inf/inf for an open side.

const

Names of the parameters that are const in the parameter point.

name

Name of the referenced parameter point.

parameters_of_interest

values

Starting value of every parameter in the parameter point, const ones included.

parameter_set

domain

ParameterContext.bounds

(lower, upper) of every coordinate axis of the domain; -inf/inf for an open side.

Constant axes have no bounds and are left out.

ParameterContext.const

Names of the parameters that are const in the parameter point.

ParameterContext.name

Name of the referenced parameter point.

ParameterContext.parameters_of_interest
ParameterContext.values

Starting value of every parameter in the parameter point, const ones included.

ParameterContext.parameter_set
ParameterContext.domain