Skip to content

Commit

Permalink
Merge pull request #1 from jeffersonfparil/dev
Browse files Browse the repository at this point in the history
fixing rust tests with test_pheno.csv
  • Loading branch information
jeffersonfparil authored Jan 8, 2024
2 parents f177ba5 + 8bafd3e commit 49d0a57
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/rust/src/aldknni.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ fn find_k_nearest_neighbours(
// if max_pool_dist > 1.0, then we assume this specifies the number of pools to include and not the minimum distance
let max_pool_dist = if *max_pool_dist > 1.0 {
// The distance matrix do not have missing values, if the distance cannot be calculated then the default distance is set to the maximum which is 1.00.
let mut vec_dist = dist.to_owned().into_iter().filter(|&x| !x.is_nan()).collect::<Vec<f64>>();
let mut vec_dist = dist
.to_owned()
.into_iter()
.filter(|&x| !x.is_nan())
.collect::<Vec<f64>>();
// let mut vec_dist = dist.to_vec();
// println!("dist={:?}", dist);
// println!("0.0/0.0={:?}", 0.0/0.0);
Expand Down Expand Up @@ -617,7 +621,7 @@ mod tests {
test: "load".to_owned(),
};
let file_phen = FilePhen {
filename: "./tests/test.csv".to_owned(),
filename: "./tests/test_pheno.csv".to_owned(),
delim: ",".to_owned(),
names_column_id: 0,
sizes_column_id: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/filter_missing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ mod tests {
test: "load".to_owned(),
};
let file_phen = FilePhen {
filename: "./tests/test.csv".to_owned(),
filename: "./tests/test_pheno.csv".to_owned(),
delim: ",".to_owned(),
names_column_id: 0,
sizes_column_id: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/mvi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ mod tests {
test: "load".to_owned(),
};
let file_phen = FilePhen {
filename: "./tests/test.csv".to_owned(),
filename: "./tests/test_pheno.csv".to_owned(),
delim: ",".to_owned(),
names_column_id: 0,
sizes_column_id: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/optim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ mod tests {
test: "load".to_owned(),
};
let file_phen = FilePhen {
filename: "./tests/test.csv".to_owned(),
filename: "./tests/test_pheno.csv".to_owned(),
delim: ",".to_owned(),
names_column_id: 0,
sizes_column_id: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/phen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ mod tests {
#[test]
fn test_phen() {
let file_phen = FilePhen {
filename: "./tests/test.csv".to_owned(),
filename: "./tests/test_pheno.csv".to_owned(),
delim: ",".to_owned(),
names_column_id: 0,
sizes_column_id: 1,
Expand Down

0 comments on commit 49d0a57

Please sign in to comment.