Skip to content

Harden and tidy the analysis template#10

Merged
Marius1311 merged 1 commit into
mainfrom
improve/template-review
Jun 22, 2026
Merged

Harden and tidy the analysis template#10
Marius1311 merged 1 commit into
mainfrom
improve/template-review

Conversation

@Marius1311

Copy link
Copy Markdown
Member

Review-driven pass over the template covering security, the GPU/CI story, the demo notebook, onboarding, and repo hygiene. All tests and pre-commit hooks pass; pixi.lock regenerated; notebooks are output-clean.

Changes

  • GPU/CI environment split — the GPU stack (rapids-singlecell + CUDA JAX) now lives in a dedicated gpu pixi feature/environment. The default environment is CPU-only, so CI and CPU-only machines no longer resolve unusable CUDA wheels. CPU JAX is available by default on both platforms. Activate GPU explicitly with pixi install -e gpu (documented in the README).
  • CI — pin pixi-version: v0.60.0 and use frozen: true in both workflows.
  • Onboarding — add scripts/rename_package.py (+ pixi run rename) to rename the placeholder package/project in one shot; rewrite README Step 3 with a complete checklist. Add a documented .env.example and a secrets section.
  • Source_constants.py gains marker-based root detection and a DatasetPaths accessor (raw/processed/resources/results) with create(); plotting.qc_violin accepts str | Path for save and uses fig.tight_layout().
  • Docs — fix the dataset README (add resources), the bug-report template leftover (tradeseqsession_info2), and the inverted PR-template comments.

Bug fixes

  • rapids-singlecell extra rapids12rapids-cu12 — the old extra doesn't exist on current versions, so rapids installed without GPU libs and silently fell back to CPU.
  • CellTypist input scale — the demo now rebuilds log1p(normalize_total(1e4)) from the raw counts layer instead of trusting adata.X, preventing silently wrong annotations if X is later scaled/subset.
  • version("myanalysis") is now updated by the rename script (would otherwise raise PackageNotFoundError after renaming).

New

  • scripts/rename_package.py — stdlib-only, runnable before pixi install.
  • DatasetPaths accessor and FilePaths.dataset() helper.
  • .env.example.

Notes for reviewers

  • Action required: the previously-committed-locally .env held real OpenAI/Gemini/Anthropic keys — these should be rotated in their dashboards (the file is removed, not in git history).
  • Removed vestigial .cruft.json references and a stray personal prompt file (there's no cookiecutter/cruft sync here — the new init script replaces that need).
  • The demo notebook was renamed: demo_scRNA_workflow.ipynbML-2026-01-27_demo_scRNA_workflow.ipynb.

Related issues

N/A

Review-driven improvements across security, environment/CI, the demo
notebook, onboarding, and repo hygiene.

Security:
- Remove the local .env (held real API keys); add a tracked .env.example
  with placeholders and document the secrets workflow in the README.

Environment & CI:
- Isolate the GPU stack (rapids-singlecell + CUDA JAX) in a `gpu`
  pixi feature/environment; the default environment is now CPU-only, so
  CI and CPU machines no longer resolve unusable CUDA wheels.
- Fix the rapids-singlecell extra (`rapids12` -> `rapids-cu12`), which
  otherwise installs rapids without GPU libs and silently runs on CPU.
- Provide CPU JAX in the default env on both platforms.
- Pin pixi-version and use `frozen: true` in both workflows; regenerate
  pixi.lock.

Notebook:
- Rename the demo to follow the [INITIALS]-[DATE] convention.
- Make CellTypist's expected input scale explicit by rebuilding
  log1p(1e4) from the raw counts layer instead of trusting adata.X.

Onboarding:
- Add scripts/rename_package.py (+ `pixi run rename`) to rename the
  placeholder package/project in one shot; rewrite README Step 3.

Source & tests:
- _constants.py: marker-based root detection, a DatasetPaths accessor
  (raw/processed/resources/results) with create(), Path-friendly API.
- plotting.py: accept str | Path for `save`, use fig.tight_layout().
- Refresh the example tests to demonstrate the patterns.

Docs & hygiene:
- Fix the dataset README (add `resources`), the bug-report template
  leftover, and the inverted PR-template comments.
- Drop vestigial .cruft.json references and a stray personal prompt file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Marius1311 Marius1311 merged commit e303853 into main Jun 22, 2026
1 check passed
@Marius1311 Marius1311 deleted the improve/template-review branch June 22, 2026 14:37
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