Repository navigation
refactor: robustness and cleanup fixes from the 0.7.0 review - #219
Merged
Merged
Conversation
…or both twins, import with NUMBA_DISABLE_JIT One thread-local scope (`dask_task`) replaces the serial= arguments: the dask task functions enter it, so all kernels they call (also `_n_unsorted_rows` and the group sums) run their serial twin, on the synchronous scheduler and in the main thread of a worker process too. The heatmap reads backed and dask blocks with the parallel kernel on the main thread.
…and scratch, one block reader for the drivers `_group_sums_*` take an `expm1` flag instead of the `_group_expm1_sums_*` copies (bit-identical, tested). `_kept` is the noise test of `_center_emit`, `_count_kept` and `_fill_kept`; `_scratch` the buffers of both CNV kernels. `_Layout` drops `gene_geometry` (derived from `geometry`) and the unused `step`. `_Rows.read_ahead` yields each block's row range, so infercnv, cnv_score and the heatmap drivers no longer recompute it.
…stead of in full for every row block anndata reads all of a CSC matrix for any block of rows, so infercnv read it about blocks x passes times (and the heatmaps and cnv_score once per block). All three read through `_Rows`, which now loads it once as CSR.
… matrices, gtfparse 2 `ithcna(use_rep=key)` falls back to `adata.obsm[key]` (with a FutureWarning) for any key, not only keys starting with X_. `_as_matrix` takes the values of a DataFrame in obsm, as the 0.6 heatmap and ithcna did. A polars frame from gtfparse 2 is converted with `to_pandas`, as before 0.7.
…npy heatmap helper, one var merge `_splice_doc` fills shared blocks into the docstrings of ithgex/ithcna and chromosome_heatmap/summary (rendered text unchanged apart from line breaks). FAST_KWARGS comes from the fields of `_Options`. legacy_heatmap and legacy_summary share `_scanpy_heatmap` and are imported directly (no import cycle). The GTF and BioMart functions share `_merge_var`.
…nce 0.6.1, as 0.6.1 used Prose only: identifiers such as the kernels' `centre` argument and code cells keep their names.
…anpy's datasetdir 0.6 read it from `sc.settings.datasetdir`; 0.7 downloaded it again into the pooch cache. A file there is now used (pooch still checks its hash). The comment on the download dir claimed this already.
… differs by an ulp on Linux)
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #219 +/- ##
==========================================
+ Coverage 93.62% 93.71% +0.08%
==========================================
Files 21 21
Lines 1631 1638 +7
==========================================
+ Hits 1527 1535 +8
+ Misses 104 103 -1
🚀 New features to boost your workflow:
|
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.
Summary: The last of three PRs with fixes from the review of the 0.7.0 refactor. This one covers the numba kernels, inputs from 0.6, and code cleanup.
Fixes:
serial=arguments with a thread-local scope in_numba.py. Both twins of each kernel use numpy's error model, and the package imports withNUMBA_DISABLE_JIT=1.ithcnawith anyobsmkey, DataFrame CNV matrices, and gtfparse 2.maynard2020_3kreuses the file that infercnvpy 0.6 downloaded into scanpy'sdatasetdir.Cleanup:
expm1flag, a shared noise test and scratch buffers, and one block reader for the drivers.ithgex/ithcnaand the two chromosome heatmaps. The rendered text is unchanged apart from line breaks.FAST_KWARGScomes from the fields of_Options. The legacy heatmaps share one scanpy helper, and the GTF and BioMart readers share one function to mergevar.Testing: the full test suite passes on the cluster (697 passed, 12 skipped).