about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander <alexanderkabua@gmail.com>2022-05-19 14:10:45 +0300
committerAlexander <alexanderkabua@gmail.com>2022-05-19 14:10:45 +0300
commit1a7753b350e862b844d3c2fa27766e52f499efc7 (patch)
tree40fab00ac6b98a9f6834e8eb4955408ea409b170 /src
parentef9b4a5d7439d0d23ae4dd6aa8fda54072c9960f (diff)
downloadcorrelation_rust-1a7753b350e862b844d3c2fa27766e52f499efc7.tar.gz
code cleanup
Diffstat (limited to 'src')
-rw-r--r--src/main.rs35
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
+}