Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include pairs bug #132

Closed
mcombs33 opened this issue Jul 12, 2018 · 24 comments
Closed

Include pairs bug #132

mcombs33 opened this issue Jul 12, 2018 · 24 comments

Comments

@mcombs33
Copy link

Hello,

Thanks for the work on the new Circuitscape in Julia!

I am attempting to use the "include pairs" functionality in Julia (specifying to include paris within 1000m in this case) and the output resistance matrix appears to show that many of the pairs that should be included were not calculated, and some pairs that should not have been included were calculated.

To confirm this, I ran circuitscape using the GUI app with my desired settings, which resulted in a correct resistance matrix (all pairs that should be calculated were, with no extras). Then I used the .ini file created by the GUI run to complete an identical run in Julia (only changing the output and log names), but the output resistance matrix had many missing pairs.

I am attaching files below, all with .txt extension to support upload:

  1. ascii layer used in run
  2. resistance file from the Julia run
  3. resistance file from the GUI run
  4. include pairs distance matrix
  5. .ini file used to run julia

Thanks for your help with this issue!
Matt

aes_recl.txt
AES_1to1000_julia_resistances.txt
AES_1to1000_resistances.txt
n196utm_dist_1to1000.txt
AES_1to1000_julia.txt

@ranjanan
Copy link
Member

Hi @mcombs33, sorry for the late reply. I see that you've used a point file as well which is in your INI (rats_n262_....txt). Would you mind attaching that too? Ideally I'm looking to reproduce your Circuitscape run on my computer and then looking into it from there. Thank you!

@ranjanan
Copy link
Member

I wonder if this is related to #122

@mcombs33
Copy link
Author

Here is the ascii for the sample points. Again, with .asc changed to .txt for uploading

This may be related to that #122 issue, but reading through, there doesn't seem to be a solution proposed. None of these samples should be on top of one another, with only one sample per pixel.

Thanks for the help.

rats_n262_utm_ascii_3.txt

@rmarrotte
Copy link

Hi, this is still an issue. Points that are on top of each other seem to get a 0. But it seems that any pair that the first point has is just set to -1. You'll see in this example that point 1 has 7 pairs, but only the last one gets processed. Every other pair does get calculated though.
test_run.zip

@kearney-sp
Copy link

Has there been any progress on this issue? I am having the same problem (only with 'excluded' pairs). Runs fine in the GUI (4.0.5) with identified pairs excluded. When I export the .ini and run with Julia, it will run but output sets all pairs to -1.0. If I ignore the excluded pairs by setting 'use_included_pairs = False' it runs fine in Julia with a logical output, but this is not the desired analysis. Many thanks!

@ranjanan
Copy link
Member

ranjanan commented Jan 6, 2019

Hi @kearney-sp , I've picked this up again and I'm trying to fix it. Will provide an update in the next few days.

@kearney-sp
Copy link

kearney-sp commented Jan 7, 2019

Hi @ranjanan , great, thanks for the update! An update on my end: I was able to get the 'use_included_pairs = True' to work as expected on a test set with a .txt file of included pairs (headers 'mode' and 'include'), but it still would not work with a file of excluded pairs (headers 'mode' and 'exclude').

Additionally, when I attempted to process my full dataset using the same .ini setup with an 'include' list, I am getting strange results. First, the total number of pair solves seems arbitrary and is not what is expected. The process usually begins to run (I have tried multiple) and then at some point I get an error message, but the process continues to run. However, it is apparently no longer in parallel as the solving is serial and CPU use drops (may be related to Issue #165 ) and then, usually once it has finished the most recently scheduled pairs, it just hangs altogether and stops processing (it finishes solving a pair, and then nothing - no error message and no completion message, could be relate to Issue #109 ?)

Thanks a bunch for your work to convert this to Julia! Looks to be very promising.

I'm happy to provide more info if it is useful. Here is an example of an error message:

ERROR: On worker 2:
KeyError: key (133, 274) not found
getindex at .\dict.jl:478
f at C:\Users\spkearne.julia\packages\Circuitscape\coCa3\src\core.jl:161
#81 at C:\Users\spkearne.julia\packages\Circuitscape\coCa3\src\core.jl:225
#112 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\process_messages.jl:269
run_work_thunk at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\process_messages.jl:56
macro expansion at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\process_messages.jl:269 [inlined]
#111 at .\task.jl:259

@ranjanan
Copy link
Member

ranjanan commented Jan 9, 2019

@kearney-sp thanks for testing this out. Could you check out the fixes that I have pushed on the branch RA/include? You can do so by doing: ] add Circuitscape#RA/include cc: @mcombs33 @rmarrotte

