Skip to content

Commit 198ba2b

Browse files
committed
fix: typos for 0.20 zfit
1 parent 26f717c commit 198ba2b

6 files changed

+34
-20
lines changed

_website/tutorials/components/20 - Composite Models.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@
143143
"source": [
144144
"## creating an extended PDF\n",
145145
"\n",
146-
"An extended PDF can either be created with the `create_extended(yield_param)` method or with the simple Python\n",
147-
"syntax of multiplying a PDF with the parameter."
146+
"An extended PDF can be created using the `extended` argument in the initialization.\n",
147+
" \n",
148+
"Alternatively, an extended PDF from a non-extended PDF can be created with the `create_extended(yield_param)` method."
148149
]
149150
},
150151
{
@@ -153,7 +154,8 @@
153154
"metadata": {},
154155
"outputs": [],
155156
"source": [
156-
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)"
157+
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)\n",
158+
"gauss3 = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
157159
]
158160
},
159161
{
@@ -170,9 +172,7 @@
170172
"execution_count": null,
171173
"metadata": {},
172174
"outputs": [],
173-
"source": [
174-
"gauss3_ext = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
175-
]
175+
"source": []
176176
}
177177
],
178178
"metadata": {

_website/tutorials/components/33 - Binned fits.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@
571571
"source": [
572572
"modifier_constraints = zfit.constraint.GaussianConstraint(params=list(modifiers.values()), observation=np.ones(len(modifiers)),\n",
573573
" uncertainty=0.1 * np.ones(len(modifiers)))\n",
574-
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, 1)"
574+
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, sigma=1)"
575575
]
576576
},
577577
{

_website/tutorials/components/50 - Custom code and run mode.ipynb

+10-3
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
"outputs": [],
411411
"source": [
412412
"%%timeit -n1 -r1\n",
413-
"zfit.run.set_mode(graph=True) # running in graph mode\n",
413+
"zfit.run.set_graph_mode(True) # running in graph mode\n",
414414
"for i in range(100):\n",
415415
" for _ in range(n_evals):\n",
416416
" graph_func2(i)"
@@ -424,7 +424,7 @@
424424
"source": [
425425
"%%timeit -n1 -r1\n",
426426
"zfit.run.clear_graph_cache()\n",
427-
"zfit.run.set_mode(graph=True) # running in graph mode but clearing unused caches\n",
427+
"zfit.run.set_graph_mode(graph=True) # running in graph mode but clearing unused caches\n",
428428
"for i in range(100):\n",
429429
" zfit.run.clear_graph_cache()\n",
430430
" for _ in range(n_evals):\n",
@@ -486,7 +486,7 @@
486486
"metadata": {},
487487
"outputs": [],
488488
"source": [
489-
"zfit.run.set_mode(graph=False) # test first in eager mode"
489+
"zfit.run.set_graph_mode(False) # test first in eager mode"
490490
]
491491
},
492492
{
@@ -548,6 +548,13 @@
548548
"source": [
549549
"That's a significant speedup! It is clear that for a few evaluations, it does not matter _too much_. But this is about the scalability: imagine we have a large fit, where a minimizer needs hundreds or thousands of evaluations: that's when the initial Graph building becomes neglectible and the speedup matters."
550550
]
551+
},
552+
{
553+
"cell_type": "code",
554+
"execution_count": null,
555+
"metadata": {},
556+
"outputs": [],
557+
"source": []
551558
}
552559
],
553560
"metadata": {

components/20 - Composite Models.ipynb

+6-6
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@
143143
"source": [
144144
"## creating an extended PDF\n",
145145
"\n",
146-
"An extended PDF can either be created with the `create_extended(yield_param)` method or with the simple Python\n",
147-
"syntax of multiplying a PDF with the parameter."
146+
"An extended PDF can be created using the `extended` argument in the initialization.\n",
147+
" \n",
148+
"Alternatively, an extended PDF from a non-extended PDF can be created with the `create_extended(yield_param)` method."
148149
]
149150
},
150151
{
@@ -153,7 +154,8 @@
153154
"metadata": {},
154155
"outputs": [],
155156
"source": [
156-
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)"
157+
"yield1 = zfit.Parameter(\"yield_gauss1\", 100, 0, 1000)\n",
158+
"gauss3 = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
157159
]
158160
},
159161
{
@@ -170,9 +172,7 @@
170172
"execution_count": null,
171173
"metadata": {},
172174
"outputs": [],
173-
"source": [
174-
"gauss3_ext = zfit.pdf.Gauss(obs=obs2, mu=mu3, sigma=sigma3, extended=yield1)"
175-
]
175+
"source": []
176176
}
177177
],
178178
"metadata": {

components/33 - Binned fits.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@
571571
"source": [
572572
"modifier_constraints = zfit.constraint.GaussianConstraint(params=list(modifiers.values()), observation=np.ones(len(modifiers)),\n",
573573
" uncertainty=0.1 * np.ones(len(modifiers)))\n",
574-
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, 1)"
574+
"alpha_constraint = zfit.constraint.GaussianConstraint(alpha, 0, sigma=1)"
575575
]
576576
},
577577
{

components/50 - Custom code and run mode.ipynb

+10-3
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
"outputs": [],
411411
"source": [
412412
"%%timeit -n1 -r1\n",
413-
"zfit.run.set_mode(graph=True) # running in graph mode\n",
413+
"zfit.run.set_graph_mode(True) # running in graph mode\n",
414414
"for i in range(100):\n",
415415
" for _ in range(n_evals):\n",
416416
" graph_func2(i)"
@@ -424,7 +424,7 @@
424424
"source": [
425425
"%%timeit -n1 -r1\n",
426426
"zfit.run.clear_graph_cache()\n",
427-
"zfit.run.set_mode(graph=True) # running in graph mode but clearing unused caches\n",
427+
"zfit.run.set_graph_mode(graph=True) # running in graph mode but clearing unused caches\n",
428428
"for i in range(100):\n",
429429
" zfit.run.clear_graph_cache()\n",
430430
" for _ in range(n_evals):\n",
@@ -486,7 +486,7 @@
486486
"metadata": {},
487487
"outputs": [],
488488
"source": [
489-
"zfit.run.set_mode(graph=False) # test first in eager mode"
489+
"zfit.run.set_graph_mode(False) # test first in eager mode"
490490
]
491491
},
492492
{
@@ -548,6 +548,13 @@
548548
"source": [
549549
"That's a significant speedup! It is clear that for a few evaluations, it does not matter _too much_. But this is about the scalability: imagine we have a large fit, where a minimizer needs hundreds or thousands of evaluations: that's when the initial Graph building becomes neglectible and the speedup matters."
550550
]
551+
},
552+
{
553+
"cell_type": "code",
554+
"execution_count": null,
555+
"metadata": {},
556+
"outputs": [],
557+
"source": []
551558
}
552559
],
553560
"metadata": {

0 commit comments

Comments
 (0)