Circuitscape / Omniscape.jl

Functions to compute omnidirectional landscape connectivity using circuit theory and the Omniscape algorithm.
https://docs.circuitscape.org/Omniscape.jl/stable/
MIT License
58 stars 12 forks source link

Add option to pass connect_four_neighbors_only option to Circuitscape #60

Closed pdtyrrell closed 4 years ago

pdtyrrell commented 4 years ago

Hi all, thanks for a great package, enjoying using it. Is it possible to pass and argument to circuitscape to limit connectivity to connect to four neighbours only, rather than the default 8?

i.e in Circuitscape you can set connect_four_neighbors_only = True

Cheers,

Pete

vlandau commented 4 years ago

Glad you're enjoying the package @pkenya! For now this is not possible in Omniscape but I may be able to add that possibility somewhat easily assuming that Circuitscape in Julia carried that feature over from Circuitscape.py. I'll double check that Circuitscape has that feature still, then if so, I'll explore adding it to Omniscape. Will post back here with what I find.

vlandau commented 4 years ago

Okay, I've got this working on the vl/fourneighbors branch. Would you mind testing with this branch to confirm it is working for you as expected? Add connect_four_neighbors_only = true to your Omniscape .ini to set the option.

You can install Omniscape from the vl/fourneighbors branch by running to following in Julia (make sure you are using Julia 1.5):

using Pkg; Pkg.add(PackageSpec(name = "Omniscape", rev = "vl/fourneighbors"))

Once we verify everything is working I'll go ahead and merge this into the main branch and issue a new release.

Thanks for the feedback and feature request!

pdtyrrell commented 4 years ago

Great - will try it now and give feedback.

Thanks!

pdtyrrell commented 4 years ago

Working as expected on a small subset of my data, I tested connect_four_neighbors_only = true and connect_four_neighbors_only = false, and both produced results that look as you would expect for the cumulative current maps and the normalized ones dependent on the four or eight neighbors. I'm going to run this on my full dataset now. Thanks again

vlandau commented 4 years ago

Excellent, thanks! Sorry for the late response here. I'll go ahead and merge that pull request. I have one other addition to make to Omniscape.jl before issuing a new release, so expect this to be available in Omniscape v0.5.0 within the next couple of weeks! Until then, you can install directly from the "main" branch to be able to use this functionality.

vlandau commented 4 years ago

This will be released in Omniscape v1.0