From 3182986be35d84eae186db2033cd468fb4a678a8 Mon Sep 17 00:00:00 2001 From: Jamie Vleeshouwer Date: Wed, 5 Jun 2024 21:11:51 +1000 Subject: [PATCH] Simplify the way the imports are done on the python notebooks --- ...rm_Average_ET_(Temporal_Aggregation).ipynb | 37 ++++++++++++++++--- ...et_of_Features_(Spatial_Aggregation).ipynb | 18 ++++----- ...ample_3_Unpacking_the_CMRSET_QA_Band.ipynb | 20 +++++----- ...porting_the_Image_Stack_for_a_Region.ipynb | 24 ++++++------ 4 files changed, 59 insertions(+), 40 deletions(-) diff --git a/gee-examples/python/Example_1_CMRSET_Long_Term_Average_ET_(Temporal_Aggregation).ipynb b/gee-examples/python/Example_1_CMRSET_Long_Term_Average_ET_(Temporal_Aggregation).ipynb index f5ca3cd..3c09f32 100644 --- a/gee-examples/python/Example_1_CMRSET_Long_Term_Average_ET_(Temporal_Aggregation).ipynb +++ b/gee-examples/python/Example_1_CMRSET_Long_Term_Average_ET_(Temporal_Aggregation).ipynb @@ -30,6 +30,31 @@ "**Storage Required:** 55 MB (on Google Drive)" ] }, + { + "cell_type": "markdown", + "source": [ + "## Install earthengine-api\n" + ], + "metadata": { + "id": "r6lyGk5SFRwM" + } + }, + { + "cell_type": "code", + "source": [ + "# Installs the geemap package\n", + "try:\n", + " import ee\n", + "except ImportError:\n", + " print('Installing earth engine...')\n", + " !pip install earthengine-api" + ], + "metadata": { + "id": "bjHPMoqHFKFf" + }, + "execution_count": null, + "outputs": [] + }, { "cell_type": "markdown", "metadata": { @@ -42,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "id": "0E7Roy_8vEMr" }, @@ -73,7 +98,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "id": "_WX90K5wAq32" }, @@ -94,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "id": "bOVj_wrStdP1" }, @@ -119,7 +144,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "id": "vILLXX5tLLgc" }, @@ -141,7 +166,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -190,7 +215,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "id": "5DjGDn-fbbLG" }, diff --git a/gee-examples/python/Example_2_Aggregating_CMRSET_for_a_set_of_Features_(Spatial_Aggregation).ipynb b/gee-examples/python/Example_2_Aggregating_CMRSET_for_a_set_of_Features_(Spatial_Aggregation).ipynb index 11878b2..576f189 100644 --- a/gee-examples/python/Example_2_Aggregating_CMRSET_for_a_set_of_Features_(Spatial_Aggregation).ipynb +++ b/gee-examples/python/Example_2_Aggregating_CMRSET_for_a_set_of_Features_(Spatial_Aggregation).ipynb @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "id": "0E7Roy_8vEMr", "colab": { @@ -91,18 +91,16 @@ ], "source": [ "# Installs the geemap package\n", - "import subprocess\n", - "\n", "try:\n", " import geemap.foliumap as geemap\n", "except ImportError:\n", " print('Installing geemap...')\n", - " subprocess.check_call([\"python\", '-m', 'pip', 'install', 'geemap'])" + " !pip install geemap" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "id": "Otf5LCCh7abh", "colab": { @@ -163,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "id": "W0M1nRFz7h_g", "colab": { @@ -236,7 +234,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -309,7 +307,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -545,7 +543,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": { "id": "bOVj_wrStdP1", "colab": { @@ -610,7 +608,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": { "id": "vILLXX5tLLgc", "colab": { diff --git a/gee-examples/python/Example_3_Unpacking_the_CMRSET_QA_Band.ipynb b/gee-examples/python/Example_3_Unpacking_the_CMRSET_QA_Band.ipynb index 71710bd..940ff8b 100644 --- a/gee-examples/python/Example_3_Unpacking_the_CMRSET_QA_Band.ipynb +++ b/gee-examples/python/Example_3_Unpacking_the_CMRSET_QA_Band.ipynb @@ -44,7 +44,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -91,18 +91,16 @@ ], "source": [ "# Installs the geemap package\n", - "import subprocess\n", - "\n", "try:\n", " import geemap.foliumap as geemap\n", "except ImportError:\n", " print('Installing geemap...')\n", - " subprocess.check_call([\"python\", '-m', 'pip', 'install', 'geemap'])" + " !pip install geemap" ] }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "metadata": { "id": "befdSgC8q8HO", "colab": { @@ -163,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -234,7 +232,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "metadata": { "id": "bOVj_wrStdP1", "colab": { @@ -301,7 +299,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "metadata": { "id": "vILLXX5tLLgc", "colab": { @@ -364,7 +362,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "metadata": { "id": "urI--aW8vRyy", "colab": { @@ -426,7 +424,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "metadata": { "id": "WF45XxalDfM-", "colab": { @@ -486,7 +484,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", diff --git a/gee-examples/python/Example_4_Exporting_the_Image_Stack_for_a_Region.ipynb b/gee-examples/python/Example_4_Exporting_the_Image_Stack_for_a_Region.ipynb index a535c86..c211261 100644 --- a/gee-examples/python/Example_4_Exporting_the_Image_Stack_for_a_Region.ipynb +++ b/gee-examples/python/Example_4_Exporting_the_Image_Stack_for_a_Region.ipynb @@ -48,25 +48,23 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "id": "1Rnk0oVkgtrq" }, "outputs": [], "source": [ "# Installs the geemap package\n", - "import subprocess\n", - "\n", "try:\n", " import geemap.foliumap as geemap\n", "except ImportError:\n", " print('Installing geemap...')\n", - " subprocess.check_call([\"python\", '-m', 'pip', 'install', 'geemap'])" + " !pip install geemap" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "id": "befdSgC8q8HO", "outputId": "8982c8d5-8dee-40cf-c507-dd8cf964792c", @@ -127,7 +125,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -198,7 +196,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "id": "bOVj_wrStdP1", "outputId": "c9322345-f121-42db-cb7f-fbea00213189", @@ -250,7 +248,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -486,7 +484,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "id": "vILLXX5tLLgc", "outputId": "f82502e6-3013-4a13-888a-0d8cd21f2d9a", @@ -552,7 +550,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "id": "WF45XxalDfM-", "outputId": "5862e9d2-1ae7-471c-b967-2a1c2194a5b9", @@ -615,7 +613,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "id": "zShfc-4CTJ0W", "outputId": "6371fb73-f937-4558-e54e-113a29723c4b", @@ -695,7 +693,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "id": "fanB3EhGTS1S", "outputId": "7f5aad5a-5f26-4eb8-ec2c-e9538f2fbbbd", @@ -771,7 +769,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/",