Skip to content

Commit

Permalink
Fixed code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakert1 committed Feb 26, 2024
1 parent 420a2d1 commit 7574aa0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions monai/transforms/intensity/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ class RandGaussianNoise(RandomizableTransform):
backend = [TransformBackends.TORCH, TransformBackends.NUMPY]

def __init__(
self, prob: float = 0.1,
mean: float = 0.0,
std: float = 0.1,
dtype: DtypeLike = np.float32,
sample_std: bool = True,
self,
prob: float = 0.1,
mean: float = 0.0,
std: float = 0.1,
dtype: DtypeLike = np.float32,
sample_std: bool = True,
) -> None:
RandomizableTransform.__init__(self, prob)
self.mean = mean
Expand Down
2 changes: 1 addition & 1 deletion monai/transforms/intensity/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(
std: float = 0.1,
dtype: DtypeLike = np.float32,
allow_missing_keys: bool = False,
sample_std: bool = True
sample_std: bool = True,
) -> None:
MapTransform.__init__(self, keys, allow_missing_keys)
RandomizableTransform.__init__(self, prob)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_rand_gaussian_noised.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class TestRandGaussianNoised(NumpyImageTestCase2D):

@parameterized.expand(TESTS)
def test_correct_results(self, _, im_type, keys, mean, std, sample_std):
gaussian_fn = RandGaussianNoised(keys=keys, prob=1.0, mean=mean, std=std, dtype=np.float64, sample_std=sample_std)
gaussian_fn = RandGaussianNoised(
keys=keys, prob=1.0, mean=mean, std=std, dtype=np.float64, sample_std=sample_std
)
gaussian_fn.set_random_state(seed)
im = im_type(self.imt)
noised = gaussian_fn({k: im for k in keys})
Expand Down

0 comments on commit 7574aa0

Please sign in to comment.