diff options
| author | Alexander <alexanderkabua@gmail.com> | 2022-05-19 14:10:45 +0300 |
|---|---|---|
| committer | Alexander <alexanderkabua@gmail.com> | 2022-05-19 14:10:45 +0300 |
| commit | 1a7753b350e862b844d3c2fa27766e52f499efc7 (patch) | |
| tree | 40fab00ac6b98a9f6834e8eb4955408ea409b170 /src | |
| parent | ef9b4a5d7439d0d23ae4dd6aa8fda54072c9960f (diff) | |
| download | correlation_rust-1a7753b350e862b844d3c2fa27766e52f499efc7.tar.gz | |
code cleanup
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/src/main.rs b/src/main.rs index 781ee2b..6ff1439 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,34 +1,15 @@ use std::env; -use correlation_rust::parser; -use correlation_rust::correlations; +use correlation_rust::analysis::Analysis; fn main () { - - - let json_file = match env::args().nth(1){ + match env::args().nth(1){ Some(tmp_file) => { - let results = parser::JsonData::new(&tmp_file); - - - let parsed_x_vals:Vec<f64> = results.x_vals.split(",").map(|f|f.trim().parse::<f64>().unwrap()).collect(); - - - - let computation = correlations::Compute::new( - ',', - "pearson", - &results.file_path, - &parsed_x_vals - - ).compute(); - - //println!("{:?}",computation); - + + match Analysis::compute(&tmp_file){ + Ok(results) => println!("{:?}",results), + Err(err) => println!("{:?}",err) + } } None => panic!("expected an arugment for the json file") }; - - - - -} \ No newline at end of file +} |
