Skip to content

Commit

Permalink
getting ready for version 0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
angelip2303 committed May 24, 2023
1 parent 62d04c1 commit 03aaa27
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pregel-rs"
version = "0.0.6"
version = "0.0.7"
authors = [ "Ángel Iglesias Préstamo <[email protected]>" ]
description = "A Graph library written in Rust for implementing your own algorithms in a Pregel fashion"
documentation = "https://docs.rs/crate/pregel-rs/latest"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/graph_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ impl GraphFrame {
/// `GraphFrame` struct.
pub fn from_edges(edges: DataFrame) -> Result<Self> {
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,
Expand Down
6 changes: 3 additions & 3 deletions src/pregel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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`
Expand All @@ -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
)
Expand Down

0 comments on commit 03aaa27

Please sign in to comment.