Skip to content

Commit 488f54e

Browse files
committed
Fix pileup sum type and make python bindings optional
1 parent 5a58da7 commit 488f54e

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ clap = { version = "4.5", features = ["derive"] }
3232
# Serialization (optional, for debugging/visualization)
3333
serde = { version = "1.0", features = ["derive"], optional = true }
3434
# Python bindings
35-
pyo3 = { version = "0.23.2", features = ["extension-module", "abi3-py39"] }
35+
pyo3 = { version = "0.23.2", features = ["extension-module", "abi3-py39"], optional = true }
3636
# BAM/VCF output
3737
rust-htslib = { version = "0.44", default-features = false, features = ["bzip2", "lzma"] }
3838

@@ -45,6 +45,7 @@ test-case = "3.3"
4545
default = []
4646
visualize = ["serde"]
4747
profiling = []
48+
python-bindings = ["dep:pyo3"]
4849

4950
[[bench]]
5051
name = "simulation_bench"

src/genomics/pileup.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ mod tests {
295295
assert!(!summary.nodes.is_empty());
296296
let first = &summary.nodes[0];
297297
assert_eq!(first.position, 100);
298-
assert_eq!(first.depth, first.base_counts.iter().sum());
298+
let depth_sum: u32 = first.base_counts.iter().copied().sum();
299+
assert_eq!(first.depth, depth_sum);
299300
}
300301

301302
fn read_strategy(window_len: u32) -> impl Strategy<Value = AlignedRead> {

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub mod ledger; // Streaming progress tracking
3737
pub mod machine; // Turing machine representation
3838
pub mod plugin; // Plugin system
3939
/// Python bindings for exposing Rosalind components to external runtimes.
40+
#[cfg(feature = "python-bindings")]
4041
pub mod python_bindings;
4142
pub mod space; // Space accounting utilities
4243
pub mod tree; // Height-compressed evaluation tree

0 commit comments

Comments
 (0)