This repository has been archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move code to install the module outside of the module
Fixes #12
- Loading branch information
Showing
4 changed files
with
44 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
# AUTOGENERATED! DO NOT EDIT! File to edit: ../00_core.ipynb. | ||
|
||
# %% auto 0 | ||
__all__ = ['colab_gee_setup'] | ||
__all__ = ['authenticate_if_needed'] | ||
|
||
# %% ../00_core.ipynb 5 | ||
def colab_gee_setup(): | ||
"""Setup Colab so it can use the earthengine-jupyter package. | ||
def authenticate_if_needed(): | ||
"""Authenticate Earth Engine, if credentials do not exist. | ||
* Install earthengine-jupyter package. | ||
* Authenticate, if needed.""" | ||
|
||
import ee | ||
import os | ||
|
||
print('Verifying environment is setup for earthengine-jupyter...') | ||
|
||
try: | ||
import ee_jupyter | ||
print('\N{check mark} The package earthengine-jupyter is already installed.') | ||
except ModuleNotFoundError: | ||
print('\N{check mark} Installing earthengine-jupyter...') | ||
result = os.system('pip -q install earthengine-jupyter') | ||
|
||
if os.path.exists(ee.oauth.get_credentials_path()): | ||
print('\N{check mark} Authentication credentials were found.') | ||
else: | ||
ee.Authenticate() | ||
|
||
print('\N{check mark} Done.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters