Skip to content

Commit

Permalink
fix(lib): fix error caused by seeds not found in network (#26)
Browse files Browse the repository at this point in the history
Filters out seeds not found in network. The R package does this filter so this was not initially
implemented in the library.
  • Loading branch information
iblacksand authored Jun 20, 2024
1 parent 30e1920 commit 75f13a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion webgestalt_lib/src/methods/nta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub fn process_nta(config: NTAConfig) -> Vec<(String, f64)> {
let node_indices: Vec<usize> = config
.seeds
.iter()
.map(|seed| *node_map.get(seed).unwrap())
.filter_map(|seed| node_map.get(seed).cloned())
.collect();
let walk_res = random_walk_probability(
&graph,
Expand Down

0 comments on commit 75f13a9

Please sign in to comment.