Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99302a3

Browse files
authored
Vl/fix deps (#7)
* update deps to new Graphs.jl package* fix Graphs dep in deps section* more fixes to Graphs dep, narrow type enforcement in a function due to errors* test on latest julia version
1 parente151233 commit99302a3

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast:false
1818
matrix:
1919
version:
20-
-'1.5'
20+
-'1.7'
2121
os:
2222
-ubuntu-latest
2323
-macos-latest

‎Project.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version = "0.0.1"
77
ArchGDAL ="c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
88
GeoData ="9b6fcbb8-86d6-11e9-1ce7-23a6bb139a78"
99
GeoDataFrames ="62cb38b5-d8d2-4862-a48e-6a340996859f"
10-
LightGraphs ="093fc24a-ae57-5d10-9952-331d41423f4d"
10+
Graphs ="86223c79-3864-5bf0-83f7-82e725a168b6"
1111
ProgressMeter ="92933f4c-e287-5a05-a399-4b506db050ca"
1212
SimpleWeightedGraphs ="47aef6b3-ad0c-573a-a1e2-d07658019622"
1313
StatsBase ="2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
@@ -16,6 +16,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1616
[compat]
1717
ArchGDAL ="0.5"
1818
GeoData ="0.3"
19-
LightGraphs ="1.3"
19+
Graphs ="1.6"
2020
SimpleWeightedGraphs ="1.1"
2121
julia ="1.5"

‎src/SpatialGraphs.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module SpatialGraphs
2-
usingLightGraphs, SimpleWeightedGraphs, StatsBase,
2+
usingGraphs, SimpleWeightedGraphs, StatsBase,
33
Base.Threads, ProgressMeter, GeoData
44
using ArchGDAL: createlinestring
55

‎src/paths.jl‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
functioncost_distance(g::AbstractSimpleWeightedGraph,
1+
functioncost_distance(g::SimpleWeightedGraph,
22
nodemap::Union{Matrix{Int}, GeoData.GeoArray},
33
node_ids::Union{Int, Array{Int, 1}};# will report lowest CD to get to any of these, Number or Vector
44
cost_threshold::Real=Inf,
@@ -15,7 +15,7 @@ function cost_distance(g::AbstractSimpleWeightedGraph,
1515
end
1616
end
1717

18-
functionpathstate_to_array(cdist::LightGraphs.AbstractPathState,
18+
functionpathstate_to_array(cdist::Graphs.AbstractPathState,
1919
nodemap::Matrix{Int};
2020
cost_threshold::Real=Inf)
2121
cd_array=fill(-1.,size(nodemap))
@@ -26,7 +26,7 @@ function pathstate_to_array(cdist::LightGraphs.AbstractPathState,
2626
cd_array
2727
end
2828

29-
functionpathstate_to_geoarray(cdist::LightGraphs.AbstractPathState,
29+
functionpathstate_to_geoarray(cdist::Graphs.AbstractPathState,
3030
nodemap::GeoData.GeoArray;
3131
cost_threshold::Real=Inf)
3232
cd_array=pathstate_to_array(cdist,
@@ -41,8 +41,8 @@ function pathstate_to_geoarray(cdist::LightGraphs.AbstractPathState,
4141
end
4242

4343
functionsample_node_pairs(sample_weights::Matrix{T}where T<:Real,# Matrix of weights
44-
nodemap::Matrix{Int},# Matrix of node_ids to sample
45-
n_pairs::Int)
44+
nodemap::Matrix{Int},# Matrix of node_ids to sample
45+
n_pairs::Int)
4646
weight=Float64.(deepcopy(sample_weights))
4747
# Set weights (habitat) to 0 for non-nodes
4848
weight[nodemap.==0] .=0
@@ -77,7 +77,7 @@ function sample_node_pairs(sample_weights::GeoData.GeoArray,
7777
return samples
7878
end
7979

80-
functionleast_cost_path(g::AbstractGraph,
80+
functionleast_cost_path(g::SimpleWeightedGraph,
8181
start::Union{Int, Vector{T} where T <: Int},
8282
destination::Int;
8383
dist_fun::Function= dijkstra_shortest_paths)

‎test/runtests.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Test, SpatialGraphs,LightGraphs, GeoData, ArchGDAL
1+
using Test, SpatialGraphs,Graphs, GeoData, ArchGDAL
22

33
url_base="https://raw.githubusercontent.com/Circuitscape/datasets/main/"
44
# Download the NLCD tile used to create the resistance surface and load it
@@ -85,7 +85,7 @@ end
8585
@test ll_dims[2]==dims(garray)[2]
8686
end
8787

88-
#LightGraphs and SimpleWeightedGraphs presumably already test for correctness of
88+
#Graphs and SimpleWeightedGraphs presumably already test for correctness of
8989
# methods, so above tests to confirm graphs are constructed properly are most
9090
# important
9191
@testset"paths"begin

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp