Circuitscape / Circuitscape.jl

Algorithms from circuit theory to predict connectivity in heterogeneous landscapes
https://circuitscape.org
MIT License
128 stars 35 forks source link

CS.jl disconnecting pairs while CS 4.05 is not #122

Closed rmarrotte closed 5 years ago

rmarrotte commented 6 years ago

Hi, It seems like CS.jl is setting some pairs to -1, while CS 4.05 is still computing these pairs. I have a total of 268,278 pairs. CS.jl seems to think that 64,270 of these pairs are disconnected. Any ideas as to why CS.jl is doing this? Thanks Robby

cs_and julia_output

ranjanan commented 6 years ago

Hi @rmarrotte, could you please paste the output of the following code on the Julia terminal:

Pkg.status("Circuitscape")

Also, is there a way you could share your input so I can check? Thank you.

rmarrotte commented 6 years ago

Pkg.status("Circuitscape") Circuitscape 5.0.0+ master https://www.dropbox.com/sh/jvqkt0zcwf0yll1/AAAd8YB9XZy59WIrG8rahle4a?dl=0

ranjanan commented 6 years ago

Thanks, @rmarrotte. According to logs, it seems to take a fewer pairs (86736) instead of the right number of pairs(268278). This seems to happen even as I disable the include_pairs option. Odd. I'll figure it out and let you know ASAP.

rmarrotte commented 6 years ago

Yes, @ranjanan I was wondering whether there was a maximum number of nodes or some kind of maximum resistance threshold or something. Also, I was thinking it could be that some nodes are very close to each other, but there isn't this pattern in the data at all.

ranjanan commented 6 years ago

No, I don't have either of those thresholds. I think I just made a mistake counting the number of pairs to solve. I'm investigating it right now.

ranjanan commented 6 years ago

@rmarrotte could you run the following commands at the Julia prompt:

Pkg.checkout("Circuitscape")
Pkg.checkout("Circuitscape", "pt_calc")

restart Julia and then see if you're getting the right answer? Just checking out a hunch.

rmarrotte commented 6 years ago

@ranjanan No update was available, same results.

ranjanan commented 6 years ago

@rmarrotte I'm sorry, by

No update was available

do you mean you weren't able to checkout the branch? Or were you able to check out the branch but it didn't fix the issue? Did you restart Julia before trying?

rmarrotte commented 6 years ago

@ranjanan It checked it out and found nothing new for both. Restarted Julia before I did this. Ran CS just in case, but nothing new.

ranjanan commented 6 years ago

Hi @rmarrotte I pushed one more commit to the same branch. Could you do Pkg.checkout("Circuitscape", "pt_calc") again and check please? Thanks.

rmarrotte commented 6 years ago

Nope, nothing new to update or install

ranjanan commented 6 years ago

Okay then. I'm sorry about this. I will run this privately and come up with a fix.

ranjanan commented 6 years ago

Hi Robby, I'm really sorry, but I'm having some trouble because your example has a really high number of pairs to solve which makes it hard to debug this. Is there a slightly smaller problem that you have where you can reproduce this behaviour?

ranjanan commented 6 years ago

@rmarrotte ^

ViralBShah commented 6 years ago

@ranjanan Can we run connected components on the input and see if we are doing that correctly?

rmarrotte commented 6 years ago

@ranjanan Not really. Do you think it crashed because of 1 specific pair? Like I indicated a while back, there are some pairs that are right on top of each other within the same pixel. I think CS has some way of dealing with this by setting the effective resistance to 0 or -700.

ranjanan commented 5 years ago

@rmarrotte #167 also fixes this. Is there a smaller test you can run to confirm this?