Skip to content

Commit

Permalink
site deploy
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : 6e47732
Branch  : md-outputs
Author  : GitHub Actions <[email protected]>
Time    : 2024-03-22 15:27:20 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : f2233ca
Branch  : main
Author  : Robert Chisholm <[email protected]>
Time    : 2024-03-22 15:25:12 +0000
Message : Add guidance on using profilers from within Jupyter notebooks. (#24)

Co-authored-by: Neil Shephard <[email protected]>
Closes #23
  • Loading branch information
actions-user committed Mar 22, 2024
1 parent c87e3d4 commit fde43a5
Show file tree
Hide file tree
Showing 48 changed files with 1,101 additions and 483 deletions.
6 changes: 3 additions & 3 deletions 404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions acknowledgements.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

290 changes: 198 additions & 92 deletions aio.html

Large diffs are not rendered by default.

Binary file added fig/line_profiler-worked-example-notebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/line_profiler-worked-example-rich.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fig/snakeviz-worked-example-notebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "e80c86cb-d60a-4e45-a34c-191aab11acf0",
"metadata": {},
"outputs": [],
"source": [
"!pip install line_profiler\n",
"%load_ext line_profiler"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "de5e278a-6826-4f42-b1af-496f5aabf996",
"metadata": {},
"outputs": [],
"source": [
"def fizzbuzz(n):\n",
" for i in range(1, n + 1):\n",
" if i % 3 == 0 and i % 5 == 0:\n",
" print(\"FizzBuzz\")\n",
" elif i % 3 == 0:\n",
" print(\"Fizz\")\n",
" elif i % 5 == 0:\n",
" print(\"Buzz\")\n",
" else:\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c54f2642-617e-4a51-b3e8-1ff1ba0e8426",
"metadata": {},
"outputs": [],
"source": [
"%lprun -f fizzbuzz fizzbuzz(100)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
89 changes: 89 additions & 0 deletions files/snakeviz-worked-example/snakeviz-worked-example.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "83b45371-9cd9-4a8f-b0ff-ceb1bfc2ecc2",
"metadata": {},
"outputs": [],
"source": [
"import time\n",
"\n",
"def a_1():\n",
" for i in range(3):\n",
" b_1()\n",
" time.sleep(1)\n",
" b_2()\n",
" \n",
"def b_1():\n",
" c_1()\n",
" c_2()\n",
"\n",
"def b_2():\n",
" time.sleep(1)\n",
" \n",
"def c_1():\n",
" time.sleep(0.5)\n",
"\n",
"def c_2():\n",
" time.sleep(0.3)\n",
" d_1()\n",
"\n",
"def d_1():\n",
" time.sleep(0.1)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0fc38195-3dc4-4a7c-82f6-1167f54d3182",
"metadata": {},
"outputs": [],
"source": [
"!pip install snakeviz"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c47affa0-23cc-43f8-a4f8-e73ab2f44afd",
"metadata": {},
"outputs": [],
"source": [
"%load_ext snakeviz"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "58040218-8578-47fc-9a18-476f4b27d25a",
"metadata": {},
"outputs": [],
"source": [
"%snakeviz a_1()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
25 changes: 17 additions & 8 deletions images.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions instructor-notes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions instructor/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions instructor/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions instructor/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions instructor/acknowledgements.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fde43a5

Please sign in to comment.