From 03aaa2787d8a4c017f863573d8633e990b4288de Mon Sep 17 00:00:00 2001 From: angelip2303 Date: Wed, 24 May 2023 12:35:35 +0200 Subject: [PATCH] getting ready for version 0.0.7 --- Cargo.toml | 2 +- README.md | 2 +- src/graph_frame.rs | 6 +++--- src/pregel.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c67bbd2..26483d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pregel-rs" -version = "0.0.6" +version = "0.0.7" authors = [ "Ángel Iglesias Préstamo " ] description = "A Graph library written in Rust for implementing your own algorithms in a Pregel fashion" documentation = "https://docs.rs/crate/pregel-rs/latest" diff --git a/README.md b/README.md index fc809b4..f487ed4 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ of your project. You can add the following line to your `Cargo.toml` file: ```toml [dependencies] -pregel-rs = "0.0.5" +pregel-rs = "0.0.7" ``` 4. _Implement your graph algorithm_: Now you can start implementing your graph diff --git a/src/graph_frame.rs b/src/graph_frame.rs index 7bbf5c8..ff0882a 100644 --- a/src/graph_frame.rs +++ b/src/graph_frame.rs @@ -153,14 +153,14 @@ impl GraphFrame { /// `GraphFrame` struct. pub fn from_edges(edges: DataFrame) -> Result { let srcs = edges - .clone() + .clone() // this is because cloning a DataFrame is cheap .lazy() .select([col(Src.as_ref()).alias(Id.as_ref())]); let dsts = edges - .clone() + .clone() // this is because cloning a DataFrame is cheap .lazy() .select([col(Dst.as_ref()).alias(Id.as_ref())]); - let vertices = concat([srcs, dsts], false, true)? + let vertices = concat([srcs, dsts], true, true)? .unique( Some(vec![Id.as_ref().to_string()]), UniqueKeepStrategy::First, diff --git a/src/pregel.rs b/src/pregel.rs index 7aab1b9..adb331f 100644 --- a/src/pregel.rs +++ b/src/pregel.rs @@ -796,7 +796,7 @@ impl<'a> Pregel<'a> { // compute the triplets of the graph, which are used to send messages to the neighboring // vertices of each vertex in the graph. For us to do so, we select all the columns of the // graph edges and we prefix them with the `Edge` column name. - let edges = self + let edges = &self .graph .edges .lazy() @@ -823,8 +823,8 @@ impl<'a> Pregel<'a> { // greater than the maximum number of iterations set by the user at the initialization of // the model (see the `Pregel::new` method). We start by setting the number of iterations to 1. let mut iteration = 1; - // TODO: check that nodes are not halted. while iteration <= self.max_iterations { + // TODO: check that nodes are not halted. // We create a DataFrame that contains the triplets of the graph. Those triplets are // computed by joining the `current_vertices` DataFrame with the `edges` DataFrame // first, and with the `current_vertices` second. The first join is performed on the `src` @@ -836,7 +836,7 @@ impl<'a> Pregel<'a> { .to_owned() .select([all().prefix(&format!("{}.", Column::Src.as_ref()))]) .inner_join( - edges.to_owned(), + edges.to_owned().select([all()]), Column::src(Column::Id), // src column of the current_vertices DataFrame Column::edge(Column::Src), // src column of the edges DataFrame )