Rename Layer to KmerLayer across obikindex and obikphylo

This commit renames the `Layer` type to `KmerLayer` throughout the `obikindex` and `obikphylo` crates. All imports, struct fields, function signatures, pattern matches, and instantiation calls have been updated accordingly. The change is a purely structural refactor that tightens type constraints without altering runtime behavior or data models.
This commit is contained in:
Eric Coissac
2026-08-21 10:27:29 +02:00
parent 4b7b3c3c1a
commit 31bb324752
7 changed files with 134 additions and 90 deletions
@@ -1,12 +1,12 @@
use std::io;
use std::path::PathBuf;
use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::sync::Arc;
use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::time::Instant;
use obikindex::KmerIndex;
use obikindex::layer::KmerLayer;
use obikseq::RoutableSuperKmer;
use obikindex::layer::Layer;
use obiskio::SKResult;
use obisys::Progress;
use tracing::info;
@@ -15,7 +15,7 @@ use niffler::Level;
use niffler::send::compression::Format;
use obiskio::SKFileWriter;
use obipipeline::{throttle, ThrottleGuard, Throttled};
use obipipeline::{ThrottleGuard, Throttled, throttle};
use obiread::NucPage;
// ── Pipeline plumbing, private to `run` ─────────────────────────────────────
@@ -240,13 +240,19 @@ impl<'a> PartitionRouter<'a> {
let now = Instant::now();
if now.duration_since(last_report).as_secs_f64() > REPORT_INTERVAL {
last_report = now;
cb(Progress { position: total_bases, total: None });
cb(Progress {
position: total_bases,
total: None,
});
}
}
self.write_batch(batch)?;
}
if let Some(cb) = on_progress.as_mut() {
cb(Progress { position: total_bases, total: None });
cb(Progress {
position: total_bases,
total: None,
});
}
self.close()
}
@@ -272,7 +278,7 @@ impl<'a> PartitionRouter<'a> {
fn ensure_writer(&mut self, partition: usize) -> SKResult<&mut SKFileWriter> {
if self.writers[partition].is_none() {
let dir = self.layer0_dir(partition);
Layer::create(&dir).map_err(|e| io::Error::other(e.to_string()))?;
KmerLayer::create(&dir).map_err(|e| io::Error::other(e.to_string()))?;
let file_path = obikindex::layer::raw_superkmers_path(&dir);
let writer = SKFileWriter::create_with(file_path, Format::Zstd, self.level)?;
self.writers[partition] = Some(writer);