diff --git a/JupyterHub_Help.ipynb b/JupyterHub_Help.ipynb index d2e62be..1e06db1 100644 --- a/JupyterHub_Help.ipynb +++ b/JupyterHub_Help.ipynb @@ -391,6 +391,40 @@ "source": [ "Or, as a last ressort, remove the entire user site-packages directory by running `!rm -rf /home/jovyan/.local/lib/python3.*/site-packages/*` as a code cell (⚠️ be careful, there is no undo — deleted files are gone permanently)." ] + }, + { + "cell_type": "markdown", + "id": "29", + "metadata": {}, + "source": [ + "### Workshop #3\n", + "\n", + "The following is a little script that will download example data files used in the SOLER workshop #3 to your JupyterHub. It will be used in case some of the data servers have connection problems." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "30", + "metadata": {}, + "outputs": [], + "source": [ + "import urllib.request\n", + "import zipfile\n", + "import io\n", + "import shutil\n", + "\n", + "url = \"https://github.com/jgieseler/workshop3_data/archive/refs/heads/main.zip\"\n", + "data_folder = \"/home/jovyan/data\"\n", + "\n", + "with urllib.request.urlopen(url) as response:\n", + " with zipfile.ZipFile(io.BytesIO(response.read())) as z:\n", + " z.extractall(data_folder)\n", + "\n", + "# GitHub adds a \"workshop3_data-main/\" subfolder, move contents up\n", + "shutil.copytree(f\"{data_folder}/workshop3_data-main/\", data_folder, dirs_exist_ok=True)\n", + "shutil.rmtree(f\"{data_folder}/workshop3_data-main/\")" + ] } ], "metadata": {