Skip to content

Commit

Permalink
refactor: remove auth
Browse files Browse the repository at this point in the history
  • Loading branch information
dfguerrerom committed Dec 20, 2023
1 parent 943b2ba commit ce47ce0
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions ui.ipynb
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "6f434bc9",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"from pathlib import Path\n",
"import ee\n",
"\n",
"\n",
"def authenticate_gee():\n",
" \"\"\"Authenticate GEE using the credentials file in the user's home directory.\"\"\"\n",
" credential_folder_path = Path.home() / \".config\" / \"earthengine\"\n",
" credential_file_path = credential_folder_path / \"credentials\"\n",
" credentials = json.loads(credential_file_path.read_text())\n",
" project = credentials.get(\"project_id\", credentials.get(\"project\", None))\n",
" ee.Initialize(project=project)\n",
" assert ee.data.getAssetRoots(), \"Error: You have not initialized the GEE home folder. Please follow the the SEPAL documentation: https://docs.sepal.io/en/latest/setup/gee.html#initialize-the-home-folder.\"\n",
" \n",
"authenticate_gee()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -154,4 +130,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}

0 comments on commit ce47ce0

Please sign in to comment.