Skip to content

Commit 75f13a9

Browse files
authored
fix(lib): fix error caused by seeds not found in network (#26)
Filters out seeds not found in network. The R package does this filter so this was not initially implemented in the library.
1 parent 30e1920 commit 75f13a9

File tree

1 file changed

+1
-1
lines changed
  • webgestalt_lib/src/methods

1 file changed

+1
-1
lines changed

webgestalt_lib/src/methods/nta.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn process_nta(config: NTAConfig) -> Vec<(String, f64)> {
141141
let node_indices: Vec<usize> = config
142142
.seeds
143143
.iter()
144-
.map(|seed| *node_map.get(seed).unwrap())
144+
.filter_map(|seed| node_map.get(seed).cloned())
145145
.collect();
146146
let walk_res = random_walk_probability(
147147
&graph,

0 commit comments

Comments
 (0)