Skip to content

Commit

Permalink
fix up notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg committed Sep 4, 2020
1 parent 7693b84 commit 4204b87
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion docs/examples/notebooks/ImpactPlot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,17 @@
" _, model, data = make_model([\"CRtt_meff\"])\n",
"\n",
" pyhf.set_backend(\"numpy\", pyhf.optimize.minuit_optimizer(verbose=True))\n",
" \n",
" constraints = constraints or []\n",
" init_pars = model.config.suggested_init()\n",
" fixed_params = model.config.suggested_fixed()\n",
" \n",
" for idx,fixed_val in constraints:\n",
" init_pars[idx] = fixed_val\n",
" fixed_params[idx] = True\n",
" \n",
" result = pyhf.infer.mle.fit(\n",
" data, model, fixed_vals=constraints, return_uncertainties=True\n",
" data, model, init_pars=init_pars, fixed_params=fixed_params, return_uncertainties=True\n",
" )\n",
" bestfit = result[:, 0]\n",
" errors = result[:, 1]\n",
Expand Down
11 changes: 10 additions & 1 deletion docs/examples/notebooks/pullplot.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,17 @@
" _, model, data = make_model([\"CRtt_meff\"])\n",
"\n",
" pyhf.set_backend(\"numpy\", pyhf.optimize.minuit_optimizer(verbose=True))\n",
" \n",
" constraints = constraints or []\n",
" init_pars = model.config.suggested_init()\n",
" fixed_params = model.config.suggested_fixed()\n",
" \n",
" for idx,fixed_val in constraints:\n",
" init_pars[idx] = fixed_val\n",
" fixed_params[idx] = True\n",
" \n",
" result = pyhf.infer.mle.fit(\n",
" data, model, fixed_vals=constraints, return_uncertainties=True\n",
" data, model, init_pars=init_pars, fixed_params=fixed_params, return_uncertainties=True\n",
" )\n",
" bestfit = result[:, 0]\n",
" errors = result[:, 1]\n",
Expand Down

0 comments on commit 4204b87

Please sign in to comment.