From c12d664e76c470a03def7c01f29d9ae6eaa70771 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 02:38:25 +0000 Subject: [PATCH 1/4] Bump indexmap from 2.1.0 to 2.2.1 Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.1.0 to 2.2.1. - [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md) - [Commits](https://github.com/indexmap-rs/indexmap/compare/2.1.0...2.2.1) --- updated-dependencies: - dependency-name: indexmap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69c4504ad..d425174f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "ahash" version = "0.8.6" @@ -118,6 +129,9 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.7", +] [[package]] name = "hashbrown" @@ -125,7 +139,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash", + "ahash 0.8.6", "allocator-api2", "rayon", ] @@ -150,17 +164,17 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "rayon", ] [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", "hashbrown 0.14.3", - "rayon", ] [[package]] @@ -389,7 +403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.1", ] [[package]] @@ -424,8 +438,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ "cfg-if", - "hashbrown 0.14.3", - "indexmap 2.1.0", + "hashbrown 0.12.3", + "indexmap 1.9.3", "indoc", "libc", "memoffset", @@ -595,10 +609,10 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" name = "rustworkx" version = "0.15.0" dependencies = [ - "ahash", + "ahash 0.8.6", "fixedbitset", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 1.9.3", "ndarray", "ndarray-stats", "num-bigint", @@ -621,10 +635,10 @@ dependencies = [ name = "rustworkx-core" version = "0.15.0" dependencies = [ - "ahash", + "ahash 0.8.6", "fixedbitset", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 1.9.3", "num-traits", "petgraph", "priority-queue", From a370a6eca79652b026665469f3bccd24aaefd224 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Mon, 29 Jan 2024 21:39:40 -0500 Subject: [PATCH 2/4] Revert "Bump indexmap from 2.1.0 to 2.2.1" This reverts commit c12d664e76c470a03def7c01f29d9ae6eaa70771. --- Cargo.lock | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d425174f6..69c4504ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,17 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.6" @@ -129,9 +118,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.7", -] [[package]] name = "hashbrown" @@ -139,7 +125,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.6", + "ahash", "allocator-api2", "rayon", ] @@ -164,17 +150,17 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "rayon", ] [[package]] name = "indexmap" -version = "2.2.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.3", + "rayon", ] [[package]] @@ -403,7 +389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.1", + "indexmap 2.1.0", ] [[package]] @@ -438,8 +424,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ "cfg-if", - "hashbrown 0.12.3", - "indexmap 1.9.3", + "hashbrown 0.14.3", + "indexmap 2.1.0", "indoc", "libc", "memoffset", @@ -609,10 +595,10 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" name = "rustworkx" version = "0.15.0" dependencies = [ - "ahash 0.8.6", + "ahash", "fixedbitset", "hashbrown 0.14.3", - "indexmap 1.9.3", + "indexmap 2.1.0", "ndarray", "ndarray-stats", "num-bigint", @@ -635,10 +621,10 @@ dependencies = [ name = "rustworkx-core" version = "0.15.0" dependencies = [ - "ahash 0.8.6", + "ahash", "fixedbitset", "hashbrown 0.14.3", - "indexmap 1.9.3", + "indexmap 2.1.0", "num-traits", "petgraph", "priority-queue", From 0e5aaf7aeb714b15991113522ad3621a52cf3051 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Mon, 29 Jan 2024 21:44:14 -0500 Subject: [PATCH 3/4] Fix build --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69c4504ad..541c71ee1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -389,7 +389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.1", ] [[package]] @@ -425,7 +425,7 @@ checksum = "9a89dc7a5850d0e983be1ec2a463a171d20990487c3cfcd68b5363f1ee3d6fe0" dependencies = [ "cfg-if", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "indoc", "libc", "memoffset", @@ -598,7 +598,7 @@ dependencies = [ "ahash", "fixedbitset", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "ndarray", "ndarray-stats", "num-bigint", @@ -624,7 +624,7 @@ dependencies = [ "ahash", "fixedbitset", "hashbrown 0.14.3", - "indexmap 2.1.0", + "indexmap 2.2.1", "num-traits", "petgraph", "priority-queue", From c711dca393a206150b06d5b32e5fe10aaceae310 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Mon, 29 Jan 2024 21:48:52 -0500 Subject: [PATCH 4/4] Incorporate swap_remove update from indexmap --- src/dag_algo/mod.rs | 4 ++-- src/digraph.rs | 2 +- src/graph.rs | 2 +- src/steiner_tree.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dag_algo/mod.rs b/src/dag_algo/mod.rs index 1d5ce39da..9bda7aec2 100644 --- a/src/dag_algo/mod.rs +++ b/src/dag_algo/mod.rs @@ -748,12 +748,12 @@ pub fn transitive_reduction( descendants.insert(v, dfs); } for desc in &descendants[&v] { - u_nbrs.remove(&NodeIndex::new(desc.1)); + u_nbrs.swap_remove(&NodeIndex::new(desc.1)); } } *check_count.get_mut(&v).unwrap() -= 1; if check_count[&v] == 0 { - descendants.remove(&v); + descendants.swap_remove(&v); } } for v in u_nbrs { diff --git a/src/digraph.rs b/src/digraph.rs index 1afb1ba98..6e8cb53d5 100644 --- a/src/digraph.rs +++ b/src/digraph.rs @@ -2520,7 +2520,7 @@ impl PyDiGraph { let node_index = self.graph.add_node(obj); // Sanitize new node index from user input. - indices_to_remove.remove(&node_index); + indices_to_remove.swap_remove(&node_index); // Determine edges for new node. let mut incoming_edges: Vec<_> = indices_to_remove diff --git a/src/graph.rs b/src/graph.rs index 0ad81c25b..93c5e033a 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -1825,7 +1825,7 @@ impl PyGraph { let node_index = self.graph.add_node(obj); // Sanitize new node index from user input. - indices_to_remove.remove(&node_index); + indices_to_remove.swap_remove(&node_index); // Determine edges for new node. // note: `edges_directed` returns all edges with `i` as diff --git a/src/steiner_tree.rs b/src/steiner_tree.rs index 4c3fde3ff..c8df908da 100644 --- a/src/steiner_tree.rs +++ b/src/steiner_tree.rs @@ -156,8 +156,8 @@ fn fast_metric_edges( let mut paths = DictMap::with_capacity(graph.graph.node_count()); let mut distance: DictMap = dijkstra(&graph.graph, dummy, None, cost_fn, Some(&mut paths))?; - paths.remove(&dummy); - distance.remove(&dummy); + paths.swap_remove(&dummy); + distance.swap_remove(&dummy); graph.graph.remove_node(dummy); // ``partition[u]`` holds the terminal node closest to node ``u``.