MCPcopy Create free account
hub / github.com/Pometry/Raphtory / find_nodes

Method find_nodes

raphtory/src/python/graph/views/graph_view.rs:285–302  ·  view source on GitHub ↗
(&self, properties_dict: HashMap<String, Prop>)

Source from the content-addressed store, hash-verified

283 /// list[Node]: the nodes that match the properties name and value
284 #[pyo3(signature = (properties_dict))]
285 pub fn find_nodes(&self, properties_dict: HashMap<String, Prop>) -> Vec<PyNode> {
286 let iter = self.nodes().into_iter().par_bridge();
287 let out = iter
288 .filter(|n| {
289 let props = n.properties();
290 properties_dict.iter().all(|(k, v)| {
291 if let Some(prop) = props.get(k) {
292 &prop == v
293 } else {
294 false
295 }
296 })
297 })
298 .map(PyNode::from)
299 .collect::<Vec<_>>();
300
301 out
302 }
303
304 /// Gets the nodes in the graph
305 ///

Callers 1

test_node_propertiesFunction · 0.80

Calls 8

into_iterMethod · 0.45
nodesMethod · 0.45
mapMethod · 0.45
filterMethod · 0.45
propertiesMethod · 0.45
allMethod · 0.45
iterMethod · 0.45
getMethod · 0.45

Tested by 1

test_node_propertiesFunction · 0.64