Skip to content

Commit e97c284

Browse files
last minute fixes
1 parent 442249f commit e97c284

File tree

2 files changed

+13
-46
lines changed

2 files changed

+13
-46
lines changed

docs/manual/source/recipes/combinationsmatrix.ipynb

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"from smodels.base.physicsUnits import fb\n",
3939
"from smodels.share.models.mssm import BSMList\n",
4040
"from smodels.share.models.SMparticles import SMList\n",
41+
"from smodels.statistics.basicStats import observed,apriori\n",
4142
"from smodels.base.model import Model"
4243
]
4344
},
@@ -160,42 +161,19 @@
160161
},
161162
{
162163
"cell_type": "code",
163-
"execution_count": 9,
164+
"execution_count": null,
164165
"metadata": {},
165-
"outputs": [
166-
{
167-
"data": {
168-
"text/plain": [
169-
"[('ATLAS-SUSY-2018-41', 'r_exp=', 0.869),\n",
170-
" ('CMS-SUS-21-002', 'r_exp=', 1.158),\n",
171-
" ('ATLAS-SUSY-2019-08', 'r_exp=', 0.96)]"
172-
]
173-
},
174-
"execution_count": 9,
175-
"metadata": {},
176-
"output_type": "execute_result"
177-
}
178-
],
166+
"outputs": [],
179167
"source": [
180168
"# let's have a quick look at the predictions, and the (expected) r-values\n",
181-
"[ (x.dataset.globalInfo.id, \"r_exp=\", round(x.getRValue(expected=True),3)) for x in predictions ]"
169+
"[ (x.dataset.globalInfo.id, \"r_exp=\", round(x.getRValue(evaluationType=apriori),3)) for x in predictions ]"
182170
]
183171
},
184172
{
185173
"cell_type": "code",
186-
"execution_count": 10,
174+
"execution_count": null,
187175
"metadata": {},
188-
"outputs": [
189-
{
190-
"name": "stdout",
191-
"output_type": "stream",
192-
"text": [
193-
"can I combine ATLAS-SUSY-2018-41 with CMS-SUS-21-002? yes\n",
194-
"can I combine ATLAS-SUSY-2018-41 with ATLAS-SUSY-2019-08? yes\n",
195-
"can I combine CMS-SUS-21-002 with ATLAS-SUSY-2019-08? yes\n"
196-
]
197-
}
198-
],
176+
"outputs": [],
199177
"source": [
200178
"for i,pr1 in enumerate(predictions[:-1]):\n",
201179
" id1 = pr1.dataset.globalInfo.id\n",
@@ -214,7 +192,7 @@
214192
},
215193
{
216194
"cell_type": "code",
217-
"execution_count": 11,
195+
"execution_count": null,
218196
"metadata": {},
219197
"outputs": [],
220198
"source": [
@@ -225,23 +203,12 @@
225203
},
226204
{
227205
"cell_type": "code",
228-
"execution_count": 12,
206+
"execution_count": null,
229207
"metadata": {},
230-
"outputs": [
231-
{
232-
"data": {
233-
"text/plain": [
234-
"1.674"
235-
]
236-
},
237-
"execution_count": 12,
238-
"metadata": {},
239-
"output_type": "execute_result"
240-
}
241-
],
208+
"outputs": [],
242209
"source": [
243210
"# the combined expected r value must be above the individual expected r-values\n",
244-
"round(combiner.getRValue(expected=True),3)"
211+
"round(combiner.getRValue(evaluationType=apriori),3)"
245212
]
246213
},
247214
{
@@ -268,9 +235,9 @@
268235
"name": "python",
269236
"nbconvert_exporter": "python",
270237
"pygments_lexer": "ipython3",
271-
"version": "3.12.3"
238+
"version": "3.13.3"
272239
}
273240
},
274241
"nbformat": 4,
275-
"nbformat_minor": 1
242+
"nbformat_minor": 4
276243
}

smodels/statistics/pyhfInterface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ def likelihood( self, mu : float = 1.0,
716716
logger.error(f"pyhf fixed_poi_fit failed for {list(self.data.jsonFiles)[workspace_index]} for mu={mu}: {e}")
717717
# lets try with different initialisation
718718
init, n_ = pyhf.infer.mle.fixed_poi_fit(
719-
0.0, workspace.data(model), model, return_fitted_val=True, maxiter=200
719+
0.0, data, model, return_fitted_val=True, maxiter=200
720720
)
721721
initpars = init.tolist()
722722
initpars[model.config.poi_index] = 1.

0 commit comments

Comments
 (0)