Circuitscape / Circuitscape.py

Circuitscape uses electronic circuit theory to solve problems in landscape ecology.
https://www.circuitscape.org/
Other
27 stars 17 forks source link

Bug in include pairs code #69

Closed bmcrae closed 10 years ago

bmcrae commented 10 years ago

A Circuitscape user reported the following. I've traced it to the line self.mat = mat.tolil() in compute_base.py but am not sure how to fix it:

"Hi all, I've been running into issues with when specifying a list of focal node pairs to include/exclude while in pairwise mode (raster input), and believe it may be a bug related to the length of my node IDs (eight digits in the form "82XXXXX")

The following resistance map ("resistance.asc") and focal node location file ("patch.asc") work correctly when run without a list of focal node pairs. When a list of focal node pairs ("list_of_pairs_to_include.txt") is added however, Circuitscape hangs at "Processing maps", and will typically crash.

https://dl.dropboxusercontent.com/u/35800966/Long_IDs.zip

The following exactly replicates the above case identically, except that I have changed my node IDs from the form "82XXXXX" to a single digit "X" ("patch_2.asc"). With shorter node IDs, adding a focal node pair list ("list_of_pairs_to_include_2.txt") no longer crashes Circuitscape.

https://dl.dropboxusercontent.com/u/35800966/Short_IDs.zip

The fact that eight-digit node IDs work fine when a focal node list is not specified make me think this may be a bug, but if not, I'd love some help in getting around this issue (if possible I'd really like to keep my node IDs in their original form).

Thanks in advance,

Robbi"

tanmaykm commented 10 years ago

Fixed via. https://github.com/Circuitscape/Circuitscape/commit/43fabb1f4a6b9223886eff04863d0ed478b068da