Skip to content

Commit

Permalink
fix: push nan on parse error for labeled matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
zietzm committed Jul 22, 2024
1 parent 91bf741 commit aa47ebd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "igwas"
version = "1.0.6"
version = "1.0.7"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
5 changes: 4 additions & 1 deletion src/io/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ pub fn read_labeled_matrix(filename: &str) -> Result<LabeledMatrix> {
if i == 0 {
row_labels.push(value.to_string());
} else {
matrix.push(value.parse::<f32>().unwrap());
match value.parse::<f32>() {
Ok(v) => matrix.push(v),
Err(_) => matrix.push(f32::NAN),
}
}
}
}
Expand Down

0 comments on commit aa47ebd

Please sign in to comment.