Skip to content

Sg/backend improvements - #32

Open
saurabhinfocusp wants to merge 7 commits into
mainfrom
sg/backend-improvements
Open

saurabhinfocusp wants to merge 7 commits into
mainfrom
sg/backend-improvements

Conversation

@saurabhinfocusp

@saurabhinfocusp saurabhinfocusp commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a new "simple API" layer on top of the scaLR engine — scalr.train, scalr.annotate, scalr.load_model, scalr.validate, scalr.align_genes — for config-free, in-memory workflows (leakage-safe splitting, calibration, metrics, validation, gene alignment).
  • Layer in optional capabilities: hierarchical taxonomy annotation, cluster-refinement majority voting, doublet flagging, feature-selection stability scoring, and dataset benchmarking (quality + cost).
  • Add self-contained model artifacts (manifest.json, model.pt, configs, auto-generated model card) with a local model registry, and a scalr CLI (train, annotate, evaluate, validate, models list/info).
  • Add corresponding unit tests for all new modules.
  • Apply yapf/isort formatting fixes to satisfy CI style checks (no logic changes).
  • Update docs (README, CLAUDE.md), pyproject.toml, requirements.txt for the new modules/CLI entry point.

Test plan

  • pytest (new test_api.py, test_benchmark.py, test_cli.py, test_doublet.py, test_feature_stability.py, test_hierarchy.py, test_model_card.py, test_models.py, test_refinement.py, plus existing suites)
  • CLI-based training tested manually per latest commit message

saurabh and others added 5 commits September 21, 2026 17:28
CI's yapf check failed because the new P0 files did not match the
project's .style.yapf (google style, 80 cols). Reformatted with
`yapf -ir --style .style.yapf` and `isort --settings-path .isort.cfg`;
no logic changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI's yapf check was failing because add_argument calls exceeded the
80-col limit. Reformatted with `yapf -ir --style .style.yapf`; no
logic changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
saurabh and others added 2 commits September 24, 2026 16:49
Explainability: scalr/explain.py implements Grad x Input saliency
attribution, wired into AnnotationModel.explain()/explain_class() and
a new `scalr explain` CLI subcommand, to report which genes supported
or contradicted a prediction (per cell or per class).

Streaming predict: AnnotationModel.predict() gains streaming/chunk_size
params (implied by passing a file path); gene alignment and scoring now
happen chunk-by-chunk instead of materializing one aligned matrix for
the whole dataset, per the low-resource design goal. Forwarded through
scalr.annotate() and the `scalr annotate` CLI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Add Python-API and CLI usage examples for model.explain()/explain_class()
and streaming/chunked model.predict(), added in a6d45c0.

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

This branch has not been deployed

No deployments
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