Skip to content

Commit 860b7c3

Browse files
authored
Fix B026 unrecommanded star-arg unpacking after a keyword argument (#7262)
Fixes #7261 ### Description Remove star-arg unpacking before a keyword argument. ### 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: KumoLiu <yunl@nvidia.com>
1 parent 8e134b8 commit 860b7c3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

monai/data/image_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ def read(self, data: Sequence[PathLike] | PathLike, **kwargs) -> Sequence[Any] |
13001300
kwargs_ = self.kwargs.copy()
13011301
kwargs_.update(kwargs)
13021302
for name in filenames:
1303-
nrrd_image = NrrdImage(*nrrd.read(name, index_order=self.index_order, *kwargs_))
1303+
nrrd_image = NrrdImage(*nrrd.read(name, index_order=self.index_order, **kwargs_))
13041304
img_.append(nrrd_image)
13051305
return img_ if len(filenames) > 1 else img_[0]
13061306

monai/inferers/inferer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,10 @@ def __call__(
584584
return super().__call__(
585585
inputs,
586586
network,
587+
*args,
587588
device=inputs.device if gpu_stitching else torch.device("cpu"),
588589
buffer_steps=buffer_steps if buffered_stitching else None,
589590
buffer_dim=buffer_dim,
590-
*args,
591591
**kwargs,
592592
)
593593
except RuntimeError as e:

tests/test_video_datasets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_video_source(self):
3939
return self.video_source
4040

4141
def get_ds(self, *args, **kwargs) -> VideoDataset:
42-
return self.ds(video_source=self.get_video_source(), transform=TRANSFORMS, *args, **kwargs) # type: ignore
42+
return self.ds(*args, video_source=self.get_video_source(), transform=TRANSFORMS, **kwargs) # type: ignore
4343

4444
@unittest.skipIf(has_cv2, "Only tested when OpenCV not installed.")
4545
def test_no_opencv_raises(self):

0 commit comments

Comments
 (0)