diff --git a/raphtory/src/core/storage/raw_edges.rs b/raphtory/src/core/storage/raw_edges.rs index 19a505504..f3fae12a3 100644 --- a/raphtory/src/core/storage/raw_edges.rs +++ b/raphtory/src/core/storage/raw_edges.rs @@ -6,6 +6,7 @@ use crate::{ }, db::api::storage::graph::edges::edge_storage_ops::{EdgeStorageOps, MemEdge}, }; +use itertools::Itertools; use lock_api::ArcRwLockReadGuard; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use raphtory_api::core::{entities::EID, storage::timeindex::TimeIndexEntry}; @@ -18,7 +19,6 @@ use std::{ Arc, }, }; -use itertools::Itertools; #[derive(Debug, Serialize, Deserialize, PartialEq)] pub struct EdgeShard { diff --git a/raphtory/src/db/api/view/graph.rs b/raphtory/src/db/api/view/graph.rs index ac79232f4..b3729fec4 100644 --- a/raphtory/src/db/api/view/graph.rs +++ b/raphtory/src/db/api/view/graph.rs @@ -782,15 +782,23 @@ mod test_materialize { } #[test] - fn test_my_graph() { + fn test_edge_layer_properties() { let g = Graph::new(); - g.add_edge(1, "A", "B", [("greeting", "howdy")], Some("layer 1")).unwrap(); - g.add_edge(2, "A", "B", [("greeting", "ola")], Some("layer 2")).unwrap(); - g.add_edge(2, "A", "B", [("greeting", "hello")], Some("layer 2")).unwrap(); - g.add_edge(3, "A", "B", [("greeting", "namaste")], Some("layer 3")).unwrap(); + g.add_edge(1, "A", "B", [("greeting", "howdy")], Some("layer 1")) + .unwrap(); + g.add_edge(2, "A", "B", [("greeting", "ola")], Some("layer 2")) + .unwrap(); + g.add_edge(2, "A", "B", [("greeting", "hello")], Some("layer 2")) + .unwrap(); + g.add_edge(3, "A", "B", [("greeting", "namaste")], Some("layer 3")) + .unwrap(); let edge_ab = g.edge("A", "B").unwrap(); - let props = edge_ab.properties().iter().map(|(k, v)| (k.to_string(), v.to_string())).collect::>(); + let props = edge_ab + .properties() + .iter() + .map(|(k, v)| (k.to_string(), v.to_string())) + .collect::>(); assert_eq!(props, vec![("greeting".to_string(), "namaste".to_string())]); } } diff --git a/raphtory/src/python/types/macros/trait_impl/edgeviewops.rs b/raphtory/src/python/types/macros/trait_impl/edgeviewops.rs index 278777b82..34324e033 100644 --- a/raphtory/src/python/types/macros/trait_impl/edgeviewops.rs +++ b/raphtory/src/python/types/macros/trait_impl/edgeviewops.rs @@ -32,13 +32,14 @@ macro_rules! impl_edgeviewops { self.$field.nbr() } - /// Explodes an edge and returns all instances it had been updated as seperate edges + /// Explodes returns an edge object for each update within the original edge. fn explode( &self, ) -> <$base_type as $crate::db::api::view::EdgeViewOps<'static>>::Exploded { self.$field.explode() } + /// Explode layers returns an edge object for each layer within the original edge. These new edge object contains only updates from respective layers. fn explode_layers( &self, ) -> <$base_type as $crate::db::api::view::EdgeViewOps<'static>>::Exploded {