Skip to content

Add descriptive docstrings and full type annotations - #30

Merged
aarmey merged 1 commit into
mainfrom
docs/docstrings-and-annotations
Aug 26, 2026
Merged

Add descriptive docstrings and full type annotations#30
aarmey merged 1 commit into
mainfrom
docs/docstrings-and-annotations

Conversation

@aarmey

@aarmey aarmey commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Give every function in valentbind/model.py (Req_polyfc, Req_polyc, commonChecks, polyfc, Req_solve, polyc) a docstring describing what it does, its parameters, and its return value, and complete parameter/return type annotations.
  • Do the same for the test helpers in valentbind/test/test_model.py (genPerm, multinomial, polyfc2) and add one-line docstrings + -> None to the four test functions.
  • A few previously loose npt.ArrayLike annotations became jax.Array where the value is already a converted array by the point it's used — this is what a type checker needs to verify the arithmetic inside Req_polyfc/Req_polyc/Req_solve.

Test plan

  • uv run ruff check . / uv run ruff format --check . pass
  • uvx ty check valentbind passes with the new annotations
  • uv run pytest --cov=valentbind — 100% coverage, 4 passed

Every function in valentbind/model.py and its test helpers now has a
docstring describing its purpose, parameters, and return value, plus
complete parameter/return type annotations. Tightened a few loose
npt.ArrayLike annotations to jax.Array where the value is already a
converted array by the point it's used, which is what ty needed to
verify the arithmetic in Req_polyfc/Req_polyc/Req_solve.
@aarmey
aarmey merged commit 0692016 into main Aug 26, 2026
0 of 2 checks passed
@aarmey
aarmey deleted the docs/docstrings-and-annotations branch August 26, 2026 13:40
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