Skip to content

docs: add summary lines to 8 from_* array-library converter docstrings#4136

Draft
TaiSakuma wants to merge 2 commits into
scikit-hep:mainfrom
TaiSakuma:docs-from-arraylib-docstrings
Draft

docs: add summary lines to 8 from_* array-library converter docstrings#4136
TaiSakuma wants to merge 2 commits into
scikit-hep:mainfrom
TaiSakuma:docs-from-arraylib-docstrings

Conversation

@TaiSakuma

Copy link
Copy Markdown
Member

Summary

Rolls the pilot from #3946 out to the 8 operations in the from_* array-library converters batch of #3980:

from_numpy, from_cupy, from_jax, from_torch, from_tensorflow, from_raggedtensor, from_dlpack, from_rdataframe.

Each docstring now has:

  • A one-line summary on the opening """.
  • Returns: and Examples: section headers (the latter only where examples exist).

Original body text is preserved; only structural edits are applied. The summary lines were reviewed against the checklist posted in #3980.

Summary lines

Operation Summary
ak.from_numpy Converts a NumPy array into an Awkward Array.
ak.from_cupy Converts a CuPy array into an Awkward Array.
ak.from_jax Converts a JAX Array into an Awkward Array.
ak.from_torch Converts a PyTorch Tensor into an Awkward Array.
ak.from_tensorflow Converts a TensorFlow Tensor into an Awkward Array.
ak.from_raggedtensor Converts a TensorFlow RaggedTensor into an Awkward Array.
ak.from_dlpack Converts a DLPack-aware array into an Awkward Array.
ak.from_rdataframe Converts ROOT RDataFrame columns into an Awkward Array.

Notes for reviewers

  • All 8 summaries are verbatim lifts of the existing lead sentences, which already matched the mirrored phrasing contract with the to_* siblings ("Converts a/an into an Awkward Array.").
  • Pre-existing quirk left verbatim: ak_from_jax.py's "See also" line references #ak.from_jax itself (likely meant #ak.from_cupy).

Test plan

  • pre-commit passes locally on the modified files (ruff check, ruff format, codespell, mypy).
  • Mechanical validation: code outside docstrings byte-identical; Args: blocks and doctests byte-identical; no original narrative text lost.
  • Sphinx docs build cleanly on CI.
  • Rendered docstrings spot-checked in the docs preview.

Part of #3980. Draft for initial review; will mark ready once CI passes and the preview is checked.

AI assistance disclosure

Drafted with Claude Code: summaries drafted by Claude Sonnet 4.6, adversarially verified against the implementations by independent Claude Opus 4.8 agents, mechanically validated (docstring-only changes, original text preserved), and reviewed by a human before submission.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

Add a Google-style one-line summary and `Returns:`/`Examples:` section
headers to the 8 from_* array-library converters in
`src/awkward/operations/`: from_numpy, from_cupy, from_jax, from_torch,
from_tensorflow, from_raggedtensor, from_dlpack, from_rdataframe.

Follows the pilot in scikit-hep#3946 on `ak.flatten`. Original body text is
preserved; only structural edits are applied.

Refs scikit-hep#3980.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.42%. Comparing base (b025b0b) to head (674f1fc).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/operations/ak_from_cupy.py 100.00% <ø> (ø)
src/awkward/operations/ak_from_dlpack.py 70.00% <ø> (ø)
src/awkward/operations/ak_from_jax.py 100.00% <ø> (ø)
src/awkward/operations/ak_from_numpy.py 100.00% <ø> (ø)
src/awkward/operations/ak_from_raggedtensor.py 22.72% <ø> (ø)
src/awkward/operations/ak_from_rdataframe.py 92.00% <ø> (ø)
src/awkward/operations/ak_from_tensorflow.py 27.58% <ø> (ø)
src/awkward/operations/ak_from_torch.py 29.16% <ø> (ø)

... and 7 files with indirect coverage changes

@github-actions github-actions Bot added the type/docs PR title type: docs (set automatically) label Jun 13, 2026
…#3980.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TaiSakuma

Copy link
Copy Markdown
Member Author

Follow-up per @ikrommyd's review on #4130: the Returns: sections now describe the returned object (a noun phrase) rather than restating the operation. Final Returns: lines for this batch:

Returns

Operation Returns
ak.from_numpy An #ak.Array built from the given NumPy array.
ak.from_cupy An #ak.Array built from the given CuPy array.
ak.from_jax An #ak.Array built from the given JAX array.
ak.from_torch An #ak.Array built from the given PyTorch tensor.
ak.from_tensorflow An #ak.Array built from the given TensorFlow Tensor.
ak.from_raggedtensor An #ak.Array built from the given TensorFlow RaggedTensor.
ak.from_dlpack An #ak.Array built from the given DLPack-aware array.
ak.from_rdataframe An #ak.Array built from the given ROOT RDataFrame columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/docs PR title type: docs (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant