Skip to content

Fix flake8 format in PatchEmbeddingBlock#8742

Merged
KumoLiu merged 3 commits intoProject-MONAI:devfrom
KumoLiu:fix-format
Feb 15, 2026
Merged

Fix flake8 format in PatchEmbeddingBlock#8742
KumoLiu merged 3 commits intoProject-MONAI:devfrom
KumoLiu:fix-format

Conversation

@KumoLiu
Copy link
Contributor

@KumoLiu KumoLiu commented Feb 15, 2026

Description

Fix flake8 format in PatchEmbeddingBlock

Types of changes

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

Signed-off-by: Yun Liu <yunl@nvidia.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

📝 Walkthrough

Walkthrough

Three small edits: (1) In monai/networks/blocks/patchembedding.py a dictionary key formatting changed from "p{i+1}" to "p{i + 1}" (whitespace only). (2) In monai/data/box_utils.py non_max_suppression now sorts boxes by score using a stable sort (stable=True), making ordering deterministic for equal scores. (3) In runtests.sh the pip install of dev requirements adds --no-build-isolation. No public/exported signatures were changed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning Title references PatchEmbeddingBlock formatting, but changes also include box_utils.py and runtests.sh modifications unrelated to the stated focus. Update title to reflect all changes (e.g., 'Fix formatting and stabilize sorting in multiple modules') or scope PR to only PatchEmbeddingBlock.
Description check ⚠️ Warning Description lacks required issue reference and detail on actual changes made across three files; only mentions PatchEmbeddingBlock formatting. Add 'Fixes #' section and describe changes to box_utils.py and runtests.sh; clarify why stable sorting and build isolation flags were added.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into dev

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

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

No actionable comments were generated in the recent review. 🎉


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.

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Feb 15, 2026

/build

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Feb 15, 2026

/build

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Feb 15, 2026


[2026-02-15T13:39:26.832Z] ======================================================================

[2026-02-15T13:39:26.832Z] FAIL: test_value_00 (tests.data.test_box_utils.TestCreateBoxList.test_value_00)

[2026-02-15T13:39:26.832Z] ----------------------------------------------------------------------

[2026-02-15T13:39:26.832Z] Traceback (most recent call last):

[2026-02-15T13:39:26.832Z]   File "/usr/local/lib/python3.12/dist-packages/parameterized/parameterized.py", line 620, in standalone_func

[2026-02-15T13:39:26.832Z]     return func(*(a + p.args), **p.kwargs, **kw)

[2026-02-15T13:39:26.832Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[2026-02-15T13:39:26.832Z]   File "/home/jenkins/agent/workspace/MONAI-premerge/monai/tests/data/test_box_utils.py", line 214, in test_value

[2026-02-15T13:39:26.832Z]     assert_allclose(nms_box, [1, 2, 0], type_test=False)

[2026-02-15T13:39:26.832Z]   File "/home/jenkins/agent/workspace/MONAI-premerge/monai/tests/test_utils.py", line 163, in assert_allclose

[2026-02-15T13:39:26.832Z]     np.testing.assert_allclose(actual, desired, *args, **kwargs)

[2026-02-15T13:39:26.832Z]   File "/usr/local/lib/python3.12/dist-packages/numpy/testing/_private/utils.py", line 1504, in assert_allclose

[2026-02-15T13:39:26.832Z]     assert_array_compare(compare, actual, desired, err_msg=str(err_msg),

[2026-02-15T13:39:26.832Z]   File "/usr/lib/python3.12/contextlib.py", line 81, in inner

[2026-02-15T13:39:26.832Z]     return func(*args, **kwds)

[2026-02-15T13:39:26.832Z]            ^^^^^^^^^^^^^^^^^^^

[2026-02-15T13:39:26.832Z]   File "/usr/local/lib/python3.12/dist-packages/numpy/testing/_private/utils.py", line 797, in assert_array_compare

[2026-02-15T13:39:26.832Z]     raise AssertionError(msg)

[2026-02-15T13:39:26.832Z] AssertionError: 

[2026-02-15T13:39:26.832Z] Not equal to tolerance rtol=1e-07, atol=0

[2026-02-15T13:39:26.832Z] 

[2026-02-15T13:39:26.832Z] Mismatched elements: 2 / 3 (66.7%)

[2026-02-15T13:39:26.832Z] Max absolute difference: 1

[2026-02-15T13:39:26.832Z] Max relative difference: 1.

[2026-02-15T13:39:26.832Z]  x: array([2, 1, 0])

[2026-02-15T13:39:26.832Z]  y: array([1, 2, 0])

[2026-02-15T13:39:26.832Z] 

Signed-off-by: Yun Liu <yunl@nvidia.com>
Signed-off-by: Yun Liu <yunl@nvidia.com>
@KumoLiu
Copy link
Contributor Author

KumoLiu commented Feb 15, 2026

/build

1 similar comment
@KumoLiu
Copy link
Contributor Author

KumoLiu commented Feb 15, 2026

/build

@KumoLiu
Copy link
Contributor Author

KumoLiu commented Feb 15, 2026

Hi @ericspod blossom works now! You can enable it when you have time.

@KumoLiu KumoLiu enabled auto-merge (squash) February 15, 2026 15:15
@ericspod
Copy link
Member

Hi @ericspod blossom works now! You can enable it when you have time.

Thanks for the effort! That should be done now in the branch rules.

@KumoLiu KumoLiu merged commit 1ead27d into Project-MONAI:dev Feb 15, 2026
34 of 35 checks passed
@KumoLiu KumoLiu deleted the fix-format branch February 16, 2026 01:01
Rusheel86 pushed a commit to Rusheel86/MONAI that referenced this pull request Feb 24, 2026
### Description
Fix flake8 format in `PatchEmbeddingBlock`

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Yun Liu <yunl@nvidia.com>
Rusheel86 pushed a commit to Rusheel86/MONAI that referenced this pull request Feb 25, 2026
### Description
Fix flake8 format in `PatchEmbeddingBlock`

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Yun Liu <yunl@nvidia.com>
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.

2 participants