Skip to content

Commit

Permalink
fix: upgrade guite tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-eschle committed Apr 15, 2024
1 parent 24ed012 commit 3ced0f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 6 additions & 7 deletions _website/tutorials/introduction/upgrade_guide_020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"With version 0.20, zfit prepares for a more stable and user-friendly interface. This guide will help you to upgrade your code to the new version and demonstrate the most significant changes. It is meant for people who are already familiar with zfit and want to upgrade their code.\n",
"\n",
"**Not all changes are everywhere reflected in the docs, [help is highly appreciated!](https://github.com/zfit/zfit/issues/556)**"
"**Not all changes are everywhere reflected in the docs, [help with the docs is welcome](https://github.com/zfit/zfit/issues/556)** as well as [adding a more polished PDF](https://github.com/zfit/zfit/issues/512). (See [all issues with contributions wanted](https://github.com/zfit/zfit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) or [reach out](https://github.com/zfit/zfit#contact) to us on Mattermost, Gitter, GitHub, or e-mail)."
]
},
{
Expand All @@ -20,8 +20,6 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"import numpy as np\n",
"# standard imports\n",
"import zfit\n",
Expand All @@ -36,12 +34,13 @@
"metadata": {},
"outputs": [],
"source": [
"# example usage of the new numpy-like\n",
"\n",
"\n",
"# example usage of the numpy-like backend, use it if possible\n",
"@z.function\n",
"def maximum(x, y):\n",
" return znp.maximum(x, y)"
" return znp.maximum(x, y)\n",
"\n",
"print(f\"sqrt with np:{np.sqrt(maximum(1., 2.))}, with z:{znp.sqrt(maximum(1., 2.))}\")\n",
"print(f\"vectorized: {np.sqrt(maximum(znp.array([1., 2.]), znp.array([3., 4.])))}\")"
]
},
{
Expand Down
13 changes: 6 additions & 7 deletions introduction/upgrade_guide_020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"With version 0.20, zfit prepares for a more stable and user-friendly interface. This guide will help you to upgrade your code to the new version and demonstrate the most significant changes. It is meant for people who are already familiar with zfit and want to upgrade their code.\n",
"\n",
"**Not all changes are everywhere reflected in the docs, [help is highly appreciated!](https://github.com/zfit/zfit/issues/556)**"
"**Not all changes are everywhere reflected in the docs, [help with the docs is welcome](https://github.com/zfit/zfit/issues/556)** as well as [adding a more polished PDF](https://github.com/zfit/zfit/issues/512). (See [all issues with contributions wanted](https://github.com/zfit/zfit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) or [reach out](https://github.com/zfit/zfit#contact) to us on Mattermost, Gitter, GitHub, or e-mail)."
]
},
{
Expand All @@ -20,8 +20,6 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import annotations\n",
"\n",
"import numpy as np\n",
"# standard imports\n",
"import zfit\n",
Expand All @@ -36,12 +34,13 @@
"metadata": {},
"outputs": [],
"source": [
"# example usage of the new numpy-like\n",
"\n",
"\n",
"# example usage of the numpy-like backend, use it if possible\n",
"@z.function\n",
"def maximum(x, y):\n",
" return znp.maximum(x, y)"
" return znp.maximum(x, y)\n",
"\n",
"print(f\"sqrt with np:{np.sqrt(maximum(1., 2.))}, with z:{znp.sqrt(maximum(1., 2.))}\")\n",
"print(f\"vectorized: {np.sqrt(maximum(znp.array([1., 2.]), znp.array([3., 4.])))}\")"
]
},
{
Expand Down

0 comments on commit 3ced0f3

Please sign in to comment.