|
10 | 10 | }, |
11 | 11 | { |
12 | 12 | "cell_type": "code", |
13 | | - "execution_count": null, |
| 13 | + "execution_count": 1, |
14 | 14 | "id": "06f33aaa", |
15 | 15 | "metadata": {}, |
16 | 16 | "outputs": [], |
|
29 | 29 | }, |
30 | 30 | { |
31 | 31 | "cell_type": "code", |
32 | | - "execution_count": null, |
| 32 | + "execution_count": 2, |
33 | 33 | "id": "abc973d4", |
34 | 34 | "metadata": {}, |
35 | | - "outputs": [], |
| 35 | + "outputs": [ |
| 36 | + { |
| 37 | + "name": "stdout", |
| 38 | + "output_type": "stream", |
| 39 | + "text": [ |
| 40 | + "Initializing DSClient...\n", |
| 41 | + "Authentication successful.\n", |
| 42 | + "DatabaseAccessor initialized. Connections will be created on first access.\n", |
| 43 | + "DSClient initialized.\n" |
| 44 | + ] |
| 45 | + } |
| 46 | + ], |
36 | 47 | "source": [ |
37 | 48 | "# Authenticate & Initialize Client\n", |
38 | 49 | "try:\n", |
|
46 | 57 | }, |
47 | 58 | { |
48 | 59 | "cell_type": "code", |
49 | | - "execution_count": null, |
| 60 | + "execution_count": 3, |
50 | 61 | "id": "3c1d34e8", |
51 | 62 | "metadata": {}, |
52 | | - "outputs": [], |
| 63 | + "outputs": [ |
| 64 | + { |
| 65 | + "name": "stdout", |
| 66 | + "output_type": "stream", |
| 67 | + "text": [ |
| 68 | + "\n", |
| 69 | + "Creating database convenience variables...\n", |
| 70 | + "First access to 'ngl', initializing DSDatabase...\n", |
| 71 | + "Creating SQLAlchemy engine for database 'sjbrande_ngl_db' (ngl)...\n", |
| 72 | + "Engine for 'ngl' created.\n", |
| 73 | + "First access to 'vp', initializing DSDatabase...\n", |
| 74 | + "Creating SQLAlchemy engine for database 'sjbrande_vpdb' (vp)...\n", |
| 75 | + "Engine for 'vp' created.\n", |
| 76 | + "First access to 'eq', initializing DSDatabase...\n", |
| 77 | + "Creating SQLAlchemy engine for database 'post_earthquake_recovery' (eq)...\n", |
| 78 | + "Engine for 'eq' created.\n", |
| 79 | + "Database variables (ngl, vp, eq) created.\n" |
| 80 | + ] |
| 81 | + } |
| 82 | + ], |
53 | 83 | "source": [ |
54 | 84 | "# Create Convenience Variables for Databases (Optional but meets user request)\n", |
55 | 85 | "print(\"\\nCreating database convenience variables...\")\n", |
|
87 | 117 | " except Exception as e:\n", |
88 | 118 | " print(f\"\\nAn error occurred during NGL database query: {e}\")\n", |
89 | 119 | "else:\n", |
90 | | - " print(\"\\nSkipping NGL query as 'ngl' variable is not available.\")\n", |
91 | | - "\n", |
92 | | - "if vp: # Check if vp variable was successfully created\n", |
93 | | - " try:\n", |
94 | | - " print(\"\\nQuerying VP Database using 'vp' variable (as dict)...\")\n", |
95 | | - " sql_vp = \"SELECT vp_id, vp_name FROM viewports LIMIT 3\"\n", |
96 | | - " dict_vp = vp.read_sql(sql_vp, output_type=\"dict\")\n", |
97 | | - " print(\"--- VP Data (List of Dicts) ---\")\n", |
98 | | - " print(json.dumps(dict_vp, indent=2))\n", |
99 | | - " except Exception as e:\n", |
100 | | - " print(f\"\\nAn error occurred during VP database query: {e}\")\n", |
101 | | - "else:\n", |
102 | | - " print(\"\\nSkipping VP query as 'vp' variable is not available.\")" |
| 120 | + " print(\"\\nSkipping NGL query as 'ngl' variable is not available.\")" |
103 | 121 | ] |
104 | 122 | } |
105 | 123 | ], |
106 | 124 | "metadata": { |
| 125 | + "kernelspec": { |
| 126 | + "display_name": "dapi-ptztLUqK-py3.13", |
| 127 | + "language": "python", |
| 128 | + "name": "python3" |
| 129 | + }, |
107 | 130 | "language_info": { |
108 | | - "name": "python" |
| 131 | + "codemirror_mode": { |
| 132 | + "name": "ipython", |
| 133 | + "version": 3 |
| 134 | + }, |
| 135 | + "file_extension": ".py", |
| 136 | + "mimetype": "text/x-python", |
| 137 | + "name": "python", |
| 138 | + "nbconvert_exporter": "python", |
| 139 | + "pygments_lexer": "ipython3", |
| 140 | + "version": "3.13.3" |
109 | 141 | } |
110 | 142 | }, |
111 | 143 | "nbformat": 4, |
|
0 commit comments