generated from jupyterlite/xeus-python-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Pyodide and other features (#1). Update README
- Loading branch information
Showing
8 changed files
with
3,447 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,10 @@ | ||
# xeus-python + JupyterLite demo | ||
# psa-notebook: Jupyter notebook for power system analysis in the browser | ||
|
||
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://jupyterlite.github.io/xeus-python-demo/retro/notebooks/?path=demo.ipynb) | ||
[![lite-badge](https://jupyterlite.rtfd.io/en/latest/_static/badge.svg)](https://edxu96.github.io/psa-notebook) [![Build and Deploy](https://github.com/edxu96/psa-notebook/actions/workflows/deploy.yml/badge.svg)](https://github.com/edxu96/psa-notebook/actions/workflows/deploy.yml) | ||
|
||
xeus-python + JupyterLite deployed as a static site to GitHub Pages, for demo purposes. | ||
## Requirements | ||
|
||
## ✨ Try it in your browser ✨ | ||
JupyterLite is being tested against modern web browsers: | ||
|
||
https://jupyterlite.github.io/xeus-python-demo/retro/notebooks/?path=demo.ipynb | ||
|
||
## ≠ How does it compare to the Pyodide kernel? | ||
|
||
#### Pyodide kernel: | ||
|
||
- Is based on [Pyodide](https://github.com/pyodide/pyodide) | ||
- Uses [IPython](https://github.com/ipython/ipython) for the code execution (access to IPython magics, support for the inline Matplotlib backend, *etc*) | ||
- Provides a way to dynamically install packages with ``piplite`` (**e.g.** ``await piplite.install("ipywidgets")``) | ||
- **Does not support** sleeping with ``from time import sleep`` | ||
- **Does not support** pre-installing packages | ||
|
||
#### jupyterlite-xeus-python: | ||
|
||
- Is based on [xeus-python](https://github.com/jupyter-xeus/xeus-python) | ||
- Uses [IPython](https://github.com/ipython/ipython) for the code execution (access to IPython magics, support for the inline Matplotlib backend, *etc*) | ||
- **Does not provide** a way to dynamically install packages (yet. We are working on building a ``mamba`` package manager for WASM) | ||
- **Supports** sleeping with ``from time import sleep`` | ||
- **Supports** pre-installing packages from ``emscripten-forge`` and ``conda-forge``, by providing an ``environment.yml`` file defining the runtime environment | ||
|
||
## 💡 How to make your own deployment | ||
|
||
![Deploy your own](deploy.gif) | ||
|
||
Then your site will be published under https://{USERNAME}.github.io/{DEMO_REPO_NAME} | ||
|
||
## 📦 How to install extra packages | ||
|
||
You can pre-install extra packages for xeus-python by adding them to the ``environment.yml`` file. | ||
|
||
Only ``no-arch`` packages from ``conda-forge`` and packages from ``emscripten-forge`` can be installed. | ||
|
||
For example, if you want to create a JupyterLite deployment with NumPy and Matplotlib pre-installed, you would need to edit the ``environment.yml`` file as following: | ||
|
||
```yml | ||
name: xeus-python-kernel | ||
channels: | ||
- https://repo.mamba.pm/emscripten-forge | ||
- https://repo.mamba.pm/conda-forge | ||
dependencies: | ||
- numpy | ||
- matplotlib | ||
``` | ||
- Firefox 90+ | ||
- Chromium 89+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[virtualenvs] | ||
create = true | ||
in-project = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[tool.poetry] | ||
name = "psa-notebook" | ||
version = "0.1.0" | ||
description = "Jupyter notebook for power system analysis in the browser." | ||
authors = ["Edward Xu <edxu96@outlook.com>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "~3.8" | ||
jupyterlite-core = "~0.1.0" | ||
jupyterlab = "~3.6.3" | ||
jupyterlite-pyodide-kernel = "~0.0.6" | ||
jupyterlite-xeus-sqlite = "~0.2.1" | ||
jupyterlab-geojson = "~3.3.1" | ||
jupyterlite-xeus-python = "~0.8.0" | ||
ipyleaflet = "~0.17.2" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
Large diffs are not rendered by default.
Oops, something went wrong.