Repository navigation
Conversation
- crate-type rlib + cdylib; new 'python' feature (default on) gates pyo3 and the five command modules (bamcoverage, bamcompare, computematrix, alignmentsieve, multibamsummary). calc, covcalc, filehandler, filtering and normalization are pure Rust and build without python. - Verified: cargo build with and without the feature; cargo test (51 pass)
…t-in python feature - pub surface: normalization (typed Normalization/ScaleFactorsMethod enums, NormalizationError via thiserror, no printing/panics) and deseq_scalefactors. calc helpers, covcalc, filehandler, filtering are private. - default features empty; maturin enables 'python' so pure-Rust consumers do not pull pyo3. CI builds/tests both and asserts pyo3 absent from core tree. - bamcoverage/bamcompare parse method strings and map errors to ValueError.
|
Autofix was enabled. Check current status in the Coding task. |
…CI guard - add NormalizationError::ZeroMappedReads for scale_factor and scale_factor_bamcompare (ReadCount) - make Python-layer dependencies optional behind the python feature - parse norm before the RPGC/scalefactor checks in r_bamcoverage and let scale_factor report MissingEffectiveGenomeSize - write cargo tree output to a file in the pyo3 guard so a failing cargo tree fails the step
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the crate half of the reverted #1485, on its own, with feedback applied. The alignmentSieve changes are in a separate PR.
What changes
hpis split into a core rlib (deeptools-core) and an optional Python layer behind thepythonfeature.normalization(scale_factor,scale_factor_bamcompare) anddeseq_scalefactors.covcalc,filehandler,filteringand the othercalchelpers are private.NormalizationandScaleFactorsMethodare enums withFromStr. A bad method string now returnsNormalizationError(thiserror) instead of falling through to a default. Theprintln!s and the unused_fraglenargument are gone from the public functions.bamcoverageandbamcompareparse the strings and turn the error into aValueError.#![warn(missing_docs)], crate level docs, crate metadata.publish = falseuntil we agree on the API.default = [], and[tool.maturin] features = ["python"]builds the extension.cargo tree -e normalshows no pyo3 in the core build, and CI now checks that.deeptools-core, the version sync check against release-please, and theCargo.lockjsonpath fix.How it was checked
cargo test(core only) andcargo test --features python, both without warnings.maturin develop --release, thentest_bamCoverage_and_bamCompare.py.What requires further feedback
Two things I decided without being sure:
filehandler, 29 incovcalc, a few infiltering). They still reach Python as exceptions through pyo3, as before. Converting all of them touches every caller and I'd rather not do it in this PR. Is that acceptable, or do you want it done here?default = []. I made thepythonfeature opt-in so a plaindeeptools-core = ...dependency does not pull pyo3, and let maturin switch it on. The other option is to keepdefault = ["python"]and make consumers writedefault-features = false. Do you have a preference?Also, a fair question about what goes public was raised: I kept it to the two pure modules.
filteringandfilehandlerwould be the next candidates, but they are where most of the panics are, so I'd expose them in a follow-up with proper errors.