Skip to content

Commit

Permalink
Simplify the way the imports are done on the python notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jamievleeshouwer committed Jun 5, 2024
1 parent 43f2858 commit 3182986
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -42,7 +67,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"id": "0E7Roy_8vEMr"
},
Expand Down Expand Up @@ -73,7 +98,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"id": "_WX90K5wAq32"
},
Expand All @@ -94,7 +119,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"id": "bOVj_wrStdP1"
},
Expand All @@ -119,7 +144,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"id": "vILLXX5tLLgc"
},
Expand All @@ -141,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -190,7 +215,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"id": "5DjGDn-fbbLG"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"id": "0E7Roy_8vEMr",
"colab": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -163,7 +161,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {
"id": "W0M1nRFz7h_g",
"colab": {
Expand Down Expand Up @@ -236,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -309,7 +307,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -545,7 +543,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"id": "bOVj_wrStdP1",
"colab": {
Expand Down Expand Up @@ -610,7 +608,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {
"id": "vILLXX5tLLgc",
"colab": {
Expand Down
20 changes: 9 additions & 11 deletions gee-examples/python/Example_3_Unpacking_the_CMRSET_QA_Band.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -163,7 +161,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -234,7 +232,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": null,
"metadata": {
"id": "bOVj_wrStdP1",
"colab": {
Expand Down Expand Up @@ -301,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": null,
"metadata": {
"id": "vILLXX5tLLgc",
"colab": {
Expand Down Expand Up @@ -364,7 +362,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": null,
"metadata": {
"id": "urI--aW8vRyy",
"colab": {
Expand Down Expand Up @@ -426,7 +424,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": null,
"metadata": {
"id": "WF45XxalDfM-",
"colab": {
Expand Down Expand Up @@ -486,7 +484,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -127,7 +125,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -198,7 +196,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"id": "bOVj_wrStdP1",
"outputId": "c9322345-f121-42db-cb7f-fbea00213189",
Expand Down Expand Up @@ -250,7 +248,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down Expand Up @@ -486,7 +484,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"id": "vILLXX5tLLgc",
"outputId": "f82502e6-3013-4a13-888a-0d8cd21f2d9a",
Expand Down Expand Up @@ -552,7 +550,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"id": "WF45XxalDfM-",
"outputId": "5862e9d2-1ae7-471c-b967-2a1c2194a5b9",
Expand Down Expand Up @@ -615,7 +613,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {
"id": "zShfc-4CTJ0W",
"outputId": "6371fb73-f937-4558-e54e-113a29723c4b",
Expand Down Expand Up @@ -695,7 +693,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"id": "fanB3EhGTS1S",
"outputId": "7f5aad5a-5f26-4eb8-ec2c-e9538f2fbbbd",
Expand Down Expand Up @@ -771,7 +769,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
Expand Down

0 comments on commit 3182986

Please sign in to comment.