Replace manual layer path construction with obilayeredmap::layer_dir

Standardizes layer directory path resolution across obikindex, obikpartitionner, and obikphylo by replacing inline string formatting and join calls with the centralized obilayeredmap::layer_dir utility. This refactoring removes redundant path construction logic while preserving existing iteration bounds, control flow, and public APIs.
This commit is contained in:
Eric Coissac
2026-08-20 14:54:13 +02:00
parent 5a91817488
commit 7eaa8c2016
14 changed files with 43 additions and 43 deletions
+5 -2
View File
@@ -5,6 +5,7 @@
use obicompactvec::{PersistentBitMatrix, PersistentSparseBitMatrix};
use obikindex::KmerIndex;
use obilayeredmap::layer_dir;
fn main() -> anyhow::Result<()> {
let sparse_root = std::env::args().nth(1).expect("usage: compare_sparse <sparse_root> <dense_root>");
@@ -33,8 +34,10 @@ fn main() -> anyhow::Result<()> {
}
for layer in 0..n_layers {
let layer_dir_sparse = part_dir_sparse.join("index").join(format!("layer_{layer}"));
let layer_dir_dense = part_dir_dense.join("index").join(format!("layer_{layer}"));
let index_dir_sparse = part_dir_sparse.join("index");
let index_dir_dense = part_dir_dense.join("index");
let layer_dir_sparse = layer_dir(&index_dir_sparse, layer);
let layer_dir_dense = layer_dir(&index_dir_dense, layer);
if !layer_dir_sparse.exists() || !layer_dir_dense.exists() {
continue;