chore: update dependencies and adapt to updated crate APIs

Bumps core dependencies including ndarray, rand, hashbrown, niffler, ureq, sysinfo, indicatif, lru, and remove_dir_all. Adapts source code to accommodate breaking changes by migrating RNG initialization, adjusting HTTP response handling, and replacing the fs4 crate with standard library file locking. Adds a planning document for query benchmarking and sparse index regression tests.
This commit is contained in:
Eric Coissac
2026-08-20 13:45:41 +02:00
parent 32bcbd1465
commit 5a9d903e51
15 changed files with 365 additions and 511 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ obilayeredmap = { path = "../obilayeredmap" }
obiskbuilder = { path = "../obiskbuilder" }
obipipeline = { path = "../obipipeline" }
memmap2 = "0.9"
ndarray = "0.16"
rand = "0.8"
ndarray = "0.17"
rand = "0.10"
rayon = "1"
tracing = "0.1.44"
+5 -5
View File
@@ -22,7 +22,7 @@
use std::collections::HashSet;
use std::path::{Path, PathBuf};
use rand::Rng;
use rand::RngExt;
use rayon::prelude::*;
use obikindex::{KmerIndex, OKIError, OKIResult};
@@ -97,7 +97,7 @@ fn reservoir_sample_layer(layer_dir: &Path, n_layer: usize) -> OKIResult<HashSet
let mut reservoir: Vec<usize> = Vec::with_capacity(n_layer);
let mut seen: u64 = 0;
let mut family_idx: usize = 0;
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
for slot in 0..annex.len() {
let Some(mask) = annex.get(slot) else { continue };
if !mask.is_minorant() {
@@ -111,7 +111,7 @@ fn reservoir_sample_layer(layer_dir: &Path, n_layer: usize) -> OKIResult<HashSet
if reservoir.len() < n_layer {
reservoir.push(this_family_idx);
} else {
let j = rng.gen_range(0..=seen);
let j = rng.random_range(0..=seen);
if j < n_layer as u64 {
reservoir[j as usize] = this_family_idx;
}
@@ -188,7 +188,7 @@ fn entropy_biased_sample_layer(layer_dir: &Path, p0: f64, bias: EntropyBias) ->
let entropy_annex = EntropyAnnex::open(&layer_dir.join(ENTROPY_ANNEX_FILE_NAME)).map_err(OKIError::Io)?;
let mut selected = HashSet::new();
let mut family_idx: usize = 0;
let mut rng = rand::thread_rng();
let mut rng = rand::rng();
for slot in 0..annex.len() {
let Some(mask) = annex.get(slot) else { continue };
if !mask.is_minorant() {
@@ -207,7 +207,7 @@ fn entropy_biased_sample_layer(layer_dir: &Path, p0: f64, bias: EntropyBias) ->
let Some(entropy) = entropy_annex.get(this_family_idx) else { continue };
let d = (entropy as f64 - bias.mu) / bias.sigma;
let w = (-0.5 * d * d).exp();
if rng.r#gen::<f64>() < p0 * w {
if rng.random::<f64>() < p0 * w {
selected.insert(this_family_idx);
}
}