docs: docstrings for core metrics (D1, part 1) - #29
Merged
1 commit merged intoJul 12, 2026
Merged
Conversation
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>
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.
Summary
First chunk of D1 (public API docstrings): full NumPy-style docstrings for the core
tcri.tlanalysis API —clonotypic_entropy,phenotypic_entropy— normalized entropies with shapes/unitsclonality— clonal concentration per phenotypemutual_information— clone–phenotype coupling (with the MI formula)flux— phenotypic movement between two covariatesEach has a one-line summary, full parameter table,
Returnswith shapes + units, mathNotes,See Also, and a runnableExamplesblock. They render straight into the D11 autodoc reference and mirror the D2 concepts page.Verification
python -m py_compileclean; 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 toregister_modelresolve).Scope
This is part 1. Remaining D1 chunks, in priority order:
register_model,joint_distribution,joint_distribution_posteriorTCRIModel(setup_anndata,__init__, train)tcri.plfunctions are internal helpers)🤖 Generated with Claude Code