Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing rust tests with test_pheno.csv #1

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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