Skip to content

[rllib] Hand-fix the four D212 docstrings the auto-fix would mis-render - #67625

Merged
pseudo-rnd-thoughts merged 1 commit into
masterfrom
doc-1917-rllib-d212-hand-fixes
Nov 3, 2026
Merged

pseudo-rnd-thoughts merged 1 commit into
masterfrom
doc-1917-rllib-d212-hand-fixes

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

#67538 applied ruff's D212, D200, and D210 auto-fixes to python/ray/rllib/. It left four D212 violations in place because the auto-fix would change what they render as. This PR fixes them by hand so a later config PR can turn on D212.

Each docstring now has a summary on the opening quotes, with the existing material kept below it unchanged:

  • policy/sample_batch.py MultiAgentBatch.size_bytes had only a Returns: block. It now opens with a summary line that mirrors SampleBatch.size_bytes.
  • models/tf/layers/multi_head_attention.py and models/torch/modules/multi_head_attention.py module docstrings get a summary above the existing hanging-indent citation.
  • examples/algorithms/bc/benchmark_rlunplugged_atari_pong_bc.py module docstring gets a summary and a lead-in above the existing schema={ block, which keeps its original indentation.

For each docstring, the text ast.get_docstring returns before this change is an exact suffix of the text it returns after, so the only rendered change is the added summary.

Testing

  • uvx [email protected] check --select D212 --config 'lint.pydocstyle.convention="google"' on the four changed files: all checks passed.
  • python ci/ray_ci/doc/check_docstring_only.py --base upstream/master: docstring-only guard: 4 file(s), docstrings only.
  • pre-commit run --from-ref upstream/master --to-ref HEAD, including ruff, black, pydoclint, and the docstyle hook: passed.

No open PR covers these docstrings. gh pr list --search "D212 rllib" returns only the core-tree PR #67540.

AI assistance (Claude Code) was used to prepare this PR.

🤖 Generated with Claude Code

Give each docstring a summary on the opening quotes and keep the
existing material below it, so the D212 rule can be turned on without
changing what these docstrings render as.

MultiAgentBatch.size_bytes had only a Returns: block and now has a
summary line. The two multi_head_attention module docstrings and the
RL Unplugged Atari Pong BC benchmark's module docstring each get a
summary above their existing citation or schema block, which keeps
its original indentation.

@rtd-build

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested a review from a team as a code owner October 30, 2026 17:28
@dstrodtman dstrodtman added rllib RLlib related issues docstring-only Skip heavy library tests for Ray API docstring edits. labels Oct 30, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Nov 3, 2026
@pseudo-rnd-thoughts
pseudo-rnd-thoughts merged commit e6dcf22 into master Nov 3, 2026
7 checks passed
@pseudo-rnd-thoughts
pseudo-rnd-thoughts deleted the doc-1917-rllib-d212-hand-fixes branch November 3, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docstring-only Skip heavy library tests for Ray API docstring edits. go add ONLY when ready to merge, run all tests rllib RLlib related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants