Rename obikpartition crate to obikpartitionner

Update all dependent crates and internal imports to reference the renamed module. Expose configuration parameters and genome metadata through new public accessor methods in the index API, and update documentation comments to align with the new package name.
This commit is contained in:
Eric Coissac
2026-08-20 19:43:00 +02:00
parent f64ac14f0e
commit b5ec0122d0
49 changed files with 62 additions and 35 deletions
+4 -4
View File
@@ -1600,7 +1600,7 @@ dependencies = [
"indicatif", "indicatif",
"ndarray", "ndarray",
"obicompactvec", "obicompactvec",
"obikpartition", "obikpartitionner",
"obikseq", "obikseq",
"obilayeredmap", "obilayeredmap",
"obiread", "obiread",
@@ -1626,7 +1626,7 @@ dependencies = [
"obidebruinj", "obidebruinj",
"obifastwrite", "obifastwrite",
"obikindex", "obikindex",
"obikpartition", "obikpartitionner",
"obikphylo", "obikphylo",
"obikrope", "obikrope",
"obikseq", "obikseq",
@@ -1648,7 +1648,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "obikpartition" name = "obikpartitionner"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cacheline-ef", "cacheline-ef",
@@ -1685,7 +1685,7 @@ dependencies = [
"ndarray", "ndarray",
"obicompactvec", "obicompactvec",
"obikindex", "obikindex",
"obikpartition", "obikpartitionner",
"obikseq", "obikseq",
"obilayeredmap", "obilayeredmap",
"obipipeline", "obipipeline",
+1 -1
View File
@@ -1,5 +1,5 @@
[workspace] [workspace]
resolver = "3" resolver = "3"
members = ["obikseq", "obiread", "obiskbuilder", "obifastwrite", "obikmer","obikrope","obipipeline", "obikpartition","obiskio","obidebruinj","obilayeredmap", "obicompactvec", "obisys", "obikindex", "obitaxonomy", "obikentropy", "obikphylo"] members = ["obikseq", "obiread", "obiskbuilder", "obifastwrite", "obikmer","obikrope","obipipeline", "obikpartitionner","obiskio","obidebruinj","obilayeredmap", "obicompactvec", "obisys", "obikindex", "obitaxonomy", "obikentropy", "obikphylo"]
[profile.release] [profile.release]
debug = 1 debug = 1
+1 -1
View File
@@ -129,7 +129,7 @@ pub fn pack_bit_matrix(dir: &Path) -> io::Result<()> {
// A `matrix.pbmx` can already exist here even though columnar data is // A `matrix.pbmx` can already exist here even though columnar data is
// still pending — e.g. copied verbatim from a merge's base source // still pending — e.g. copied verbatim from a merge's base source
// before this layer was widened with more genome columns (see // before this layer was widened with more genome columns (see
// `obikpartition::merge_partition`). Only skip (re-)packing if the // `obikpartitionner::merge_partition`). Only skip (re-)packing if the
// existing file already reflects the current column count; otherwise // existing file already reflects the current column count; otherwise
// the columnar files are newer and must be (re-)packed, overwriting the // the columnar files are newer and must be (re-)packed, overwriting the
// stale one — never silently discarded as "leftover cleanup". // stale one — never silently discarded as "leftover cleanup".
+1 -1
View File
@@ -232,7 +232,7 @@ pub fn pack_compact_int_matrix(dir: &Path) -> io::Result<()> {
// A `matrix.pcmx` can already exist here even though columnar data is // A `matrix.pcmx` can already exist here even though columnar data is
// still pending — e.g. copied verbatim from a merge's base source // still pending — e.g. copied verbatim from a merge's base source
// before this layer was widened with more genome columns (see // before this layer was widened with more genome columns (see
// `obikpartition::merge_partition`). Only skip (re-)packing if the // `obikpartitionner::merge_partition`). Only skip (re-)packing if the
// existing file already reflects the current column count; otherwise // existing file already reflects the current column count; otherwise
// the columnar files are newer and must be (re-)packed, overwriting the // the columnar files are newer and must be (re-)packed, overwriting the
// stale one — never silently discarded as "leftover cleanup". // stale one — never silently discarded as "leftover cleanup".
+1 -1
View File
@@ -5,7 +5,7 @@ edition = "2024"
[dependencies] [dependencies]
obikseq = { path = "../obikseq" } obikseq = { path = "../obikseq" }
obikpartition = { path = "../obikpartition" } obikpartitionner = { path = "../obikpartitionner" }
obitaxonomy = { path = "../obitaxonomy" } obitaxonomy = { path = "../obitaxonomy" }
obiskio = { path = "../obiskio" } obiskio = { path = "../obiskio" }
obisys = { path = "../obisys" } obisys = { path = "../obisys" }
+1 -1
View File
@@ -5,7 +5,7 @@ use rayon::prelude::*;
use crate::error::{OKIError, OKIResult}; use crate::error::{OKIError, OKIResult};
use crate::index::KmerIndex; use crate::index::KmerIndex;
use obikpartition::KmerFilter; use obikpartitionner::KmerFilter;
impl KmerIndex { impl KmerIndex {
/// Write a CSV table of all indexed kmers to `out`. /// Write a CSV table of all indexed kmers to `out`.
+28 -1
View File
@@ -2,7 +2,7 @@ use std::collections::BTreeMap;
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use obikpartition::{KmerPartitions, KmerSpectrum, PARTITIONS_SUBDIR}; use obikpartitionner::{KmerPartitions, KmerSpectrum, PARTITIONS_SUBDIR};
use obisys::{Reporter, Stage, progress_bar}; use obisys::{Reporter, Stage, progress_bar};
use rayon::prelude::*; use rayon::prelude::*;
use tracing::info; use tracing::info;
@@ -157,6 +157,33 @@ impl KmerIndex {
pub fn minimizer_size(&self) -> usize { pub fn minimizer_size(&self) -> usize {
self.meta.config.minimizer_size self.meta.config.minimizer_size
} }
pub fn n_bits(&self) -> usize {
self.meta.config.n_bits
}
pub fn with_counts(&self) -> bool {
self.meta.config.with_counts
}
pub fn evidence_mode(&self) -> &obilayeredmap::IndexMode {
&self.meta.config.evidence
}
/// Coarse evidence mode (`Exact`/`Approx`/`Hybrid`, no `b`/`z`
/// parameters) — see [`evidence_mode`](Self::evidence_mode) for the
/// full `IndexMode`. Same discriminant as `Layer::evidence_kind`, so a
/// layer's own evidence kind can be compared directly against the
/// index's.
pub fn evidence_kind(&self) -> obilayeredmap::EvidenceKind {
match self.meta.config.evidence {
obilayeredmap::IndexMode::Exact => obilayeredmap::EvidenceKind::Exact,
obilayeredmap::IndexMode::Approx { .. } => obilayeredmap::EvidenceKind::Approx,
obilayeredmap::IndexMode::Hybrid { .. } => obilayeredmap::EvidenceKind::Hybrid,
}
}
pub fn block_bits(&self) -> u8 {
self.meta.config.block_bits
}
pub fn genomes(&self) -> &[GenomeInfo] {
&self.meta.genomes
}
pub fn n_partitions(&self) -> usize { pub fn n_partitions(&self) -> usize {
self.partition.n_partitions() self.partition.n_partitions()
} }
+2 -2
View File
@@ -13,7 +13,7 @@ use crate::index::KmerIndex;
use crate::meta::{GenomeInfo, IndexMeta}; use crate::meta::{GenomeInfo, IndexMeta};
use crate::state::{IndexState, SENTINEL_INDEXED}; use crate::state::{IndexState, SENTINEL_INDEXED};
pub use obikpartition::MergeMode; pub use obikpartitionner::MergeMode;
// ── per-partition diagnostic record ────────────────────────────────────────── // ── per-partition diagnostic record ──────────────────────────────────────────
@@ -193,7 +193,7 @@ impl KmerIndex {
let block_bits = dst.meta.config.block_bits; let block_bits = dst.meta.config.block_bits;
// Pre-build source list once (avoid rebuilding per partition) // Pre-build source list once (avoid rebuilding per partition)
let srcs: Vec<(&obikpartition::KmerPartitions, usize)> = remaining_sources let srcs: Vec<(&obikpartitionner::KmerPartitions, usize)> = remaining_sources
.iter() .iter()
.map(|s| (&s.partition, s.meta.genomes.len())) .map(|s| (&s.partition, s.meta.genomes.len()))
.collect(); .collect();
+1 -1
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use obikpartition::GroupQuorumFilter; use obikpartitionner::GroupQuorumFilter;
use obitaxonomy::{TaxPath, TaxPattern}; use obitaxonomy::{TaxPath, TaxPattern};
use crate::meta::{GenomeInfo, IndexMeta}; use crate::meta::{GenomeInfo, IndexMeta};
+1 -1
View File
@@ -1,6 +1,6 @@
use std::path::Path; use std::path::Path;
use obikpartition::{KmerFilter, MergeMode}; use obikpartitionner::{KmerFilter, MergeMode};
use obisys::{Reporter, Stage, progress_bar}; use obisys::{Reporter, Stage, progress_bar};
use tracing::info; use tracing::info;
+1 -1
View File
@@ -1,4 +1,4 @@
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obilayeredmap::{IndexMode, layer::Layer}; use obilayeredmap::{IndexMode, layer::Layer};
use obisys::{Reporter, Stage, progress_bar}; use obisys::{Reporter, Stage, progress_bar};
use std::fs; use std::fs;
+1 -1
View File
@@ -1,6 +1,6 @@
use std::path::Path; use std::path::Path;
use obikpartition::{KmerPartitions, OutputCol}; use obikpartitionner::{KmerPartitions, OutputCol};
use obisys::{Reporter, Stage, progress_bar}; use obisys::{Reporter, Stage, progress_bar};
use tracing::info; use tracing::info;
+1 -1
View File
@@ -15,7 +15,7 @@ obifastwrite = { path = "../obifastwrite" }
obidebruinj = { path = "../obidebruinj" } obidebruinj = { path = "../obidebruinj" }
obipipeline = { path = "../obipipeline" } obipipeline = { path = "../obipipeline" }
obikrope = { path = "../obikrope" } obikrope = { path = "../obikrope" }
obikpartition = { path = "../obikpartition" } obikpartitionner = { path = "../obikpartitionner" }
obisys = { path = "../obisys" } obisys = { path = "../obisys" }
obiskio = { path = "../obiskio" } obiskio = { path = "../obiskio" }
obikindex = { path = "../obikindex", default-features = false } obikindex = { path = "../obikindex", default-features = false }
+1 -1
View File
@@ -2,7 +2,7 @@ use std::path::PathBuf;
use clap::Args; use clap::Args;
use obikindex::{KmerIndex, MergeMode}; use obikindex::{KmerIndex, MergeMode};
use obikpartition::filter::{MaxTotalCount, MinComplexity, MinTotalCount}; use obikpartitionner::filter::{MaxTotalCount, MinComplexity, MinTotalCount};
use obisys::Reporter; use obisys::Reporter;
use tracing::info; use tracing::info;
+1 -1
View File
@@ -1,6 +1,6 @@
use clap::Args; use clap::Args;
use obikindex::{GroupFilterParams, IndexMeta, MetaPred}; use obikindex::{GroupFilterParams, IndexMeta, MetaPred};
use obikpartition::KmerFilter; use obikpartitionner::KmerFilter;
/// CLI args for ingroup/outgroup filtering — embeddable in any command via `#[command(flatten)]`. /// CLI args for ingroup/outgroup filtering — embeddable in any command via `#[command(flatten)]`.
#[derive(Args)] #[derive(Args)]
+1 -1
View File
@@ -1,6 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use obikpartition::KmerDesc; use obikpartitionner::KmerDesc;
use obikseq::CanonicalKmer; use obikseq::CanonicalKmer;
use obiread::record::SeqRecord; use obiread::record::SeqRecord;
use obiskbuilder::SuperKmerIter; use obiskbuilder::SuperKmerIter;
+1 -1
View File
@@ -1,7 +1,7 @@
use std::time::Instant; use std::time::Instant;
use obikindex::KmerIndex; use obikindex::KmerIndex;
use obikpartition::{KmerDesc, QueryHit, QueryStats}; use obikpartitionner::{KmerDesc, QueryHit, QueryStats};
use obikrope::Rope; use obikrope::Rope;
use obikseq::CanonicalKmer; use obikseq::CanonicalKmer;
use obiread::record::parse_chunk; use obiread::record::parse_chunk;
+1 -1
View File
@@ -3,7 +3,7 @@ use std::path::PathBuf;
use clap::{Args, ValueEnum}; use clap::{Args, ValueEnum};
use obikindex::{IndexMeta, KmerIndex}; use obikindex::{IndexMeta, KmerIndex};
use obikpartition::{AggOp, OutputCol}; use obikpartitionner::{AggOp, OutputCol};
use obisys::Reporter; use obisys::Reporter;
use tracing::info; use tracing::info;
+1 -1
View File
@@ -3,7 +3,7 @@ use std::sync::Arc;
use std::sync::atomic::{AtomicU32, AtomicU64, Ordering}; use std::sync::atomic::{AtomicU32, AtomicU64, Ordering};
use std::time::Instant; use std::time::Instant;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obipipeline::{ThrottleGuard, Throttled, throttle}; use obipipeline::{ThrottleGuard, Throttled, throttle};
use obiread::NucPage; use obiread::NucPage;
use obisys::spinner; use obisys::spinner;
@@ -1,5 +1,5 @@
[package] [package]
name = "obikpartition" name = "obikpartitionner"
version = "0.1.0" version = "0.1.0"
edition = "2024" edition = "2024"
@@ -197,7 +197,7 @@ impl KmerPartitions {
} }
/// Partition `i`'s metadata (layer count, evidence mode) — the single /// Partition `i`'s metadata (layer count, evidence mode) — the single
/// entry point for this, so that callers outside `obikpartition` /// entry point for this, so that callers outside `obikpartitionner`
/// never need to know it's a `meta.json` loaded via /// never need to know it's a `meta.json` loaded via
/// `obilayeredmap::meta::PartitionMeta`, nor handle its own recovery /// `obilayeredmap::meta::PartitionMeta`, nor handle its own recovery
/// path for indexes built before that file existed (see /// path for indexes built before that file existed (see
+1 -1
View File
@@ -6,7 +6,7 @@ edition = "2024"
[dependencies] [dependencies]
obikindex = { path = "../obikindex", default-features = false } obikindex = { path = "../obikindex", default-features = false }
obikseq = { path = "../obikseq" } obikseq = { path = "../obikseq" }
obikpartition = { path = "../obikpartition" } obikpartitionner = { path = "../obikpartitionner" }
obiskio = { path = "../obiskio" } obiskio = { path = "../obiskio" }
obisys = { path = "../obisys" } obisys = { path = "../obisys" }
obicompactvec = { path = "../obicompactvec" } obicompactvec = { path = "../obicompactvec" }
+1 -1
View File
@@ -1,6 +1,6 @@
use std::sync::Arc; use std::sync::Arc;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obisys::progress_bar; use obisys::progress_bar;
use obikindex::KmerIndex; use obikindex::KmerIndex;
+1 -1
View File
@@ -4,7 +4,7 @@ use std::sync::atomic::Ordering;
use rayon::prelude::*; use rayon::prelude::*;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obikseq::CanonicalKmer; use obikseq::CanonicalKmer;
use obilayeredmap::MphfLayer; use obilayeredmap::MphfLayer;
use obilayeredmap::meta::IndexMode; use obilayeredmap::meta::IndexMode;
+1 -1
View File
@@ -3,7 +3,7 @@ use rayon::prelude::*;
use std::path::Path; use std::path::Path;
use obicompactvec::{PersistentBitMatrix, PersistentCompactIntMatrix}; use obicompactvec::{PersistentBitMatrix, PersistentCompactIntMatrix};
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obikseq::CanonicalKmer; use obikseq::CanonicalKmer;
use obilayeredmap::meta::IndexMode; use obilayeredmap::meta::IndexMode;
use obilayeredmap::{Layer, OLMResult}; use obilayeredmap::{Layer, OLMResult};
+1 -1
View File
@@ -2,7 +2,7 @@ use std::sync::Arc;
use ndarray::Array2; use ndarray::Array2;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obisys::progress_bar; use obisys::progress_bar;
use obikindex::KmerIndex; use obikindex::KmerIndex;
+1 -1
View File
@@ -2,7 +2,7 @@ use std::sync::Arc;
use ndarray::Array2; use ndarray::Array2;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obisys::progress_bar; use obisys::progress_bar;
use obikindex::KmerIndex; use obikindex::KmerIndex;
+1 -1
View File
@@ -13,7 +13,7 @@ use std::io::{BufWriter, Write};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::sync::Arc; use std::sync::Arc;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obisys::progress_bar; use obisys::progress_bar;
use obikindex::KmerIndex; use obikindex::KmerIndex;
+1 -1
View File
@@ -29,7 +29,7 @@ use std::sync::Arc;
use ndarray::Array2; use ndarray::Array2;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obisys::progress_bar; use obisys::progress_bar;
use obikindex::KmerIndex; use obikindex::KmerIndex;
+1 -1
View File
@@ -2,7 +2,7 @@ use std::sync::Arc;
use rayon::prelude::*; use rayon::prelude::*;
use obikpartition::KmerPartitions; use obikpartitionner::KmerPartitions;
use obisys::progress_bar; use obisys::progress_bar;
use obikindex::KmerIndex; use obikindex::KmerIndex;
+1 -1
View File
@@ -33,7 +33,7 @@ pub trait LayerData: Sized {
/// ///
/// `obilayeredmap` operates within a single partition's index root; it has /// `obilayeredmap` operates within a single partition's index root; it has
/// no notion of "partition" at all. Turning a partition number into that /// no notion of "partition" at all. Turning a partition number into that
/// root is `obikpartition::KmerPartition::part_dir`'s job, one layer up /// root is `obikpartitionner::KmerPartition::part_dir`'s job, one layer up
/// — callers here only ever name a layer *number*, never build the path /// — callers here only ever name a layer *number*, never build the path
/// themselves. /// themselves.
pub fn layer_dir(root: &Path, i: usize) -> PathBuf { pub fn layer_dir(root: &Path, i: usize) -> PathBuf {