Skip to content

Commit

Permalink
fix: get examples working in jupyterlite
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumJHays committed Oct 10, 2022
1 parent 2711a13 commit ce7d164
Show file tree
Hide file tree
Showing 8 changed files with 1,944 additions and 1,191 deletions.
16 changes: 10 additions & 6 deletions examples/braking_deceleration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"try:\n",
" # install for jupyterlite if needed\n",
" import piplite\n",
" await piplite.install()\n",
" print('installing piplite packages... This may take up to ~5 minutes. If still running, please try refreshing the page.')\n",
" await piplite.install('mathpad')\n",
" print('piplite packages installed and ready to go!')\n",
" in_jupyterlite = True\n",
"\n",
"except (ImportError, SyntaxError):\n",
" pass # not running in jupyterlite"
" # not running in jupyterlite\n",
" in_jupyterlite = False\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -30,13 +34,13 @@
{
"data": {
"text/latex": [
"$\\displaystyle \\frac{1397}{1250} \\hspace{1.25em} \\text{s}$"
"$$ \\frac{1397}{1250} \\hspace{1.25em} \\text{s} $$"
],
"text/plain": [
"1.1176 seconds"
]
},
"execution_count": 1,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
Loading

0 comments on commit ce7d164

Please sign in to comment.