From cdd2ee658619d3a654d1ad33ebf5d7ad595ff60a Mon Sep 17 00:00:00 2001 From: carlos Date: Mon, 14 Oct 2024 10:54:51 +0200 Subject: [PATCH] adapted basic tutorial to Colab --- docs/source/Tutorial.ipynb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/source/Tutorial.ipynb b/docs/source/Tutorial.ipynb index ac0d2fee..06aa3a4f 100644 --- a/docs/source/Tutorial.ipynb +++ b/docs/source/Tutorial.ipynb @@ -1285,6 +1285,33 @@ "4. We print the size of the DataFrame." ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "926bc78a", + "metadata": {}, + "outputs": [], + "source": [ + "try:\n", + " import google.colab\n", + " IN_COLAB = True\n", + "except:\n", + " IN_COLAB = False\n", + "\n", + "# Check if in colab\n", + "if IN_COLAB:\n", + " print('in colab')\n", + " import urllib.request\n", + " # Replace with the raw URL of the YAML file on GitHub\n", + " github_url = \"https://raw.githubusercontent.com/DIDONEproject/musif/main/config_postprocess_example.yml\" \n", + " # Replace with the desired local file name\n", + " local_file_name = \"config_postprocess_example.yml\" \n", + " urllib.request.urlretrieve(github_url, local_file_name)\n", + " print(f\"File downloaded to: {local_file_name}\")\n", + "else:\n", + " local_file_name = \"../../config_postprocess_example.yml\" \n" + ] + }, { "cell_type": "code", "execution_count": 11,