Simplify MphfLayer::open by removing explicit IndexMode parameter

The MphfLayer::open signature now accepts only a directory path. Mode configuration is resolved internally via disk-based auto-detection using LayerEvidence, eliminating the need for explicit arguments from callers. All internal query methods and external call sites have been updated accordingly, while TypedLayer::open temporarily retains the unused parameter for future cleanup.
This commit is contained in:
Eric Coissac
2026-08-21 22:08:52 +02:00
parent 00ba968628
commit c9d10d55c7
7 changed files with 128 additions and 85 deletions
+1 -4
View File
@@ -6,7 +6,6 @@ use rayon::prelude::*;
use obikseq::CanonicalKmer;
use obikindex::layer::MphfLayer;
use obikindex::layer::meta::IndexMode;
use obipipeline::ThrottleGuard;
use obisys::progress_bar;
@@ -98,7 +97,6 @@ impl SiblingAnnexBuildExt for KmerIndex {
part_slots += build_layer_sibling_annex(
self,
&self.layer_dir(part, l),
&meta.mode,
n_parts,
l,
&cache,
@@ -123,12 +121,11 @@ impl SiblingAnnexBuildExt for KmerIndex {
fn build_layer_sibling_annex(
index: &KmerIndex,
layer_dir: &Path,
mode: &IndexMode,
n_parts: usize,
l: usize,
cache: &Arc<PartitionCache>,
) -> OKIResult<u64> {
let mphf = MphfLayer::open(layer_dir, mode).map_err(olm_to_ok)?;
let mphf = MphfLayer::open(layer_dir).map_err(olm_to_ok)?;
let k = index.kmer_size();
let n = mphf.n();
+1 -1
View File
@@ -99,7 +99,7 @@ fn annex_info_for(idx: &KmerIndex, kmer: CanonicalKmer) -> FamilyMask {
let meta = idx.partition_meta(0).unwrap();
for l in 0..meta.n_layers {
let layer_dir = idx.layer_dir(0, l);
let mphf = MphfLayer::open(&layer_dir, &meta.mode).unwrap();
let mphf = MphfLayer::open(&layer_dir).unwrap();
if let Some(slot) = mphf.find(kmer) {
let annex = SiblingAnnex::open(&layer_dir.join(ANNEX_FILE_NAME)).unwrap();
return annex.get(slot).expect("slot must have a computed annex entry");