Circuitscape / Circuitscape.jl

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

Included pairs file throw no method isless() #423

Closed laurenthuber closed 2 months ago

laurenthuber commented 2 months ago

Hello, I'm using CircuitScape 5.13.3 with Julia 1.11.0. I'm running a task with pairwise mode with the attached ini. CS_data.zip The error seems to deal with the included pairs file. I tried keeping only the 3 first pairs listed and it work but not with the full 1346 lines txt file (attached). Is there something wrong with the format of this text file?

Thanks a lot for your help. Laurent

ERROR: MethodError: no method matching isless(::SubString{String}, ::Int64)
The function `isless` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  isless(::Missing, ::Any)
   @ Base missing.jl:87
  isless(::Any, ::Missing)
   @ Base missing.jl:88
  isless(::Static.StaticInteger{X}, ::Real) where X
   @ Static ~/.julia/packages/Static/1Mvph/src/Static.jl:472
  ...

Stacktrace:
  [1] lt(o::Base.Order.ForwardOrdering, a::SubString{String}, b::Int64)
    @ Base.Order ./ordering.jl:118
  [2] partition!(t::Vector{Any}, lo::Int64, hi::Int64, offset::Int64, o::Base.Order.ForwardOrdering, v::Vector{Any}, rev::Bool, pivot_dest::Vector{Any}, pivot_index_offset::Int64)
    @ Base.Sort ./sort.jl:1086
  [3] _sort!(v::Vector{Any}, a::Base.Sort.ScratchQuickSort{Missing, Missing, Base.Sort.InsertionSortAlg}, o::Base.Order.ForwardOrdering, kw::@NamedTuple{scratch::Nothing, lo::Int64, hi::Int64}; t::Nothing, offset::Nothing, swap::Bool, rev::Bool)
    @ Base.Sort ./sort.jl:1117
  [4] _sort!
    @ ./sort.jl:1103 [inlined]
  [5] _sort!
    @ ./sort.jl:1360 [inlined]
  [6] _sort!
    @ ./sort.jl:770 [inlined]
  [7] _sort!
    @ ./sort.jl:721 [inlined]
  [8] _sort!(v::Vector{Any}, a::Base.Sort.Small{10, Base.Sort.InsertionSortAlg, Base.Sort.IEEEFloatOptimization{Base.Sort.IsUIntMappable{Base.Sort.Small{40, Base.Sort.InsertionSortAlg, Base.Sort.CheckSorted{Base.Sort.ComputeExtrema{Base.Sort.ConsiderCountingSort{Base.Sort.CountingSort, Base.Sort.ConsiderRadixSort{Base.Sort.RadixSort, Base.Sort.Small{80, Base.Sort.InsertionSortAlg, Base.Sort.ScratchQuickSort{Missing, Missing, Base.Sort.InsertionSortAlg}}}}}}}, Base.Sort.StableCheckSorted{Base.Sort.ScratchQuickSort{Missing, Missing, Base.Sort.InsertionSortAlg}}}}}, o::Base.Order.ForwardOrdering, kw::@NamedTuple{scratch::Nothing, lo::Int64, hi::Int64})
    @ Base.Sort ./sort.jl:792
  [9] _sort!
    @ ./sort.jl:737 [inlined]
 [10] _sort!
    @ ./sort.jl:676 [inlined]
 [11] _sort!
    @ ./sort.jl:554 [inlined]
 [12] #sort!#32
    @ ./sort.jl:1694 [inlined]
 [13] sort!(v::Vector{Any})
    @ Base.Sort ./sort.jl:1687
 [14] read_included_pairs(V::Type{Int64}, filename::String)
    @ Circuitscape ~/.julia/packages/Circuitscape/FpvWC/src/io.jl:348
 [15] load_raster_data(T::Type, V::Type, cfg::Dict{String, String})
    @ Circuitscape ~/.julia/packages/Circuitscape/FpvWC/src/io.jl:477
 [16] raster_pairwise(T::Type, V::Type, cfg::Dict{String, String})
    @ Circuitscape ~/.julia/packages/Circuitscape/FpvWC/src/raster/pairwise.jl:18
 [17] _compute(T::Type, V::Type, cfg::Dict{String, String})
    @ Circuitscape ~/.julia/packages/Circuitscape/FpvWC/src/run.jl:43
 [18] macro expansion
    @ ./timing.jl:418 [inlined]
 [19] compute(path::String)
    @ Circuitscape ~/.julia/packages/Circuitscape/FpvWC/src/run.jl:31
 [20] top-level scope
    @ REPL[2]:1

Circuitscape and Julia version Circuitscape v5.13.3 and Julia v1.11.0

laurenthuber commented 2 months ago

Ok, there was a character "e" in one id strangely. Sorry for bothering.