Skip to content

Fix #8340: Remove incorrect minus sign in rotate_range documentation#8773

Open
yunhaoli24 wants to merge 1 commit intoProject-MONAI:devfrom
yunhaoli24:fix-8340-rotate-range-doc
Open

Fix #8340: Remove incorrect minus sign in rotate_range documentation#8773
yunhaoli24 wants to merge 1 commit intoProject-MONAI:devfrom
yunhaoli24:fix-8340-rotate-range-doc

Conversation

@yunhaoli24
Copy link

Summary

  • Fixed incorrect minus sign in rotate_range parameter documentation
  • The documentation incorrectly showed uniform[-rotate_range[i][0], rotate_range[i][1])
  • The actual implementation uses uniform(f[0], f[1]) without negation on the first parameter
  • Fixed across 7 locations in both array and dictionary transforms

Changes

  • Updated documentation in monai/transforms/spatial/array.py:
    • RandAffineGrid (line 1851)
    • RandAffine (line 2389)
    • Rand2DElastic (line 2659)
    • Rand3DElastic (line 2827)
  • Updated documentation in monai/transforms/spatial/dictionary.py:
    • RandAffined (line 1064)
    • Rand2DElasticd (line 1249)
    • Rand3DElasticd (line 1399)

Types of changes

  • Documentation update

Fixes #8340

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f1741b55-a68a-4ec4-a8e0-c41b1e87a7fd

📥 Commits

Reviewing files that changed from the base of the PR and between f87d2b5 and 2ab5653.

📒 Files selected for processing (2)
  • monai/transforms/spatial/array.py
  • monai/transforms/spatial/dictionary.py
✅ Files skipped from review due to trivial changes (1)
  • monai/transforms/spatial/array.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • monai/transforms/spatial/dictionary.py

📝 Walkthrough

Walkthrough

Docstrings were corrected to fix the rotation parameter range description across spatial transforms. The updated docs remove an incorrect negation so rotation values are documented as sampled from uniform[rotate_range[i][0], rotate_range[i][1]) instead of uniform[-rotate_range[i][0], rotate_range[i][1]). Changes touch array-based transforms (RandAffineGrid, RandAffine, Rand2DElastic) and dictionary-based transforms (RandAffined, Rand2DElasticd, Rand3DElasticd). No code logic, signatures, or behavior were modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: fixing an incorrect minus sign in rotate_range documentation, matching the actual changeset.
Description check ✅ Passed The description is complete with summary, specific changes, affected locations, and change type marked appropriately against the provided template.
Linked Issues check ✅ Passed The PR fully addresses issue #8340 by removing the erroneous minus sign from rotate_range documentation across all seven identified locations in both array and dictionary transforms.
Out of Scope Changes check ✅ Passed All changes are strictly documentation updates to rotate_range parameter descriptions with no code logic changes, directly addressing the linked issue scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ocumentation

Remove the extra minus sign in rotate_range[i][0] that was
incorrectly documented across multiple transform classes.
The actual implementation uses uniform(f[0], f[1]) without
any negation on the first parameter.

Affected transforms:
- RandAffineGrid, RandAffine
- Rand2DElastic, Rand3DElastic
- RandAffined, Rand2DElasticd, Rand3DElasticd

Signed-off-by: li.yunhao <li.yunhao@foxmail.com>
@yunhaoli24 yunhaoli24 force-pushed the fix-8340-rotate-range-doc branch from f87d2b5 to 2ab5653 Compare March 12, 2026 06:33
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.

Doc for rotate_range indicates the wrong sign

1 participant