Skip to content

Update template to v0.8.0 - #140

Merged
moinfar merged 6 commits into
mainfrom
fix-template-update-v0.8.0
Sep 17, 2026
Merged

moinfar merged 6 commits into
mainfrom
fix-template-update-v0.8.0

Conversation

@moinfar

@moinfar moinfar commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Applies the cookiecutter-scverse v0.8.0 template update (#137) via cruft update, resolving conflicts by hand since the automated PR was based on the pristine template baseline instead of current main.

  • Pin GitHub Actions to immutable commit hashes and add zizmor as a pre-commit hook to harden CI against supply-chain attacks
  • Migrate from pre-commit to prek, and add mypy type checking (with overrides for currently-untyped third-party deps and pre-existing type errors, to be cleaned up incrementally)
  • Migrate docs from sphinx-tabs to sphinx-design and move shared sphinx extensions into scverse-misc
  • Add an autofix.ci workflow, list installed packages in test CI output, and other minor CI/docs housekeeping from the template release

Applies the cookiecutter-scverse v0.8.0 template update (#137) via `cruft update`,
resolving conflicts by hand since the automated PR was based on the pristine
template baseline instead of current main.

- Pin GitHub Actions to immutable commit hashes and add zizmor as a pre-commit
  hook to harden CI against supply-chain attacks
- Migrate from pre-commit to prek, and add mypy type checking (with overrides
  for currently-untyped third-party deps and pre-existing type errors, to be
  cleaned up incrementally)
- Migrate docs from sphinx-tabs to sphinx-design and move shared sphinx
  extensions into scverse-misc
- Add an autofix.ci workflow, list installed packages in test CI output, and
  other minor CI/docs housekeeping from the template release

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.79310% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.60%. Comparing base (8afe198) to head (66a051a).

Files with missing lines Patch % Lines
src/drvi/utils/plotting/_latent.py 38.70% 19 Missing ⚠️
src/drvi/internal/drvi/_module.py 0.00% 1 Missing ⚠️
src/drvi/utils/plotting/_interpretability.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #140      +/-   ##
==========================================
- Coverage   83.61%   83.60%   -0.01%     
==========================================
  Files          23       23              
  Lines        1001     1025      +24     
==========================================
+ Hits          837      857      +20     
- Misses        164      168       +4     
Files with missing lines Coverage Δ
src/drvi/internal/drvi/_generative_mixin.py 100.00% <ø> (ø)
src/drvi/internal/drvi/_metrics.py 99.00% <100.00%> (+0.08%) ⬆️
src/drvi/utils/plotting/_cmap.py 100.00% <100.00%> (ø)
src/drvi/utils/porting.py 88.65% <100.00%> (+0.04%) ⬆️
src/drvi/internal/drvi/_module.py 80.70% <0.00%> (-0.72%) ⬇️
src/drvi/utils/plotting/_interpretability.py 90.62% <83.33%> (-1.97%) ⬇️
src/drvi/utils/plotting/_latent.py 67.37% <38.70%> (-0.04%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

moinfar and others added 5 commits September 14, 2026 20:25
Removes the blanket ignore_errors overrides added when wiring up mypy from
the template and actually resolves the 15 real type errors they were
masking, across _cmap, _generative_mixin, _module, _metrics, _interpretability,
_latent, and porting. Only the ignore_missing_imports override for untyped
third-party deps (scanpy/scipy/scvi/sklearn) remains.

Notable fixes:
- _cmap.py: give each colormap dict its own name and a Literal-keyed type
  instead of reusing one dynamically-retyped `cmap_data` variable
- _generative_mixin.py: declare the attributes SparseLatentMixin expects
  from the model classes it's combined with, under TYPE_CHECKING
- _metrics.py: annotate torchmetrics state/buffer attributes so they're
  seen as Tensor rather than the generic Module fallback
- _latent.py: add an _as_frame() helper to narrow anndata's `DataFrame |
  Dataset2D` to a concrete DataFrame, since this module's operations
  (groupby/query/sort_values/mutation) require an in-memory AnnData anyway

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reworks the previous commit's type fixes to be less intrusive and more honest
about what is actually known:

- _latent.py: `_as_df`/`_as_array` now narrow anndata's `.obs`/`.var`/`.X`
  annotations with `typing.cast` instead of an isinstance check that raised.
  The raise added an untested error path (and a repeated name string at every
  call site) for a change that is only about types.
- _generative_mixin.py: declare the attributes the mixin expects from its
  sibling base class as `Callable`, rather than fabricating full signatures
  for an upstream (untyped) scvi API that mypy cannot verify them against.
- _cmap.py: keep the per-colormap data dicts private; `plotting.cmap` is a
  public module, so they should not become API.
- _interpretability.py: lift `_dim_number` out of the plotting function body
  and raise `ValueError` rather than assert.
- porting.py: express the terminal chain entry as `if migration := ...`
  (None means "no parameter change"), which the dict already means, instead
  of asserting it away.
- Drop the two `# type: ignore` comments and the bare asserts these replace.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The hook shells out to `hatch`, which pre-commit.ci cannot provide: mypy needs
the project's dependencies installed, and pre-commit.ci has no network access
while running hooks. It failed there with "Executable `hatch` not found" while
every other hook passed.

mypy still runs locally through prek and on CI in the `Pre-commit checks` job,
which installs hatch first.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@moinfar
moinfar force-pushed the fix-template-update-v0.8.0 branch from bc8505e to 66a051a Compare September 16, 2026 22:04
@moinfar
moinfar merged commit 18882ef into main Sep 17, 2026
11 checks passed
@moinfar
moinfar deleted the fix-template-update-v0.8.0 branch September 17, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant