@@ -9,7 +9,9 @@ def __dir__():
9
9
return __all__
10
10
11
11
12
- def correlated_background (signal , bkg , bkg_up , bkg_down , batch_size = None ):
12
+ def correlated_background (
13
+ signal , bkg , bkg_up , bkg_down , batch_size = None , validate = True
14
+ ):
13
15
r"""
14
16
Construct a simple single channel :class:`~pyhf.pdf.Model` with a
15
17
:class:`~pyhf.modifiers.histosys` modifier representing a background
@@ -23,6 +25,8 @@ def correlated_background(signal, bkg, bkg_up, bkg_down, batch_size=None):
23
25
bkg_down (:obj:`list`): The background sample under a downward variation
24
26
corresponding to :math:`\alpha=-1`.
25
27
batch_size (:obj:`None` or :obj:`int`): Number of simultaneous (batched) Models to compute.
28
+ validate (:obj:`bool`): If :obj:`True`, validate the model before returning.
29
+ Only set this to :obj:`False` if you have an experimental use case and know what you're doing.
26
30
27
31
Returns:
28
32
~pyhf.pdf.Model: The statistical model adhering to the :obj:`model.json` schema.
@@ -75,10 +79,12 @@ def correlated_background(signal, bkg, bkg_up, bkg_down, batch_size=None):
75
79
}
76
80
]
77
81
}
78
- return Model (spec , batch_size = batch_size )
82
+ return Model (spec , batch_size = batch_size , validate = validate )
79
83
80
84
81
- def uncorrelated_background (signal , bkg , bkg_uncertainty , batch_size = None ):
85
+ def uncorrelated_background (
86
+ signal , bkg , bkg_uncertainty , batch_size = None , validate = True
87
+ ):
82
88
"""
83
89
Construct a simple single channel :class:`~pyhf.pdf.Model` with a
84
90
:class:`~pyhf.modifiers.shapesys` modifier representing an uncorrelated
@@ -106,6 +112,8 @@ def uncorrelated_background(signal, bkg, bkg_uncertainty, batch_size=None):
106
112
bkg (:obj:`list`): The data in the background sample
107
113
bkg_uncertainty (:obj:`list`): The statistical uncertainty on the background sample counts
108
114
batch_size (:obj:`None` or :obj:`int`): Number of simultaneous (batched) Models to compute
115
+ validate (:obj:`bool`): If :obj:`True`, validate the model before returning.
116
+ Only set this to :obj:`False` if you have an experimental use case and know what you're doing.
109
117
110
118
Returns:
111
119
~pyhf.pdf.Model: The statistical model adhering to the :obj:`model.json` schema
@@ -138,7 +146,7 @@ def uncorrelated_background(signal, bkg, bkg_uncertainty, batch_size=None):
138
146
}
139
147
]
140
148
}
141
- return Model (spec , batch_size = batch_size )
149
+ return Model (spec , batch_size = batch_size , validate = validate )
142
150
143
151
144
152
# Deprecated APIs
0 commit comments