mqAncientHistory / Lat-Epig

The Lat-Epig interface allows you to query the EDCS and save the search result in a TSV file and plot the results on a map of the Roman Empire without any prior knowledge of programming.
https://mybinder.org/v2/gh/mqAncientHistory/Lat-Epig/HEAD?urlpath=notebooks/EpigraphyScraper.ipynb
GNU General Public License v3.0
15 stars 0 forks source link

Connection timeout on map export #35

Closed Denubis closed 1 year ago

Denubis commented 3 years ago

Search terms: "Text 1- Carthag, AND, Text 2- Theveste" Platform: Binder/voila Error:



⠙ Making maps...2021-09-03T03:37:45.912817
{'operator': 'and', 'term2': 'Theveste', 'term1': 'Carthag'}
⠹ Making maps...Loaded data...
⠸ Making maps...Initialised plot...
0m Making maps...
---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
/usr/lib/python3.8/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1353             try:
-> 1354                 h.request(req.get_method(), req.selector, req.data, headers,
   1355                           encode_chunked=req.has_header('Transfer-encoding'))

/usr/lib/python3.8/http/client.py in request(self, method, url, body, headers, encode_chunked)
   1251         """Send a complete request to the server."""
-> 1252         self._send_request(method, url, body, headers, encode_chunked)
   1253 

/usr/lib/python3.8/http/client.py in _send_request(self, method, url, body, headers, encode_chunked)
   1297             body = _encode(body, 'body')
-> 1298         self.endheaders(body, encode_chunked=encode_chunked)
   1299 

/usr/lib/python3.8/http/client.py in endheaders(self, message_body, encode_chunked)
   1246             raise CannotSendHeader()
-> 1247         self._send_output(message_body, encode_chunked=encode_chunked)
   1248 

/usr/lib/python3.8/http/client.py in _send_output(self, message_body, encode_chunked)
   1006         del self._buffer[:]
-> 1007         self.send(msg)
   1008 

/usr/lib/python3.8/http/client.py in send(self, data)
    946             if self.auto_open:
--> 947                 self.connect()
    948             else:

/usr/lib/python3.8/http/client.py in connect(self)
   1413 
-> 1414             super().connect()
   1415 

/usr/lib/python3.8/http/client.py in connect(self)
    917         """Connect to the host and port specified in __init__."""
--> 918         self.sock = self._create_connection(
    919             (self.host,self.port), self.timeout, self.source_address)

/usr/lib/python3.8/socket.py in create_connection(address, timeout, source_address)
    807         try:
--> 808             raise err
    809         finally:

/usr/lib/python3.8/socket.py in create_connection(address, timeout, source_address)
    795                 sock.bind(source_address)
--> 796             sock.connect(sa)
    797             # Break explicitly a reference cycle

TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

URLError                                  Traceback (most recent call last)
~/src/lat_epig/map_interface.py in map_on_button_clicked(b)
    220             #     searchterm=None
    221 
