-
Notifications
You must be signed in to change notification settings - Fork 84
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
Different results when making multiple calls with nearest_pois #73
Comments
@sablanchard you guys been able to reproduce this yet? |
Not yet.I gave a look on Friday but I didn't get to that point.
…On Mon, May 1, 2017 at 3:21 PM, Fletcher Foti ***@***.***> wrote:
@sablanchard <https://github.com/sablanchard> you guys been able to
reproduce this yet?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#73 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABx17R6oAEDNfxQhVpr-BB5eP7culKRbks5r1iKTgaJpZM4NJhLc>
.
|
I realized I was not using the most current pandana version so I upgraded. However, all of the queries now return a dataframe where none of the nodes are within the distance limit. So the print statements in the tests are all printing 0. I am having the same exact issue with an UrbanAccess network: Thanks! |
Update- The set_pois method seems to only work now with x, y data that have more than one record. So the following returns a result:
I have also confirmed that the issue I first reported on this thread is still happening in the latest version. I will post the revised code to do the tests later today. |
@stefancoe I added some code to test this using the test data here everything seems to be working ok as best as I can tell. (fyi adding this test makes other tests fail, but not related to this issue) |
Great call @fscottfoti. I can fix the |
I was actually confused by that test failure - why isn't master failing because of it? The other test failure is because I added the test so now the network is initialized while the other test was expecting it to not be initialized yet. I can probably fix that one. |
I think only because the new pandas release made it to Conda in the last couple of days, and last build of |
Thanks @fscottfoti! For my own sanity, can you run this code below? No files needed. From the print statements, I get 972, 693, and 678. Thanks!
|
weird - I wonder if it's related to #43 when I ask for 10 pois rather than 1 the problem goes away so you're trying to get an isochrone to this one point in your web service and it's not working in that use case? |
Yeah- If a user were to make multiple calls in the same area, the results after the first call may not be correct. I have a work around (similar to what you found) that should work- set init_poi with many categories and then only call each category once. The code below produces stable results across calls, so it should be fine as long as only one nearest_poi is used per poi category.
|
OK I've looked into it a bit. Turns out @federicofernandez is actually looking at the same thing in #80. I read the underlying code wrong and set_pois actually adds pois rather than re-initializing the memory and starting with new pois. So test 2 adds a new poi and then test 3 adds another new poi (in the same location as the first) and so you get different results on successive calls. @federicofernandez was just looking into the initialization of these data structures so I'll continue this on issue #80 to see if it's possible to re-initialize a category from scratch. In short, for now, the solution you came up with (have lots of categories) is likely the only solution that will work. Also, the fact that you needed two pois in the |
@stefancoe I think I have this all solved for you in #81 . Do you have the means to build from source, or do you use Windows (which I think is harder to build from source)? I'm hoping the former so you can test it out before we cut a build. |
@fscottfoti I am using windows and have a virtual env set up that should work. Should I pull the code and run setup.py? |
I haven't a clue how to compile on Windows - does anyone else know if this works? @sablanchard @pksohn |
I did it a couple of times. Those are the correct instructions, the only detail is to have the corresponding version of Visual C++ for Python, according to the python version that @stefancoe has. Let me know if I can help with that. |
I was at a conference all week, I'll try to test this by early next week. |
I cloned this branch https://github.com/UDST/pandana/tree/issue-73 but setup.py failed because it could not find vcvarsall.bat, which is the c compiler installed by Visual Studio. I tried all the usual fixes (e.g. https://stackoverflow.com/questions/2667069/cannot-find-vcvarsall-bat-when-running-a-python-script) that have worked in the past but no luck this time. Sorry I could not be of more help testing this on windows. |
Fixed in #87, which will be released soon |
Description of the bug
I am assigning network node_ids a to parcel data set and then running nearest_poi to find all of the parcels within a mile of a set of coordinates. I want to be able to re-run these queries without re-creating the network. However, If I use one set of coordinates, then a different set of coordinates whose buffer intersects with the first set, then run the first set again, I get a different number of parcels returned in the first and third query. Please see the code as it might be easier to understand.
I am pretty sure that this is not a copy of a reference problem (in my code) because I use df.copy() to make a copy of the original parcel dataframe in the get_nearest_parcels function before any modifications are made to it. Also, the reason I do not want to recreate the network after each query is to save time- I am prototyping a web service that uses pandana to generate geojson isochrones from a passed in set of coordinates. So ideally the network is loaded and the app is listening for coordinates to run the query. I noticed this behavior because the app started generating weird polygons when making multiple calls from the same area. I have added the network files below.
UPDATE: The parcel DataFrame has nothing to do with the error so I have updated the code for simplicity.
Thanks,
Stefan
Network data (optional)
https://file.ac/8UQg8JUbhvs/
Environment
Operating system:
Windows
Python version:
2,7
Pandana version:
0.2.0
Pandana required packages versions (optional):
Paste the code that reproduces the issue here:
Paste the error message (if applicable):
# place error message here
The text was updated successfully, but these errors were encountered: