#![allow(dead_code)]
use elasticrab::Atom;
pub const DATA: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data");
pub fn read_ca_pdb(name: &str) -> Vec<Atom> {
std::fs::read_to_string(format!("{DATA}/{name}"))
.unwrap()
.lines()
.filter(|l| l.starts_with("ATOM"))
.map(|l| {
let f = |a: usize, b: usize| l[a..b].trim().parse::<f64>().unwrap();
Atom {
position: [f(30, 38), f(38, 46), f(46, 54)],
mass: 1.0,
}
})
.collect()
}
pub fn read_eigenvalues(name: &str) -> Vec<f64> {
std::fs::read_to_string(format!("{DATA}/{name}"))
.unwrap()
.lines()
.map(|l| l.split_whitespace().nth(1).unwrap().parse().unwrap())
.collect()
}