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
385 stars 84 forks source link

Informative warning for shortest path unsigned integer #169

Closed PyMap closed 1 year ago

PyMap commented 3 years ago

From #166 and #168 we know that unconnected nodes in net object return the unsigned 4294967.295 integer value for shortest path distance calculation. In order to identify the external indexes of these nodes I included informative warnings for single integer and list of integers between origin and destinations.

Non connected idx can be found in #168, the data and script to reproduce/test warnings in both shortest_path_length/shortest_path_lengths methods can be found here

To run the script:

python pdna_path.py --origin 1599 5062  --destin 557 6235 
github-actions[bot] commented 3 years ago

Test coverage is 89%

PyMap commented 3 years ago

@federicofernandez thanks for the feedback! You suggest something like:

invalid_result = 4294967.295

if shortest_path distance == invalid_result:
      warning.warn ...

I know that "invalid result" wouldn't be creative enough, just asking to catch the idea