Milo cleanup: address #181#986
Merged
Merged
Conversation
* Rename `add_covariate_to_nhoods_var` to `add_covariate_to_nhoods_obs`
since the destination is `mdata['milo'].obs`, not `.var`. Keep the
original name as a deprecated alias via `scverse_misc.deprecated`.
* Preserve categorical dtypes when copying covariates over (the previous
`.astype('str')` silently turned categoricals into object dtype, which
broke downstream plotting).
* `plot_nhood_counts_by_cond`: raise a clear error when `test_var` is
missing (point at `add_covariate_to_nhoods_obs`) and coerce object
columns to category before plotting.
* `da_nhoods`: deprecate `subset_samples` via `scverse_misc.deprecated_arg`
(causes SpatialFDR bugs in edge cases; prefer contrasts or pre-subset
cells before kNN graph building).
* `da_nhoods`: validate contrast levels against design columns for both
edger and pydeseq2 solvers so users get a useful error instead of an
rpy2/pydeseq2 traceback when a level is missing from the model matrix.
Closes #181.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
* test_tutorials: replace the hand-rolled BiocManager install + actions/cache step with `r-lib/actions/setup-r-dependencies@v2` and `use-public-rspm: true`, declaring `bioc::edgeR` and `any::statmod`. pak resolves the right Bioc release against the running R version, so we don't depend on BiocManager's autodetection (which started picking the wrong Bioc on R 4.5). * Use a fully-qualified `:meth:` reference in the deprecated alias docstring so Sphinx can resolve it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Map it onto Sphinx's built-in `deprecated` directive so the docstring fragments injected by `scverse_misc.deprecated` render without an "Unknown directive type" error. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nbsphinx-link is dead code in this repo — there are no `.nblink` files and the tutorials submodule provides `.ipynb` directly. nbsphinx-link is also incompatible with Sphinx 9 (vidartf/nbsphinx-link#26), which forced the `<9.0` pin and in turn kept us off Sphinx 9's natively-supported `.. version-deprecated::` directive that `scverse_misc.deprecated` emits. Dropping nbsphinx-link unblocks the Sphinx 9 upgrade and makes `scverse_misc.deprecated` render without an "Unknown directive type" error — so no extra registration in conf.py is needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #181.
add_covariate_to_nhoods_var→add_covariate_to_nhoods_obs(destination ismdata['milo'].obs). Old name kept as deprecated alias..astype('str')silently turned them into object, breaking downstream plots).plot_nhood_counts_by_cond: clear error whentest_varcolumn is missing; coerce object columns to category.da_nhoods: deprecatesubset_samples(causes SpatialFDR bugs in edge cases — use contrasts or subset before kNN). Validate contrast levels against the design columns for both edgeR and pydeseq2 so the failure is informative instead of an opaque rpy2/pydeseq2 traceback.Adds
scverse-miscto dependencies fordeprecated/deprecated_arg.