From 47f0af9b14c78eb987143ef4ada97d26d009c57b Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Thu, 14 Sep 2023 20:25:13 +0000 Subject: [PATCH 1/5] Use Xeus Python --- .github/workflows/deploy.yml | 1 + content/notebooks/Intro.ipynb | 2 +- content/notebooks/Lorenz.ipynb | 11 +---------- jupyter-lite.json | 1 + 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d3216d8..757cf5a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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: diff --git a/content/notebooks/Intro.ipynb b/content/notebooks/Intro.ipynb index a1279de..0b84b7d 100755 --- a/content/notebooks/Intro.ipynb +++ b/content/notebooks/Intro.ipynb @@ -97,7 +97,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Pyolite", + "display_name": "Python (XPython)", "language": "python", "name": "python" }, diff --git a/content/notebooks/Lorenz.ipynb b/content/notebooks/Lorenz.ipynb index c9d21dc..790bc20 100644 --- a/content/notebooks/Lorenz.ipynb +++ b/content/notebooks/Lorenz.ipynb @@ -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, @@ -236,7 +227,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Pyolite", + "display_name": "Python (XPython)", "language": "python", "name": "python" }, diff --git a/jupyter-lite.json b/jupyter-lite.json index 8eaeedc..7f900eb 100644 --- a/jupyter-lite.json +++ b/jupyter-lite.json @@ -2,6 +2,7 @@ "jupyter-lite-schema-version": 0, "jupyter-config-data": { "appName": "Try Jupyter!", + "defaultKernelName": "python", "disabledExtensions": [ "@jupyterlab/server-proxy", "jupyterlab-server-proxy", From dd8bfecbffae644df4dfcae1c5b0774f9a1eb7d6 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 3 Jun 2025 22:13:05 +0200 Subject: [PATCH 2/5] update config files --- content/notebooks/Lorenz.ipynb | 6 +++--- environment-python.yml | 12 ++++++++++++ environment.yml => environment-r.yml | 0 jupyter_lite_build.json | 8 ++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 environment-python.yml rename environment.yml => environment-r.yml (100%) create mode 100644 jupyter_lite_build.json diff --git a/content/notebooks/Lorenz.ipynb b/content/notebooks/Lorenz.ipynb index 790bc20..80658eb 100644 --- a/content/notebooks/Lorenz.ipynb +++ b/content/notebooks/Lorenz.ipynb @@ -26,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" ] }, { @@ -58,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", @@ -72,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", diff --git a/environment-python.yml b/environment-python.yml new file mode 100644 index 0000000..9d60e76 --- /dev/null +++ b/environment-python.yml @@ -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 diff --git a/environment.yml b/environment-r.yml similarity index 100% rename from environment.yml rename to environment-r.yml diff --git a/jupyter_lite_build.json b/jupyter_lite_build.json new file mode 100644 index 0000000..05367f8 --- /dev/null +++ b/jupyter_lite_build.json @@ -0,0 +1,8 @@ +{ + "XeusAddon": { + "environment_file": [ + "environment-python.yml", + "environment-r.yml" + ] + } +} From 97e503e6fd0eb0654b6fe03f58f7c7a11ab3b2f4 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 3 Jun 2025 22:14:56 +0200 Subject: [PATCH 3/5] update defaults --- content/notebooks/Intro.ipynb | 2 +- jupyter-lite.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/content/notebooks/Intro.ipynb b/content/notebooks/Intro.ipynb index 0b84b7d..87361ba 100755 --- a/content/notebooks/Intro.ipynb +++ b/content/notebooks/Intro.ipynb @@ -97,7 +97,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python (XPython)", + "display_name": "Python (Pyodide)", "language": "python", "name": "python" }, diff --git a/jupyter-lite.json b/jupyter-lite.json index 7f900eb..8eaeedc 100644 --- a/jupyter-lite.json +++ b/jupyter-lite.json @@ -2,7 +2,6 @@ "jupyter-lite-schema-version": 0, "jupyter-config-data": { "appName": "Try Jupyter!", - "defaultKernelName": "python", "disabledExtensions": [ "@jupyterlab/server-proxy", "jupyterlab-server-proxy", From 8ebac5376f8ed6cfe36f09751c819ea49289699c Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 3 Jun 2025 22:19:55 +0200 Subject: [PATCH 4/5] fix filename --- jupyter_lite_build.json => jupyter_lite_config.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jupyter_lite_build.json => jupyter_lite_config.json (100%) diff --git a/jupyter_lite_build.json b/jupyter_lite_config.json similarity index 100% rename from jupyter_lite_build.json rename to jupyter_lite_config.json From d094af33c9326914bad7a5702e604b4b0466331a Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 3 Jun 2025 22:38:15 +0200 Subject: [PATCH 5/5] update default kernel for lorenz --- content/notebooks/Lorenz.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/notebooks/Lorenz.ipynb b/content/notebooks/Lorenz.ipynb index 80658eb..878e0e6 100644 --- a/content/notebooks/Lorenz.ipynb +++ b/content/notebooks/Lorenz.ipynb @@ -229,7 +229,7 @@ "kernelspec": { "display_name": "Python (XPython)", "language": "python", - "name": "python" + "name": "xpython" }, "language_info": { "codemirror_mode": {