MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

Fix incorrect docstring defaults for DiffusionModelUNet

Open eitag-uni opened this issue 3 months ago • 4 comments

Fixes # Fix incorrect defaults for use_combined_linear and add default for use_flash_attention in docstring

Description

The DiffusionModelUNet docstring listed use_combined_linear as default True, while the class signature sets it to False. It also omitted the default for use_flash_attention, which is False in the signature. This PR updates the Args section to match the actual defaults.

Types of changes

  • [x] Non-breaking change (fix or new feature that would not break existing functionality).
  • [x] Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • [x] Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • [x] In-line docstrings updated.
  • [x] Documentation updated, tested make html command in the docs/ folder.

eitag-uni avatar Sep 15 '25 11:09 eitag-uni

Walkthrough

Docstring updates in monai/networks/nets/diffusion_model_unet.py for DiffusionModelUNet. Corrected documented default of use_combined_linear to False and clarified use_flash_attention default as False. No code, signature, behavior, or control-flow changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly and accurately describes the primary change — correcting docstring defaults for DiffusionModelUNet — and is concise and specific enough for repository history.
Description Check ✅ Passed The PR description follows the repository template and clearly explains the change, test results, and documentation updates, but the leading "Fixes #" line is incomplete (no issue number) and should reference an issue or be removed to fully match the template.
✨ Finishing touches
  • [ ] 📝 Generate Docstrings
🧪 Generate unit tests
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 44bbd54721d4e1196b9b7da8ae492c44895559e1 and d099b9d113b9156c6cce8ac4e5942e27529678be.

📒 Files selected for processing (1)
  • monai/networks/nets/diffusion_model_unet.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • monai/networks/nets/diffusion_model_unet.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: quick-py3 (ubuntu-latest)
  • GitHub Check: quick-py3 (windows-latest)
  • GitHub Check: packaging
  • GitHub Check: quick-py3 (macOS-latest)
  • GitHub Check: flake8-py3 (codeformat)
  • GitHub Check: build-docs
  • GitHub Check: flake8-py3 (mypy)
  • GitHub Check: flake8-py3 (pytype)
  • GitHub Check: min-dep-pytorch (2.8.0)
  • GitHub Check: min-dep-os (ubuntu-latest)
  • GitHub Check: min-dep-pytorch (2.6.0)
  • GitHub Check: min-dep-os (macOS-latest)
  • GitHub Check: min-dep-os (windows-latest)
  • GitHub Check: min-dep-py3 (3.9)
  • GitHub Check: min-dep-pytorch (2.7.1)
  • GitHub Check: min-dep-pytorch (2.5.1)
  • GitHub Check: min-dep-py3 (3.10)
  • GitHub Check: min-dep-py3 (3.12)
  • GitHub Check: min-dep-py3 (3.11)

[!TIP]

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

coderabbitai[bot] avatar Sep 15 '25 11:09 coderabbitai[bot]

/build

KumoLiu avatar Oct 10 '25 03:10 KumoLiu

/build

KumoLiu avatar Oct 10 '25 05:10 KumoLiu

/build

KumoLiu avatar Oct 13 '25 03:10 KumoLiu