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

tutorial.ipynb will not run #41

Closed
rkn2 opened this issue Sep 11, 2023 · 5 comments
Closed

tutorial.ipynb will not run #41

rkn2 opened this issue Sep 11, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@rkn2
Copy link

rkn2 commented Sep 11, 2023

I am using the current tutorial.ipynb however when I get to step 3.2 Synthesize Zones and OD Demand Matrix, I get an error back. I have not changed any code or the datafiles it is using--I am just trying to run the original notebook to learn more about the code in general. Thanks for your help!
image

@rkn2
Copy link
Author

rkn2 commented Sep 11, 2023

Additionally I tried to get around this using my own data from grid2demand (attached here) and I got a different error when I tried to run section 3.1 basic functionalities.
image
...continued...
image

Files if it is helpful:
link.csv
node.csv
input_agent.csv
zone.csv
poi_trip_rate.csv
accessibility.csv
demand.csv

@jdlph jdlph added the bug Something isn't working label Sep 12, 2023
@jdlph jdlph added this to @Path4GMNS Sep 12, 2023
@jdlph jdlph moved this to In Progress in @Path4GMNS Sep 12, 2023
@jdlph
Copy link
Owner

jdlph commented Sep 12, 2023

The first issue is related to the setup of synthesized zone id's in _synthesize_grid(), where zone id shall be string. It has been fixed under commit 403be24. It will be part of v0.9.7 in the next release.

@jdlph
Copy link
Owner

jdlph commented Sep 12, 2023

The second issue comes from the data itself. This is data type inconsistency between node.csv and link.csv in terms of node id. Specifically, node id's are all decimal numbers in node.csv but integers in link.csv. For example, the id's of the two nodes are 0.0 and 1.0.

image

Later on, when you load link.csv and hit the first link (from_node_id: 0 and to_node_id: 1), Path4GMNS will throw an exception to indicate this link is invalid as those nodes are not present in node.csv.

This issue can be avoided if you use any version prior to v0.9.5 (e.g., install v0.9.4 through the following command), where node id is required to be integer. v0.9.5 drops this requirement by allowing any arbitrary value. See here for details.

$ pip install path4gmns==0.9.4

An alternative way is to manually covert node id to integer in node.csv. The following is the screenshot of a smooth run after the conversion.

image

This thread will be closed as the underlying data inconsistency comes from an application upstream to Path4GMNS, which could be either osm2gmns or grid2demand. If you have any follow-up questions, you can reopen it. Thank you again for reporting this issue!

@jdlph jdlph closed this as completed Sep 12, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in @Path4GMNS Sep 12, 2023
@rkn2
Copy link
Author

rkn2 commented Sep 12, 2023

The first issue is related to the setup of synthesized zone id's in _synthesize_grid(), where zone id shall be string. It has been fixed under commit 403be24. It will be part of v0.9.7 in the next release.

Hi so is this accessible now? Or do I have to wait for some time? After your restponse I tried to force the install of the latest version but it doesn't seem to be able to connect to 0.9.7.
image
and then it again breaks at 3.2
image

@jdlph
Copy link
Owner

jdlph commented Sep 12, 2023

v0.9.7 is not released yet. You would have to wait until it is published on PyPI or build the package on your own using the latest code from the dev branch. Please see 2. Build and Install the Python Package for instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants