style: apply rustfmt across all crates and demos

Consistent formatting pass: line wrapping, import sorting, trailing
whitespace removal, let-chain indentation, merged derive attributes,
and unsafe block reformatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-04-12 07:01:58 -07:00
co-authored by Claude Opus 4.6
parent bc88a14fa1
commit 02d382d5f6
302 changed files with 1805 additions and 1590 deletions
+15 -9
View File
@@ -250,13 +250,14 @@ fn find_best_cell_type(
for marker in &marker_set.positive_markers {
if let Some(&gene_idx) = gene_map.get(marker)
&& gene_idx < cell.expression.gene_indices.len() {
let expr = cell.expression.get(gene_idx);
if expr > 0.0 {
positive_count += 1;
positive_total += expr;
}
&& gene_idx < cell.expression.gene_indices.len()
{
let expr = cell.expression.get(gene_idx);
if expr > 0.0 {
positive_count += 1;
positive_total += expr;
}
}
}
// Check negative markers
@@ -437,12 +438,14 @@ fn classify_embeddings(embeddings: &[Vec<f32>], _clusters: &[ClusterInfo]) -> Ve
use rand::SeedableRng;
use rand_distr::{Distribution, Normal};
let cell_types = [("CD4+ T cell", vec!["Immune", "T cell", "CD4+ T cell"]),
let cell_types = [
("CD4+ T cell", vec!["Immune", "T cell", "CD4+ T cell"]),
("CD8+ T cell", vec!["Immune", "T cell", "CD8+ T cell"]),
("B cell", vec!["Immune", "B cell"]),
("Monocyte", vec!["Immune", "Myeloid", "Monocyte"]),
("NK cell", vec!["Immune", "NK cell"]),
("Dendritic cell", vec!["Immune", "Myeloid", "DC"])];
("Dendritic cell", vec!["Immune", "Myeloid", "DC"]),
];
let mut rng = rand::rngs::StdRng::seed_from_u64(42);
let confidence_noise = Normal::new(0.0_f32, 0.1).unwrap();
@@ -459,7 +462,10 @@ fn classify_embeddings(embeddings: &[Vec<f32>], _clusters: &[ClusterInfo]) -> Ve
CellType {
name: name.to_string(),
confidence: (0.75 + confidence_noise.sample(&mut rng)).clamp(0.5, 0.99),
lineage: lineage.iter().map(std::string::ToString::to_string).collect(),
lineage: lineage
.iter()
.map(std::string::ToString::to_string)
.collect(),
markers: vec![],
}
})