|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# Clone conversion repository into current directory\n", |
| 8 | + "\n", |
| 9 | + "To begin processing data effectively, run the cells below to clone the repository.\n", |
| 10 | + "\n", |
| 11 | + "\n", |
| 12 | + "\n", |
| 13 | + "---" |
| 14 | + ] |
| 15 | + }, |
| 16 | + { |
| 17 | + "cell_type": "markdown", |
| 18 | + "metadata": {}, |
| 19 | + "source": [ |
| 20 | + "<h3><a href=\"https://hub.disasters.2i2c.cloud/hub/user-redirect/git-pull?repo=https://github.com/Disasters-Learning-Portal/disasters-docs&urlpath=lab/tree/disasters-docs/Jupyterhub/clone_conversion_repo.ipynb&branch=main\">🚀 Launch in Disasters-Hub JupyterHub (requires access)</a></h3>\n", |
| 21 | + "\n", |
| 22 | + "<h4> To obtain credentials to VEDA Hub, <a href = \"https://docs.openveda.cloud/user-guide/scientific-computing/getting-access.html\"> follow this link for more information.</a></h4>" |
| 23 | + ] |
| 24 | + }, |
| 25 | + { |
| 26 | + "cell_type": "markdown", |
| 27 | + "metadata": {}, |
| 28 | + "source": [ |
| 29 | + "<div class=\"alert alert-block\" style=\"\n", |
| 30 | + " background-color: #f8d7da;\n", |
| 31 | + " color: #721c24;\n", |
| 32 | + " border-left: 4px solid #28a745;\n", |
| 33 | + " \">\n", |
| 34 | + "Disclaimer: it is highly recommended to run a tutorial within NASA VEDA JupyterHub, which already includes functions for processing and visualizing data specific to VEDA stories. Running the tutorial outside of the VEDA JupyterHub may lead to errors, specifically related to EarthData authentication. Additionally, it is recommended to use the Pangeo workspace within the VEDA JupyterHub, since certain packages relevant to this tutorial are already installed. </div>\n", |
| 35 | + "\n", |
| 36 | + "<h4> If you <strong>do not</strong> have a VEDA Jupyterhub Account you can launch this notebook on your local environment using MyBinder by clicking the icon below.</h4>\n", |
| 37 | + "<br/>\n", |
| 38 | + "<a href=\"https://binder.openveda.cloud/v2/gh/NASA-IMPACT/veda-docs/9c8cdbae92906fb7062b8a0c759dad90e223a4f9?urlpath=lab%2Ftree%2Fuser-guide%2Fnotebooks%2Fstories%2Fderechos.ipynb\">\n", |
| 39 | + "<img src=\"https://binder.openveda.cloud/badge_logo.svg\" alt=\"Binder\" title=\"A cute binder\" width=\"150\"/> </a>" |
| 40 | + ] |
| 41 | + }, |
| 42 | + { |
| 43 | + "cell_type": "markdown", |
| 44 | + "metadata": {}, |
| 45 | + "source": [ |
| 46 | + "## Clone Required Repository" |
| 47 | + ] |
| 48 | + }, |
| 49 | + { |
| 50 | + "cell_type": "code", |
| 51 | + "execution_count": null, |
| 52 | + "metadata": {}, |
| 53 | + "outputs": [], |
| 54 | + "source": [ |
| 55 | + "import os\n", |
| 56 | + "import subprocess\n", |
| 57 | + "\n", |
| 58 | + "# Check if disasters-aws-conversion exists, if not clone it\n", |
| 59 | + "repo_name = \"disasters-aws-conversion\"\n", |
| 60 | + "repo_url = \"https://github.com/Disasters-Learning-Portal/disasters-aws-conversion.git\"\n", |
| 61 | + "\n", |
| 62 | + "if not os.path.exists(repo_name):\n", |
| 63 | + " print(f\"Cloning {repo_name} repository...\")\n", |
| 64 | + " try:\n", |
| 65 | + " result = subprocess.run(\n", |
| 66 | + " [\"git\", \"clone\", repo_url, f\"{repo_name}\"],\n", |
| 67 | + " capture_output=True,\n", |
| 68 | + " text=True,\n", |
| 69 | + " check=True\n", |
| 70 | + " )\n", |
| 71 | + " print(f\"Successfully cloned {repo_name}\")\n", |
| 72 | + " except subprocess.CalledProcessError as e:\n", |
| 73 | + " print(f\"Error cloning repository: {e.stderr}\")\n", |
| 74 | + "else:\n", |
| 75 | + " print(f\"{repo_name} repository already exists\")" |
| 76 | + ] |
| 77 | + } |
| 78 | + ], |
| 79 | + "metadata": { |
| 80 | + "kernelspec": { |
| 81 | + "display_name": "Python 3 (ipykernel)", |
| 82 | + "language": "python", |
| 83 | + "name": "python3" |
| 84 | + }, |
| 85 | + "language_info": { |
| 86 | + "codemirror_mode": { |
| 87 | + "name": "ipython", |
| 88 | + "version": 3 |
| 89 | + }, |
| 90 | + "file_extension": ".py", |
| 91 | + "mimetype": "text/x-python", |
| 92 | + "name": "python", |
| 93 | + "nbconvert_exporter": "python", |
| 94 | + "pygments_lexer": "ipython3", |
| 95 | + "version": "3.12.11" |
| 96 | + } |
| 97 | + }, |
| 98 | + "nbformat": 4, |
| 99 | + "nbformat_minor": 4 |
| 100 | +} |
0 commit comments