@kearney-sp
Copy link

@ranjanan I tried it out and it appears to be working with with a .txt file of included pairs (headers 'mode' and 'include') on the full dataset. I will let you know if I encounter an error. It still does not appear to work with 'exclude', but this is not such a big deal since one can always use define an included pair instead.

Many thanks!

@ranjanan
Copy link
Member

ranjanan commented Jan 9, 2019

@kearney-sp could you please attach an example of it not working with exclude please? I just tested it on my end and it worked.

@ranjanan
Copy link
Member

ranjanan commented Jan 9, 2019

@rmarrotte would you be okay if I used test_run.zip as a test for this?

@kearney-sp
Copy link

kearney-sp commented Jan 9, 2019 via email

@ranjanan
Copy link
Member

ranjanan commented Jan 9, 2019

@kearney-sp I pushed a fix for exclude mode on the same branch. Could you check it now please?

@kearney-sp
Copy link

I ran : ] add Circuitscape#RA/include again and restarted Julia. Tried again and same result - all -1.0's. Did you get my test set to work on your end with 'exclude'? Perhaps there is an issue i have overlooked with how my data is setup...

@ranjanan
Copy link
Member

Oh my apologies, could you restart julia and try?

@kearney-sp
Copy link

No luck. Tried restarting (and reloading the #RA/include) with the same results - all -1.0s.

@ranjanan
Copy link
Member

Ok. I pushed what I thought would be a fix, but this could well be a new issue. Let me check.

@ranjanan
Copy link
Member

@kearney-sp I just ran the older software on your problem with "exclude_pairs.txt" and it calculated the resistance for points (1,2) even though you said asked for it to be excluded on the file. The output looked like it ignored the exclude pairs list altogether. Could you tell me why this is desired behaviour? Thanks in advance.

@kearney-sp
Copy link

Hi @ranjanan . I'm not sure I understand your question. The desired behaviour is that whichever pairs are listed in the "exclude_pairs.txt" are NOT included in the analysis. Essentially the opposite of listing the pairs to be included. When I run the test data I sent you on the Circuitscape 4 GUI, it behaves as expected, by excluding the pairs listed when the first line of the .txt file reads "mode exclude".

Let me know if I have misunderstood your question!

@ranjanan
Copy link
Member

Hi @kearney-sp, would you mind attaching the output of the GUI and the Julia version please? I suspect Circuitscape master (which is what I'm running) might be giving a different answer.

@ranjanan
Copy link
Member

Actually I just ran it on my laptop and I have the answer:

out_resistances.txt

Is this the same answer you are getting? My question is: when you have listed these pairs to be excluded from the computation, shouldn't there be -1s at those corresponding outputs? For example, as mentioned in exclude_pairs.txt, the first pair to be excluded is (1,2) whereas in this output there is a resistance value computed there. Isn't this undesired behaviour?

Does my question now make sense?

@kearney-sp
Copy link

kearney-sp commented Jan 16, 2019 via email

@ranjanan
Copy link
Member

I am closing this for now, but please open another issue with expected output. Thank you! Fixed by #167

@wpeterman
Copy link

Using v.5.5.3+, I'm getting errors when using the 'include_pairs_file". It appears that the output matrix is 1 column and row smaller when run the pairs file. ZIP file with example files attached.
test.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants