Skip to content

Commit

Permalink
put back the iterator loading bars when calling from python
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmurariu committed Jul 26, 2024
1 parent a467078 commit 7f086c0
Show file tree
Hide file tree
Showing 13 changed files with 326 additions and 106 deletions.
58 changes: 3 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ debug = true

[workspace.dependencies]
#[public-storage]
# pometry-storage = { version = ">=0.8.1", path = "pometry-storage" }
pometry-storage = { version = ">=0.8.1", path = "pometry-storage" }
#[private-storage]
pometry-storage = { path = "pometry-storage-private", package = "pometry-storage-private" }
# pometry-storage = { path = "pometry-storage-private", package = "pometry-storage-private" }
async-graphql = { version = "7.0.5", features = ["dynamic-schema"] }
async-graphql-poem = "7.0.5"
dynamic-graphql = "0.9.0"
Expand Down
2 changes: 1 addition & 1 deletion raphtory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ python = [
"polars-arrow?/compute",
"raphtory-api/python",
"dep:rpds",
"dep:kdam",
"kdam?/notebook"
]

Expand All @@ -146,7 +147,6 @@ arrow = [
"dep:polars-arrow",
"dep:polars-parquet",
"polars-parquet?/compression",
"dep:kdam",
]

proto = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ mod lpa_tests {
.iter()
.map(|n_set| n_set.iter().map(|n| n.node).collect::<Vec<_>>())
.collect::<Vec<_>>();
println!("{:?}", ids);

let expected = vec![
HashSet::from([
Expand Down
2 changes: 0 additions & 2 deletions raphtory/src/algorithms/components/connected_components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ mod cc_test {

let vs = vs.into_iter().unique().collect::<Vec<u64>>();

// let smallest = vs.iter().min().unwrap();

let first = vs[0];

// pairs of nodes from vs one after the next
Expand Down
8 changes: 0 additions & 8 deletions raphtory/src/core/entities/graph/logical_to_physical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::core::utils::errors::{GraphError, MutateGraphError};
#[derive(Debug, Deserialize, Serialize)]
enum Map {
U64(FxDashMap<u64, VID>),
I64(FxDashMap<i64, VID>),
Str(FxDashMap<String, VID>),
}

Expand All @@ -29,13 +28,6 @@ impl Map {
_ => None,
}
}

fn as_i64(&self) -> Option<&FxDashMap<i64, VID>> {
match self {
Map::I64(map) => Some(map),
_ => None,
}
}
}

impl Default for Map {
Expand Down
1 change: 1 addition & 0 deletions raphtory/src/db/api/view/internal/core_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ pub trait CoreGraphOps {
}

/// Returns the type of node
#[inline]
fn node_type(&self, v: VID) -> Option<ArcStr> {
let type_id = self.node_type_id(v);
self.node_meta().get_node_type_name_by_id(type_id)
Expand Down
3 changes: 1 addition & 2 deletions raphtory/src/db/api/view/serialise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,9 @@ impl<'graph, G: GraphViewOps<'graph>> StableEncoder for G {
graph.nodes = self
.nodes()
.into_iter()
.map(|n: crate::db::graph::node::NodeView<G>| {
.map(|n| {
let gid = n.id();
let vid = n.node;
let node = self.core_node_entry(vid);
let proto_gid = match gid {
GID::U64(g) => Gid {
gid: Some(gid::Gid::GidU64(g)),
Expand Down
1 change: 0 additions & 1 deletion raphtory/src/db/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod api;
pub mod graph;
// pub(crate) mod internal;
pub mod task;
pub mod utils;
7 changes: 7 additions & 0 deletions raphtory/src/io/arrow/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ pub(crate) struct DFView {
}

impl DFView {
pub(crate) fn get_inner_size(&self) -> usize {
if self.arrays.is_empty() || self.arrays[0].is_empty() {
return 0;
}
self.arrays[0][0].len()
}

pub fn check_cols_exist(&self, cols: &[&str]) -> Result<(), GraphError> {
let non_cols: Vec<&&str> = cols
.iter()
Expand Down
Loading

0 comments on commit 7f086c0

Please sign in to comment.