Skip to content

Commit

Permalink
[fix] linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ltetrel committed Nov 23, 2023
1 parent 599aa20 commit 932e495
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion monai/transforms/croppad/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,15 @@ def randomize(
raise ValueError("label or image must be provided to infer the output spatial shape.")
img_shape = img.peek_pending_shape() if isinstance(image, MetaTensor) else img.shape[1:]
self.centers = generate_label_classes_crop_centers(
self.spatial_size, self.num_samples, _shape, indices_, img_shape, self.ratios, self.R, self.allow_smaller, self.warn
self.spatial_size,
self.num_samples,
_shape,
indices_,
img_shape,
self.ratios,
self.R,
self.allow_smaller,
self.warn,
)

@LazyTransform.lazy.setter # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion monai/transforms/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ def generate_label_classes_crop_centers(
if img_spatial_shape is None:
img_spatial_shape = label_spatial_shape
if warn:
warnings.warn(f"img_spatial_shape not defined, expect invalid shape for samples.")
warnings.warn("img_spatial_shape not defined, expect invalid shape for samples.")

if num_samples < 1:
raise ValueError(f"num_samples must be an int number and greater than 0, got {num_samples}.")
Expand Down

0 comments on commit 932e495

Please sign in to comment.