Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tgrandje opened this issue Mar 9, 2023 · 1 comment
Assignees

Comments

@tgrandje
Copy link

tgrandje commented Mar 9, 2023

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 :

  • me working behind a corporate proxy;
  • the examples module still being loaded at import, notwithstanding this closed issue; to be accurate, it may not be loaded (I didn't check), but a web query is still called to update the available_datasets.

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) ?

  • Platform information: posix linux posix.uname_result(sysname='Linux', nodename='siddee', release='5.4.0-131-generic', version='#147~18.04.1-Ubuntu SMP Sat Oct 15 13:10:18 UTC 2022', machine='x86_64')
  • Python version: 3.9.6 (default, Jun 29 2021, 12:40:25) [GCC 7.5.0]
  • SciPy version: 1.9.3
  • NumPy version: 1.23.5
@sjsrey
Copy link
Member

sjsrey commented May 27, 2023

xref pysal/pysal#1276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants