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

Bump to Dictionaries v0.4 #48

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NamedGraphs"
uuid = "678767b0-92e7-4007-89e4-4527a8725b19"
authors = ["Matthew Fishman <[email protected]> and contributors"]
version = "0.1.18"
version = "0.1.19"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand All @@ -18,7 +18,7 @@ SymRCM = "286e6d88-80af-4590-acc9-0001b223b9bd"

[compat]
AbstractTrees = "0.3, 0.4"
Dictionaries = "0.3"
Dictionaries = "0.4"
Graphs = "1.8"
GraphsFlows = "0.1.1"
LinearAlgebra = "1.7"
Expand Down
4 changes: 0 additions & 4 deletions src/Dictionaries/dictionary.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Workaround for: https://github.com/andyferris/Dictionaries.jl/issues/98
# TODO: Move to Dictionaries.jl file in NamedGraphs.jl
copy_keys_values(d::Dictionary) = Dictionary(copy(d.indices), copy(d.values))

# Dictionaries.jl patch
# TODO: delete once fixed in Dictionaries.jl
# TODO: Move to Dictionaries.jl file in NamedGraphs.jl
Expand Down
6 changes: 3 additions & 3 deletions src/Graphs/partitionedgraphs/partitionedgraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ function copy(pg::PartitionedGraph)
return PartitionedGraph(
copy(unpartitioned_graph(pg)),
copy(partitioned_graph(pg)),
copy_keys_values(partitioned_vertices(pg)),
copy_keys_values(partitionvertex(pg)),
copy(partitioned_vertices(pg)),
copy(partitionvertex(pg)),
)
end

Expand Down Expand Up @@ -138,7 +138,7 @@ end
### PartitionedGraph Specific Functions
function induced_subgraph(pg::PartitionedGraph, vertices::Vector)
sub_pg_graph, _ = induced_subgraph(unpartitioned_graph(pg), vertices)
sub_partitioned_vertices = copy_keys_values(partitioned_vertices(pg))
sub_partitioned_vertices = copy(partitioned_vertices(pg))
for pv in NamedGraphs.vertices(partitioned_graph(pg))
vs = intersect(vertices, sub_partitioned_vertices[pv])
if !isempty(vs)
Expand Down
2 changes: 1 addition & 1 deletion src/distances_and_capacities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function _symmetrize(dist)
end

function _symmetrize(dist::AbstractDictionary)
symmetrized_dist = copy_keys_values(dist)
symmetrized_dist = copy(dist)
for k in keys(dist)
insert!(symmetrized_dist, reverse(k), dist[k])
end
Expand Down
5 changes: 3 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
GraphsFlows = "06909019-6f44-4949-96fc-b9d9aaa02889"
KaHyPar = "2a6221f6-aa48-11e9-3542-2d9e0ef01880"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"
KaHyPar = "2a6221f6-aa48-11e9-3542-2d9e0ef01880"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
Loading