diff --git a/seg2map.ipynb b/seg2map.ipynb index 40b75fc..995f49e 100644 --- a/seg2map.ipynb +++ b/seg2map.ipynb @@ -45,10 +45,21 @@ "metadata": {}, "outputs": [], "source": [ + "import ee\n", + "from google.auth import exceptions as google_auth_exceptions\n", + "\n", "try:\n", " ee.Initialize()\n", - "except google_auth_exceptions.RefreshError as exception:\n", - " print(\"Please authenticate with Google:\\n\")\n", + "except google_auth_exceptions.RefreshError:\n", + " print(\"Please refresh your Google authentication token.\\n\")\n", + " ee.Authenticate()\n", + " ee.Initialize()\n", + "except ee.EEException:\n", + " print(\"Please authenticate with Google Earth Engine:\\n\")\n", + " ee.Authenticate()\n", + " ee.Initialize()\n", + "except FileNotFoundError:\n", + " print(\"Credentials file not found. Please authenticate with Google Earth Engine:\\n\")\n", " ee.Authenticate()\n", " ee.Initialize()" ] @@ -97,6 +108,14 @@ "models_ui = UI_Models()\n", "models_ui.create_dashboard()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "080c0b88-db97-4fcf-9e39-0e12a447c0b9", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -115,7 +134,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.10.13" } }, "nbformat": 4,