Skip to content

docs: docstrings for core metrics (D1, part 1) - #29

Merged
1 commit merged into
mainfrom
docs/d1-metrics-docstrings
Jul 12, 2026
Merged

docs: docstrings for core metrics (D1, part 1)#29
1 commit merged into
mainfrom
docs/d1-metrics-docstrings

Conversation

@nceglia

@nceglia nceglia commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

First chunk of D1 (public API docstrings): full NumPy-style docstrings for the core tcri.tl analysis API —

  • clonotypic_entropy, phenotypic_entropy — normalized entropies with shapes/units
  • clonality — clonal concentration per phenotype
  • mutual_information — clone–phenotype coupling (with the MI formula)
  • flux — phenotypic movement between two covariates

Each has a one-line summary, full parameter table, Returns with shapes + units, math Notes, See Also, and a runnable Examples block. They render straight into the D11 autodoc reference and mirror the D2 concepts page.

Verification

  • python -m py_compile clean; docstring-only, no behavior change.
  • python -m sphinx -b html docs <out>build succeeded, 0 warnings; the metrics page now shows Parameters/Returns/math (cross-refs to register_model resolve).

Scope

This is part 1. Remaining D1 chunks, in priority order:

  1. preprocessing — register_model, joint_distribution, joint_distribution_posterior
  2. model — TCRIModel (setup_anndata, __init__, train)
  3. plotting / utils — mostly the user-facing entry points (many tcri.pl functions are internal helpers)

🤖 Generated with Claude Code

Full NumPy-style docstrings (summary, parameters, returns with shapes/units,
math definitions, examples) for the core analysis API in tcri.metrics:
clonotypic_entropy, phenotypic_entropy, clonality, mutual_information, flux.
These flow into the D11 autodoc reference and mirror the D2 concepts page.

Docstring-only (no behavior change); docs build clean (0 warnings); math and
cross-references render.

Part of Notion D1 (public API docstrings). Remaining chunks: preprocessing
(register_model, joint_distribution*), model (TCRIModel), then plotting/utils.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nceglia nceglia closed this pull request by merging all changes into main in 725d379 Jul 12, 2026
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