UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
387 stars 83 forks source link

set_pois() fails with number of args error #93

Closed wbchilds closed 6 years ago

wbchilds commented 6 years ago

Just running through the tutorial and it's telling me I don't have the right number of args for set_pois().

I'm loading OSM data for Sydney, Australia using the pdna OSM from bbox method (which seems to work well), and I'm just using 10 random POIs (I'm just filling some pd.Series with rands inside the bbox).

Environment

Windows-10-10.0.14393-SP0 Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] Pandas 0.21.0 Pandana 0.3.0 Numpy 1.12.1

Here's the code to reproduce the issue:

from pandana.loaders import osm
network = osm.pdna_network_from_bbox(-33.9014, 151.0216, -33.7704, 151.3093)
network.precompute(3000)
x = pd.Series([(-33.7704-(-33.9014))*np.random.random_sample()-33.9014 for i in range(0,10)])
y = pd.Series([(151.3093-151.0216)*np.random.random_sample()+151.0216 for i in range(0,10)])
network.set_pois("restaurants",2000,10,x,y)

Here's the error:

set_pois() takes 4 positional arguments but 6 were given
sablanchard commented 6 years ago

Thanks for the report @wbchilds, it looks like you are using Pandana v0.3.0 but the tutorial you are using is for the latest version v0.4.0 which has an updated api for set_pois(). I suggest you try to upgrade your version to 0.4.0 to continue with the tutorial as there are a number of additional api differences. If you wish to use 0.3.0 we suggest you take a look at the old api for that function via the function docstrings.

bstabler commented 6 years ago

I ran into this issue as well since conda install -c udst pandana installs version 3. I think the udst channel should be consistent or removed from the documentation.

https://anaconda.org/udst/pandana

wbchilds commented 6 years ago

Looks like 0.4 hasn't been submitted to PyPI even though the build is passing. Is there a reason for this?

Edit: Sorry this is a lie. PyPI has 0.4. I just need to use the right flags -.-