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

P-Median Problem Tutorial Binder example #276

Closed
Tracked by #280
nickbearman opened this issue Sep 21, 2022 · 8 comments · Fixed by #288
Closed
Tracked by #280

P-Median Problem Tutorial Binder example #276

nickbearman opened this issue Sep 21, 2022 · 8 comments · Fixed by #288
Assignees
Labels
bug Something isn't working locate notebooks/binders

Comments

@nickbearman
Copy link
Contributor

Thanks for the really useful P-Median Problem Tutorial - https://pysal.org/spopt/notebooks/p-median.html.

The binder version looks really useful - and I can open the link fine.
https://mybinder.org/v2/gh/pysal/spopt/main?filepath=notebooks/p-median.ipynb

However when I run the first code block:

from spopt.locate import PMedian
from spopt.locate.util import simulated_geo_points

import numpy
import geopandas
import pulp
import spaghetti
from shapely.geometry import Point
import matplotlib.pyplot as plt

I get this error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 from spopt.locate import PMedian
      2 from spopt.locate.util import simulated_geo_points
      4 import numpy

ModuleNotFoundError: No module named 'spopt'

So it can't find the spopt.locate / spopt.locate.util libraries - any pointers please?

This may be related to #113

Many thanks,
Nick.

@jGaboardi
Copy link
Member

Looks like we never add spopt into environment.yml...

@jGaboardi
Copy link
Member

Though the binders did work before, so I am bit confused by this.

@jGaboardi
Copy link
Member

Also to do:

  • remove descartes
  • bump Python version to 3.10
  • follow spaghetti's example and install spopt's main branch

@gegen07
Copy link
Member

gegen07 commented Sep 21, 2022

@jGaboardi I noticed some notebooks (AZP and Skater) have sys.path.append(../) and that make the code work properly. If we change something in the future we should change these code blocks.

@nickbearman
Copy link
Contributor Author

Just tried this again and didn't get anywhere:

2023-01-30T10:03:55.399962Z [Warning] 0/3 nodes are available: 1 node(s) didn't match Pod's node affinity/selector, 2 Insufficient memory.

Has anyone else tried it? I will give it a few days and try again.

@jGaboardi
Copy link
Member

@nickbearman Just now I was able to open the binder and run the P-Median notebook, both from the link in the README and the link in the tutorial page. I wonder why you are having trouble with this...

@nickbearman
Copy link
Contributor Author

Thanks @jGaboardi - I've just tried it again, and it works now. However it took a long time to be ready. Like, a significant number of whole minutes. I think possibly 10 min, maybe even 15 (I tried it after your comment and it has only just finished loading). Thanks for checking :-)

@nickbearman
Copy link
Contributor Author

Just to note @jGaboardi it took 11 min to load the binder.

I've also been through the notebook myself and can confirm it all works! Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working locate notebooks/binders
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants