Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions doc/content/cmems_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,32 @@
"metadata": {},
"outputs": [],
"source": [
"# Try to load .env file (for local development)\n",
"\n",
"# Try to load .env file\n",
"local_env = load_dotenv()\n",
"print(f\"load_dotenv() returned: {local_env}\")\n",
"\n",
"if local_env:\n",
" print(\"Loaded .env file (local development)\")\n",
"else:\n",
" print(\"No .env file found (using environment variables)\")\n",
" # Verify credentials are available\n",
" username = os.getenv(\"COPERNICUSMARINE_SERVICE_USERNAME\")\n",
" password = os.getenv(\"COPERNICUSMARINE_SERVICE_PASSWORD\")\n",
"# Check if running in GitHub Actions\n",
"is_github_actions = os.getenv('GITHUB_ACTIONS')\n",
"print(f\"GITHUB_ACTIONS: {is_github_actions}\")\n",
"\n",
"# Check all environment variables (for debugging)\n",
"print(\"Available environment variables:\")\n",
"for key in sorted(os.environ.keys()):\n",
" if 'COPERNICUS' in key or 'CMEMS' in key:\n",
" print(f\" {key}: {'***' if 'PASSWORD' in key else os.environ[key]}\")\n",
"\n",
" if username and password:\n",
" print(\"✅ Credentials loaded successfully\")\n",
" else:\n",
" print(\"❌ Credentials not found\")"
"# Try to get credentials\n",
"username = os.getenv(\"COPERNICUSMARINE_SERVICE_USERNAME\")\n",
"password = os.getenv(\"COPERNICUSMARINE_SERVICE_PASSWORD\")\n",
"\n",
"print(f\"Username found: {username is not None}\")\n",
"print(f\"Password found: {password is not None}\")\n",
"\n",
"if username and password:\n",
" print(\"✅ Credentials loaded successfully\")\n",
"else:\n",
" print(\"❌ Credentials not found\")"
]
},
{
Expand Down