Skip to content

Commit bf65e10

Browse files
Automated update of talk locations
1 parent c2921a8 commit bf65e10

File tree

2 files changed

+57
-40
lines changed

2 files changed

+57
-40
lines changed

talkmap/org-locations.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ var addressPoints = [
99
37.8708393,
1010
-122.272863
1111
],
12-
[
13-
"Talk 1 on Relevant Topic in Your Field<br />UC San Francisco, Department of Testing; San Francisco, CA, USA",
14-
37.7792588,
15-
-122.4193286
16-
],
1712
[
1813
"Conference Proceeding talk 3 on Relevant Topic in Your Field<br />Testing Institute of America 2014 Annual Conference; Los Angeles, CA, USA",
1914
34.0536909,
2015
-118.242766
16+
],
17+
[
18+
"Talk 1 on Relevant Topic in Your Field<br />UC San Francisco, Department of Testing; San Francisco, CA, USA",
19+
37.7792588,
20+
-122.4193286
2121
]
2222
];

talkmap_out.ipynb

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"metadata": {
3030
"collapsed": false,
3131
"execution": {
32-
"iopub.execute_input": "2025-02-25T03:09:16.810855Z",
33-
"iopub.status.busy": "2025-02-25T03:09:16.810657Z",
34-
"iopub.status.idle": "2025-02-25T03:09:17.938183Z",
35-
"shell.execute_reply": "2025-02-25T03:09:17.937505Z"
32+
"iopub.execute_input": "2025-02-26T03:36:06.769536Z",
33+
"iopub.status.busy": "2025-02-26T03:36:06.769131Z",
34+
"iopub.status.idle": "2025-02-26T03:36:07.934020Z",
35+
"shell.execute_reply": "2025-02-26T03:36:07.933257Z"
3636
}
3737
},
3838
"outputs": [
@@ -41,14 +41,14 @@
4141
"output_type": "stream",
4242
"text": [
4343
"Collecting python-frontmatter\r\n",
44-
" Downloading python_frontmatter-1.1.0-py3-none-any.whl.metadata (4.1 kB)\r\n"
44+
" Downloading python_frontmatter-1.1.0-py3-none-any.whl.metadata (4.1 kB)\r\n",
45+
"Requirement already satisfied: getorg in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (0.3.1)\r\n"
4546
]
4647
},
4748
{
4849
"name": "stdout",
4950
"output_type": "stream",
5051
"text": [
51-
"Requirement already satisfied: getorg in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (0.3.1)\r\n",
5252
"Requirement already satisfied: PyYAML in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from python-frontmatter) (6.0.2)\r\n",
5353
"Requirement already satisfied: geopy in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from getorg) (2.4.1)\r\n",
5454
"Requirement already satisfied: pygithub in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from getorg) (2.6.1)\r\n",
@@ -60,19 +60,19 @@
6060
"Requirement already satisfied: typing-extensions>=4.0.0 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pygithub->getorg) (4.12.2)\r\n",
6161
"Requirement already satisfied: urllib3>=1.26.0 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pygithub->getorg) (2.3.0)\r\n",
6262
"Requirement already satisfied: Deprecated in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pygithub->getorg) (1.2.18)\r\n",
63-
"Requirement already satisfied: six>=1.7.0 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from retrying->getorg) (1.17.0)\r\n"
63+
"Requirement already satisfied: six>=1.7.0 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from retrying->getorg) (1.17.0)\r\n",
64+
"Requirement already satisfied: cryptography>=3.4.0 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pyjwt[crypto]>=2.4.0->pygithub->getorg) (44.0.1)\r\n",
65+
"Requirement already satisfied: cffi>=1.4.1 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pynacl>=1.4.0->pygithub->getorg) (1.17.1)\r\n",
66+
"Requirement already satisfied: charset-normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from requests>=2.14.0->pygithub->getorg) (3.4.1)\r\n",
67+
"Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from requests>=2.14.0->pygithub->getorg) (3.10)\r\n",
68+
"Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from requests>=2.14.0->pygithub->getorg) (2025.1.31)\r\n",
69+
"Requirement already satisfied: wrapt<2,>=1.10 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from Deprecated->pygithub->getorg) (1.17.2)\r\n"
6470
]
6571
},
6672
{
6773
"name": "stdout",
6874
"output_type": "stream",
6975
"text": [
70-
"Requirement already satisfied: cryptography>=3.4.0 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pyjwt[crypto]>=2.4.0->pygithub->getorg) (44.0.1)\r\n",
71-
"Requirement already satisfied: cffi>=1.4.1 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from pynacl>=1.4.0->pygithub->getorg) (1.17.1)\r\n",
72-
"Requirement already satisfied: charset-normalizer<4,>=2 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from requests>=2.14.0->pygithub->getorg) (3.4.1)\r\n",
73-
"Requirement already satisfied: idna<4,>=2.5 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from requests>=2.14.0->pygithub->getorg) (3.10)\r\n",
74-
"Requirement already satisfied: certifi>=2017.4.17 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from requests>=2.14.0->pygithub->getorg) (2025.1.31)\r\n",
75-
"Requirement already satisfied: wrapt<2,>=1.10 in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from Deprecated->pygithub->getorg) (1.17.2)\r\n",
7676
"Requirement already satisfied: pycparser in /opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages (from cffi>=1.4.1->pynacl>=1.4.0->pygithub->getorg) (2.22)\r\n",
7777
"Downloading python_frontmatter-1.1.0-py3-none-any.whl (9.8 kB)\r\n"
7878
]
@@ -81,7 +81,13 @@
8181
"name": "stdout",
8282
"output_type": "stream",
8383
"text": [
84-
"Installing collected packages: python-frontmatter\r\n",
84+
"Installing collected packages: python-frontmatter\r\n"
85+
]
86+
},
87+
{
88+
"name": "stdout",
89+
"output_type": "stream",
90+
"text": [
8591
"Successfully installed python-frontmatter-1.1.0\r\n"
8692
]
8793
},
@@ -103,7 +109,8 @@
103109
"import frontmatter\n",
104110
"import glob\n",
105111
"import getorg\n",
106-
"from geopy import Nominatim"
112+
"from geopy import Nominatim\n",
113+
"from geopy.exc import GeocoderTimedOut"
107114
]
108115
},
109116
{
@@ -112,10 +119,10 @@
112119
"metadata": {
113120
"collapsed": false,
114121
"execution": {
115-
"iopub.execute_input": "2025-02-25T03:09:17.940290Z",
116-
"iopub.status.busy": "2025-02-25T03:09:17.940054Z",
117-
"iopub.status.idle": "2025-02-25T03:09:17.943342Z",
118-
"shell.execute_reply": "2025-02-25T03:09:17.942828Z"
122+
"iopub.execute_input": "2025-02-26T03:36:07.936149Z",
123+
"iopub.status.busy": "2025-02-26T03:36:07.935901Z",
124+
"iopub.status.idle": "2025-02-26T03:36:07.939314Z",
125+
"shell.execute_reply": "2025-02-26T03:36:07.938765Z"
119126
}
120127
},
121128
"outputs": [],
@@ -130,14 +137,17 @@
130137
"metadata": {
131138
"collapsed": true,
132139
"execution": {
133-
"iopub.execute_input": "2025-02-25T03:09:17.945196Z",
134-
"iopub.status.busy": "2025-02-25T03:09:17.945010Z",
135-
"iopub.status.idle": "2025-02-25T03:09:17.969546Z",
136-
"shell.execute_reply": "2025-02-25T03:09:17.969023Z"
140+
"iopub.execute_input": "2025-02-26T03:36:07.941580Z",
141+
"iopub.status.busy": "2025-02-26T03:36:07.941049Z",
142+
"iopub.status.idle": "2025-02-26T03:36:07.966143Z",
143+
"shell.execute_reply": "2025-02-26T03:36:07.965594Z"
137144
}
138145
},
139146
"outputs": [],
140147
"source": [
148+
"# Set the default timeout, in seconds\n",
149+
"TIMEOUT = 5\n",
150+
"\n",
141151
"# Prepare to geolocate\n",
142152
"geocoder = Nominatim(user_agent=\"academicpages.github.io\")\n",
143153
"location_dict = {}\n",
@@ -159,10 +169,10 @@
159169
"metadata": {
160170
"collapsed": false,
161171
"execution": {
162-
"iopub.execute_input": "2025-02-25T03:09:17.971475Z",
163-
"iopub.status.busy": "2025-02-25T03:09:17.971291Z",
164-
"iopub.status.idle": "2025-02-25T03:09:23.694311Z",
165-
"shell.execute_reply": "2025-02-25T03:09:23.693697Z"
172+
"iopub.execute_input": "2025-02-26T03:36:07.968167Z",
173+
"iopub.status.busy": "2025-02-26T03:36:07.967976Z",
174+
"iopub.status.idle": "2025-02-26T03:36:11.603488Z",
175+
"shell.execute_reply": "2025-02-26T03:36:11.602744Z"
166176
}
167177
},
168178
"outputs": [
@@ -184,14 +194,14 @@
184194
"name": "stdout",
185195
"output_type": "stream",
186196
"text": [
187-
"Talk 1 on Relevant Topic in Your Field<br />UC San Francisco, Department of Testing; San Francisco, CA, USA San Francisco, California, United States\n"
197+
"Conference Proceeding talk 3 on Relevant Topic in Your Field<br />Testing Institute of America 2014 Annual Conference; Los Angeles, CA, USA Los Angeles, Los Angeles County, California, United States\n"
188198
]
189199
},
190200
{
191201
"name": "stdout",
192202
"output_type": "stream",
193203
"text": [
194-
"Conference Proceeding talk 3 on Relevant Topic in Your Field<br />Testing Institute of America 2014 Annual Conference; Los Angeles, CA, USA Los Angeles, Los Angeles County, California, United States\n"
204+
"Talk 1 on Relevant Topic in Your Field<br />UC San Francisco, Department of Testing; San Francisco, CA, USA San Francisco, California, United States\n"
195205
]
196206
}
197207
],
@@ -213,8 +223,15 @@
213223
" description = f\"{title}<br />{venue}; {location}\"\n",
214224
"\n",
215225
" # Geocode the location and report the status\n",
216-
" location_dict[description] = geocoder.geocode(location)\n",
217-
" print(description, location_dict[description])"
226+
" try:\n",
227+
" location_dict[description] = geocoder.geocode(location, timeout=TIMEOUT)\n",
228+
" print(description, location_dict[description])\n",
229+
" except ValueError as ex:\n",
230+
" print(f\"Error: geocode failed on input {location} with message {ex}\")\n",
231+
" except GeocoderTimedOut as ex:\n",
232+
" print(f\"Error: geocode timed out on input {location} with message {ex}\")\n",
233+
" except Exception as ex:\n",
234+
" print(f\"An unhandled exception occurred while processing input {location} with message {ex}\")"
218235
]
219236
},
220237
{
@@ -223,10 +240,10 @@
223240
"metadata": {
224241
"collapsed": false,
225242
"execution": {
226-
"iopub.execute_input": "2025-02-25T03:09:23.696332Z",
227-
"iopub.status.busy": "2025-02-25T03:09:23.696137Z",
228-
"iopub.status.idle": "2025-02-25T03:09:23.704293Z",
229-
"shell.execute_reply": "2025-02-25T03:09:23.703718Z"
243+
"iopub.execute_input": "2025-02-26T03:36:11.605607Z",
244+
"iopub.status.busy": "2025-02-26T03:36:11.605411Z",
245+
"iopub.status.idle": "2025-02-26T03:36:11.613528Z",
246+
"shell.execute_reply": "2025-02-26T03:36:11.612932Z"
230247
}
231248
},
232249
"outputs": [

0 commit comments

Comments
 (0)