--> 222             make_map(data_file=map_data.value,
    223                      map_title_text=map_title_text,
    224                      province_shapefilename=map_shapefile.value,

~/.local/lib/python3.8/site-packages/yaspin/core.py in inner(*args, **kwargs)
    119         def inner(*args, **kwargs):
    120             with self:
--> 121                 return fn(*args, **kwargs)
    122 
    123         return inner

~/src/lat_epig/make_map.py in make_map(data_file, map_title_text, province_shapefilename, searchterm, basemap_multicolour, provinces, roads, cities, filetype, show_ids, append_inscriptions, dpi, map_dimensions, partial_provinces, map_inscription_markersize, map_greyscale, will_cite)
    302       red = '#000000'
    303     if basemap_multicolour:
--> 304       bounded_prov.plot(ax=ax, linewidth=1, alpha=0.1,  cmap=prism, zorder=1, label=province_shapefilename)
    305     else:
    306       bounded_prov.plot(ax=ax, linewidth=0.3, alpha=0.5, color=brown, linestyle='dashed', zorder=1, label=province_shapefilename)

~/.local/lib/python3.8/site-packages/geopandas/plotting.py in __call__(self, *args, **kwargs)
    923             kind = kwargs.pop("kind", "geo")
    924             if kind == "geo":
--> 925                 return plot_dataframe(data, *args, **kwargs)
    926             if kind in self._pandas_kinds:
    927                 # Access pandas plots

~/.local/lib/python3.8/site-packages/geopandas/plotting.py in plot_dataframe(df, column, cmap, color, ax, cax, categorical, legend, scheme, k, vmin, vmax, markersize, figsize, legend_kwds, categories, classification_kwds, missing_kwds, aspect, **style_kwds)
    687 
    688     if column is None:
--> 689         return plot_series(
    690             df.geometry,
    691             cmap=cmap,

~/.local/lib/python3.8/site-packages/geopandas/plotting.py in plot_series(s, cmap, color, ax, figsize, aspect, **style_kwds)
    465         )
    466 
--> 467     plt.draw()
    468     return ax
    469 

~/.local/lib/python3.8/site-packages/matplotlib/pyplot.py in draw()
    958     the current figure.
    959     """
--> 960     gcf().canvas.draw_idle()
    961 
    962 

~/.local/lib/python3.8/site-packages/matplotlib/backend_bases.py in draw_idle(self, *args, **kwargs)
   2053         if not self._is_idle_drawing:
   2054             with self._idle_draw_cntx():
-> 2055                 self.draw(*args, **kwargs)
   2056 
   2057     def get_width_height(self):

~/.local/lib/python3.8/site-packages/matplotlib/backends/backend_agg.py in draw(self)
    404              (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
    405               else nullcontext()):
--> 406             self.figure.draw(self.renderer)
    407             # A GUI class may be need to update a window using this draw, so
    408             # don't forget to call the superclass.

~/.local/lib/python3.8/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     72     @wraps(draw)
     73     def draw_wrapper(artist, renderer, *args, **kwargs):
---> 74         result = draw(artist, renderer, *args, **kwargs)
     75         if renderer._rasterizing:
     76             renderer.stop_rasterizing()

~/.local/lib/python3.8/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     49                 renderer.start_filter()
     50 
---> 51             return draw(artist, renderer, *args, **kwargs)
     52         finally:
     53             if artist.get_agg_filter() is not None:

~/.local/lib/python3.8/site-packages/matplotlib/figure.py in draw(self, renderer)
   2778 
   2779             self.patch.draw(renderer)
-> 2780             mimage._draw_list_compositing_images(
   2781                 renderer, self, artists, self.suppressComposite)
   2782 

~/.local/lib/python3.8/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    130     if not_composite or not has_images:
    131         for a in artists:
--> 132             a.draw(renderer)
    133     else:
    134         # Composite any adjacent images together

~/.local/lib/python3.8/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     49                 renderer.start_filter()
     50 
---> 51             return draw(artist, renderer, *args, **kwargs)
     52         finally:
     53             if artist.get_agg_filter() is not None:

~/.local/lib/python3.8/site-packages/cartopy/mpl/geoaxes.py in draw(self, renderer, **kwargs)
    515         self._done_img_factory = True
    516 
--> 517         return matplotlib.axes.Axes.draw(self, renderer=renderer, **kwargs)
    518 
    519     def _update_title_position(self, renderer):

~/.local/lib/python3.8/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     49                 renderer.start_filter()
     50 
---> 51             return draw(artist, renderer, *args, **kwargs)
     52         finally:
     53             if artist.get_agg_filter() is not None:

~/.local/lib/python3.8/site-packages/matplotlib/_api/deprecation.py in wrapper(*inner_args, **inner_kwargs)
    429                          else deprecation_addendum,
    430                 **kwargs)
--> 431         return func(*inner_args, **inner_kwargs)
    432 
    433     return wrapper

~/.local/lib/python3.8/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
   2919             renderer.stop_rasterizing()
   2920 
-> 2921         mimage._draw_list_compositing_images(renderer, self, artists)
   2922 
   2923         renderer.close_group('axes')

~/.local/lib/python3.8/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    130     if not_composite or not has_images:
    131         for a in artists:
--> 132             a.draw(renderer)
    133     else:
    134         # Composite any adjacent images together

~/.local/lib/python3.8/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
     49                 renderer.start_filter()
     50 
---> 51             return draw(artist, renderer, *args, **kwargs)
     52         finally:
     53             if artist.get_agg_filter() is not None:

~/.local/lib/python3.8/site-packages/cartopy/mpl/feature_artist.py in draw(self, renderer, *args, **kwargs)
    151         except ValueError:
    152             warnings.warn('Unable to determine extent. Defaulting to global.')
--> 153         geoms = self._feature.intersecting_geometries(extent)
    154 
    155         # Combine all the keyword args in priority order.

~/.local/lib/python3.8/site-packages/cartopy/feature/__init__.py in intersecting_geometries(self, extent)
    295         """
    296         self.scaler.scale_from_extent(extent)
--> 297         return super().intersecting_geometries(extent)
    298 
    299     def with_scale(self, new_scale):

~/.local/lib/python3.8/site-packages/cartopy/feature/__init__.py in intersecting_geometries(self, extent)
    104             extent_geom = sgeom.box(extent[0], extent[2],
    105                                     extent[1], extent[3])
--> 106             return (geom for geom in self.geometries() if
    107                     geom is not None and extent_geom.intersects(geom))
    108         else:

~/.local/lib/python3.8/site-packages/cartopy/feature/__init__.py in geometries(self)
    277         key = (self.name, self.category, self.scale)
    278         if key not in _NATURAL_EARTH_GEOM_CACHE:
--> 279             path = shapereader.natural_earth(resolution=self.scale,
    280                                              category=self.category,
    281                                              name=self.name)

~/.local/lib/python3.8/site-packages/cartopy/io/shapereader.py in natural_earth(resolution, category, name)
    280     format_dict = {'config': config, 'category': category,
    281                    'name': name, 'resolution': resolution}
--> 282     return ne_downloader.path(format_dict)
    283 
    284 

~/.local/lib/python3.8/site-packages/cartopy/io/__init__.py in path(self, format_dict)
    201         else:
    202             # we need to download the file
--> 203             result_path = self.acquire_resource(target_path, format_dict)
    204 
    205         return result_path

~/.local/lib/python3.8/site-packages/cartopy/io/shapereader.py in acquire_resource(self, target_path, format_dict)
    335         url = self.url(format_dict)
    336 
--> 337         shapefile_online = self._urlopen(url)
    338 
    339         zfh = ZipFile(io.BytesIO(shapefile_online.read()), 'r')

~/.local/lib/python3.8/site-packages/cartopy/io/__init__.py in _urlopen(self, url)
    240         """
    241         warnings.warn('Downloading: {}'.format(url), DownloadWarning)
--> 242         return urlopen(url)
    243 
    244     @staticmethod

/usr/lib/python3.8/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    220     else:
    221         opener = _opener
--> 222     return opener.open(url, data, timeout)
    223 
    224 def install_opener(opener):

/usr/lib/python3.8/urllib/request.py in open(self, fullurl, data, timeout)
    523 
    524         sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
--> 525         response = self._open(req, data)
    526 
    527         # post-process response

/usr/lib/python3.8/urllib/request.py in _open(self, req, data)
    540 
    541         protocol = req.type
--> 542         result = self._call_chain(self.handle_open, protocol, protocol +
    543                                   '_open', req)
    544         if result:

/usr/lib/python3.8/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
    500         for handler in handlers:
    501             func = getattr(handler, meth_name)
--> 502             result = func(*args)
    503             if result is not None:
    504                 return result

/usr/lib/python3.8/urllib/request.py in https_open(self, req)
   1395 
   1396         def https_open(self, req):
-> 1397             return self.do_open(http.client.HTTPSConnection, req,
   1398                 context=self._context, check_hostname=self._check_hostname)
   1399 

/usr/lib/python3.8/urllib/request.py in do_open(self, http_class, req, **http_conn_args)
   1355                           encode_chunked=req.has_header('Transfer-encoding'))
   1356             except OSError as err: # timeout error
-> 1357                 raise URLError(err)
   1358             r = h.getresponse()
   1359         except:

URLError: <urlopen error [Errno 110] Connection timed out>```