pandana icon indicating copy to clipboard operation
pandana copied to clipboard

Informative warning for shortest path unsigned integer

Open PyMap opened this issue 4 years ago • 2 comments

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 

PyMap avatar Aug 20 '21 21:08 PyMap

Test coverage is 89%

github-actions[bot] avatar Aug 20 '21 21:08 github-actions[bot]

@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

PyMap avatar Aug 23 '21 15:08 PyMap