pysal / libpysal

Core components of Python Spatial Analysis Library
http://pysal.org/libpysal
Other
253 stars 79 forks source link

libpysal calling web requests at module import (not working behind a corporate proxy, thus slowing process) #522

Open tgrandje opened 1 year ago

tgrandje commented 1 year ago

I just updated libpysal in a old project (this was long overdue). I'm now encountering a (very) long loading of the package, which is linked to :

I added a raised exception in my examples/remotes.py (on poll_remotes) to identify the culprit. The traceback is the following:

Traceback (most recent call last):

  File "my_path/commons.py", line 11, in <module>
    from libpysal.cg.voronoi import voronoi_frames

  File "/my_other_path/.cache/pypoetry/virtualenvs/venv-ire-Z5e797_--py3.9/lib/python3.9/site-packages/libpysal/__init__.py", line 26, in <module>
    from . import examples

  File "/my_other_path/.cache/pypoetry/virtualenvs/venv-ire-Z5e797_--py3.9/lib/python3.9/site-packages/libpysal/examples/__init__.py", line 18, in <module>
    available_datasets.update(remote_datasets.datasets)

  File "/my_other_path/.cache/pypoetry/virtualenvs/venv-ire-Z5e797_--py3.9/lib/python3.9/site-packages/libpysal/examples/remotes.py", line 108, in datasets
    self._datasets = poll_remotes()

  File "/my_other_path/.cache/pypoetry/virtualenvs/venv-ire-Z5e797_--py3.9/lib/python3.9/site-packages/libpysal/examples/remotes.py", line 21, in poll_remotes
    raise Exception('Dummy')   # <-- this is my custom exception being raised

I'm not sure how to proceed on this (I'm not using the examples of the package): should'nt these requests being stored in the fetch_all function (for instance) ?

sjsrey commented 1 year ago

xref https://github.com/pysal/libpysal/issues/734