Skip to content

Commit

Permalink
Update elapsed time threshold in feature.rs and add debug information…
Browse files Browse the repository at this point in the history
… in core.rs
  • Loading branch information
khb7840 committed Mar 7, 2024
1 parent 904f32f commit 5ea49a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub fn get_geometric_hash_from_structure(structure: &CompactStructure, hash_type
hash_vec.push(hash);
}
let elapsed = start.elapsed().as_secs_f64();
if elapsed > 60.0 {
if elapsed > 30.0 {
eprintln!("Elapsed time: {:.2} seconds", elapsed);
// Print length of hash_vec
eprintln!("Length of hash_vec: {}", hash_vec.len());
Expand Down
16 changes: 16 additions & 0 deletions src/structure/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ pub struct CompactStructure {

impl CompactStructure {
pub fn build(origin: &Structure) -> CompactStructure {
let start = std::time::Instant::now();
// Store only backbone atoms
let model = &origin.atom_vector;

Expand Down Expand Up @@ -203,6 +204,21 @@ impl CompactStructure {
_ => (),
}
}
let elapsed = start.elapsed().as_secs_f64();
if elapsed > 60.0 {
// Print all information available
eprintln!("Elapsed time: {:.2} seconds", elapsed);
eprintln!("Origin info: {:?}", origin);
eprintln!("Total {} atoms", origin.num_atoms);
eprintln!("Atom: {:?}", model.atom_name);

eprintln!("Residue serial: {:?}", res_serial_vec);
eprintln!("Residue name: {:?}", res_name_vec);
eprintln!("Chain per residue: {:?}", chain_per_residue);
eprintln!("Current index: {}", idx);
// Terminate
std::process::exit(1);
}
}

let ca_torsion_vec = ca_vec.calc_all_torsion_angles();
Expand Down

0 comments on commit 5ea49a2

Please sign in to comment.