spopt
spopt copied to clipboard
P-Median Problem Tutorial Binder example
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 https://github.com/pysal/spopt/issues/113
Many thanks, Nick.
Looks like we never add spopt
into environment.yml
...
Though the binders did work before, so I am bit confused by this.
Also to do:
- remove
descartes
- bump Python version to 3.10
- follow
spaghetti
's example and installspopt
'smain
branch
@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.
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.
@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...
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 :-)
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 :-)