Skip to content

Commit 5364191

Browse files
committed
Try deploying jupyterlite
1 parent 67842d7 commit 5364191

5 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ jobs:
9797
env:
9898
CREATOR_ID: ${{ secrets.CREATOR_ID }}
9999

100+
# Build a self-hosted JupyterLite environment into _build/jupyterlite so the
101+
# interactive "run this code" links in the book point at our own deployment
102+
# rather than a third-party demo site. Done last so its pip installs can't
103+
# disturb the Sphinx builds above.
104+
- name: Build JupyterLite
105+
run: |
106+
pip install -r requirements-jupyterlite.txt
107+
jupyter lite build --contents jupyterlite --output-dir _build/jupyterlite
108+
100109
- name: Upload artifact
101110
uses: actions/upload-pages-artifact@v3.0.1
102111
with:

content/intro.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ PySDR purposefully does not include a custom Python library or any wrapper funct
4949

5050
Note that while Python is "slower" than C/C++ in general, most functions within Python/NumPy are actually implemented in C/C++ under the hood and heavily optimized, so you might be surprised how fast CPU-based DSP can run in Python. Likewise, the SDR APIs we use (e.g., UHD) are simply a set of Python bindings for C/C++ functions/classes. For fielded RF systems, high-rate signal processing is typically implemented in the FPGA anyway!
5151

52+
Some PySDR chapters contain example code that can be opened as a web-based Jupyter notebook (using JupyterLite), allowing you to play with and run the Python examples entirely from your browser without installing anything. To check if it works on your browser, try opening `this example <../jupyterlite/notebooks/index.html?path=example.ipynb>`_.
53+
5254
************
5355
Contributing
5456
************

jupyterlite/example.ipynb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "example-cell",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import numpy as np\n",
11+
"print(np.arange(10))"
12+
]
13+
}
14+
],
15+
"metadata": {
16+
"kernelspec": {
17+
"display_name": "Python (Pyodide)",
18+
"language": "python",
19+
"name": "python"
20+
},
21+
"language_info": {
22+
"name": "python"
23+
}
24+
},
25+
"nbformat": 4,
26+
"nbformat_minor": 5
27+
}

requirements-jupyterlite.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Used only to build the self-hosted JupyterLite environment deployed at /jupyterlite/
2+
# Kept separate from requirements.txt so it can't disturb the (older) Sphinx pins.
3+
jupyterlite-core==0.8.1
4+
jupyterlite-pyodide-kernel==0.8.1
5+
jupyter-server==2.20.0 # required for `jupyter lite build --contents` to bundle the notebook(s) in jupyterlite/

spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ sc
1212
np
1313
NumPy
1414
numpy
15+
JupyterLite
1516
Arg
1617
frontend
1718
dBm

0 commit comments

Comments
 (0)