Skip to content

Comments

Fix docstring typos across codebase#8688

Merged
ericspod merged 3 commits intoProject-MONAI:devfrom
aymuos15:fix/typos
Feb 21, 2026
Merged

Fix docstring typos across codebase#8688
ericspod merged 3 commits intoProject-MONAI:devfrom
aymuos15:fix/typos

Conversation

@aymuos15
Copy link
Contributor

@aymuos15 aymuos15 commented Jan 9, 2026

Summary

I was doing reviews with AI code reviewers and it caught some docstring typos.

  • Fix "nEfficient" to "an Efficient" in downsample.py, upsample.py, utils.py
  • Fix "utilty" to "utility" in utils.py
  • Fix "vaue" to "value" in utils.py
  • Fix "simmily" to "similarly" in unified_focal_loss.py (3 occurrences)
  • Fix "represenation" to "representation" in nacl_loss.py
  • Add missing f-string prefix in image_dissimilarity.py error message

Test plan

  • All modified files import successfully
  • unified_focal_loss.py tests pass (4 passed)
  • nacl_loss.py tests pass (7 passed)
  • Upsample/Downsample block tests pass (177 passed)
  • f-string fix verified - error message now correctly shows num_bins value

Note: These are all non-breaking docstring/comment fixes only.

Fixes the following typos in documentation/comments:

Networks:
- Fix "nEfficient" to "an Efficient" in downsample.py, upsample.py, utils.py
- Fix "utilty" to "utility" in utils.py
- Fix "vaue" to "value" in utils.py

Losses:
- Fix "simmily" to "similarly" in unified_focal_loss.py (3 occurrences)
- Fix "represenation" to "representation" in nacl_loss.py
- Add missing f-string prefix in image_dissimilarity.py error message

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 9, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

This PR makes documentation fixes and one minor runtime-message fix across six files: corrects typos in multiple docstrings (e.g., "nEfficient" → "Efficient", "represenation" → "representation", "utilty" → "utility", "vaue" → "value") and updates a paper title reference. It also changes an error message in GlobalMutualInformationLoss to interpolate and display the actual num_bins value instead of the literal placeholder. No behavioral logic or API signatures were altered.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly and specifically describes the main change—fixing docstring typos across the codebase.
Description check ✅ Passed Description covers all changes with detail, test results, and verification. Template sections are minimally addressed but the core objective is well documented.
Docstring Coverage ✅ Passed Docstring coverage is 87.50% 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 docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

aymuos15 added a commit to aymuos15/MONAI that referenced this pull request Jan 12, 2026
The AffineTransform class was using inconsistent align_corners values:
- to_norm_affine was hardcoded to use align_corners=False
- affine_grid and grid_sample were using self.align_corners (default=True)

This mismatch caused a half-pixel offset between coordinate systems,
leading to incorrect spatial transformations.

Changes:
- Pass self.align_corners to to_norm_affine for consistent behavior
- Update test expected values to reflect corrected behavior
- Add test cases for align_corners consistency verification

Fixes Project-MONAI#8688
aymuos15 added a commit to aymuos15/MONAI that referenced this pull request Jan 12, 2026
The AffineTransform class was using inconsistent align_corners values:
- to_norm_affine was hardcoded to use align_corners=False
- affine_grid and grid_sample were using self.align_corners (default=True)

This mismatch caused a half-pixel offset between coordinate systems,
leading to incorrect spatial transformations.

Changes:
- Pass self.align_corners to to_norm_affine for consistent behavior
- Update test expected values to reflect corrected behavior
- Add test cases for align_corners consistency verification

Fixes Project-MONAI#8688

Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>
Copy link
Member

@ericspod ericspod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@ericspod ericspod enabled auto-merge (squash) February 20, 2026 22:13
@ericspod ericspod disabled auto-merge February 21, 2026 00:03
@ericspod ericspod merged commit 61849bf into Project-MONAI:dev Feb 21, 2026
26 checks passed
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.

3 participants