1#![feature(iter_next_chunk)]
2#![feature(absolute_path)]
3#![feature(path_file_prefix)]
4
5pub mod helper_funcs;
6mod spectra;
7mod spectrum;
8use helper_funcs::handle_one_file;
9
10use spectra::Spectra;
11use std::error::Error;
12use std::path:: Path;
13
14pub fn handle_many_spectra(
23 path: &str,
24 export_path: &str,
25) -> Result<String, Box<dyn std::error::Error>> {
26 let spectra = Spectra::build_from_path(path, export_path)?;
27 spectra.export_all();
28 Ok(String::from(path))
29}
30
31pub fn handle_single_spectrum(
40 filepath: &str,
41 savepath: &str,
42) -> Result<String, Box<dyn std::error::Error>> {
43 let mut spectrum = handle_one_file(filepath, None)?;
44 spectrum.to_csv(savepath)?;
45 Ok(String::from(filepath))
46}