Skip to content

Add Xeus Python #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
run: |
cp README.md content
jupyter lite build --contents content --output-dir dist

- name: Upload dist
uses: actions/upload-pages-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion content/notebooks/Intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Pyolite",
"display_name": "Python (Pyodide)",
"language": "python",
"name": "python"
},
Expand Down
19 changes: 5 additions & 14 deletions content/notebooks/Lorenz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
"Before we start, we import some preliminary libraries."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install -q ipywidgets"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -35,7 +26,7 @@
"from matplotlib import pyplot as plt\n",
"from scipy import integrate\n",
"\n",
"from ipywidgets import interactive, fixed"
"from ipywidgets import interactive"
]
},
{
Expand Down Expand Up @@ -67,7 +58,7 @@
" ax.set_xlim((-25, 25))\n",
" ax.set_ylim((-35, 35))\n",
" ax.set_zlim((5, 55))\n",
" \n",
"\n",
" def lorenz_deriv(x_y_z, t0, sigma=sigma, beta=beta, rho=rho):\n",
" \"\"\"Compute the time-derivative of a Lorenz system.\"\"\"\n",
" x, y, z = x_y_z\n",
Expand All @@ -81,7 +72,7 @@
" t = np.linspace(0, max_time, int(250*max_time))\n",
" x_t = np.asarray([integrate.odeint(lorenz_deriv, x0i, t)\n",
" for x0i in x0])\n",
" \n",
"\n",
" # choose a different color for each trajectory\n",
" colors = plt.cm.viridis(np.linspace(0, 1, N))\n",
"\n",
Expand Down Expand Up @@ -236,9 +227,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Pyolite",
"display_name": "Python (XPython)",
"language": "python",
"name": "python"
"name": "xpython"
},
"language_info": {
"codemirror_mode": {
Expand Down
12 changes: 12 additions & 0 deletions environment-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: xeus-python-kernel
channels:
- https://repo.prefix.dev/emscripten-forge-dev
- https://repo.prefix.dev/conda-forge
dependencies:
- xeus-python
- numpy
- matplotlib
- pillow
- ipywidgets>=8.1.6
- ipyleaflet
- scipy
File renamed without changes.
8 changes: 8 additions & 0 deletions jupyter_lite_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"XeusAddon": {
"environment_file": [
"environment-python.yml",
"environment-r.yml"
]
}
}
Loading