From 7e89997d7a6c2276ef2c1f9cb941908c336d7109 Mon Sep 17 00:00:00 2001 From: Richard Brown <33289025+rijobro@users.noreply.github.com> Date: Fri, 18 Dec 2020 15:48:31 +0000 Subject: [PATCH] update contributing and normalis* -> normaliz* Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com> --- CONTRIBUTING.md | 2 ++ monai/networks/blocks/acti_norm.py | 2 +- monai/networks/layers/factories.py | 2 +- monai/networks/layers/spatial_transforms.py | 2 +- monai/transforms/compose.py | 2 +- monai/utils/enums.py | 2 +- tests/test_unet.py | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9b610ee64..81c5b32174 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,6 +32,8 @@ _Pull request early_ We encourage you to create pull requests early. It helps us track the contributions under development, whether they are ready to be merged or not. Change your pull request's title to begin with `[WIP]` until it is ready for formal review. +Please note that, as per PyTorch, MONAI uses American English spelling. This means classes and variables should be: normali**z**e, visuali**z**e, colo~~u~~r, etc. + ### Preparing pull requests To ensure the code quality, MONAI relies on several linting tools ([flake8 and its plugins](https://gitlab.com/pycqa/flake8), [black](https://github.com/psf/black), [isort](https://github.com/timothycrosley/isort)), static type analysis tools ([mypy](https://github.com/python/mypy), [pytype](https://github.com/google/pytype)), as well as a set of unit/integration tests. diff --git a/monai/networks/blocks/acti_norm.py b/monai/networks/blocks/acti_norm.py index 585726edf2..ab399d4957 100644 --- a/monai/networks/blocks/acti_norm.py +++ b/monai/networks/blocks/acti_norm.py @@ -80,7 +80,7 @@ def __init__( super().__init__() op_dict = {"A": None, "D": None, "N": None} - # define the normalisation type and the arguments to the constructor + # define the normalization type and the arguments to the constructor if norm is not None: if norm_dim is None and dropout_dim is None: raise ValueError("norm_dim or dropout_dim needs to be specified.") diff --git a/monai/networks/layers/factories.py b/monai/networks/layers/factories.py index 1bb33ed9d7..41b63c55fb 100644 --- a/monai/networks/layers/factories.py +++ b/monai/networks/layers/factories.py @@ -16,7 +16,7 @@ is typically a type but can be any callable producing a layer object. The factory objects contain functions keyed to names converted to upper case, these names can be referred to as members -of the factory so that they can function as constant identifiers. eg. instance normalisation is named `Norm.INSTANCE`. +of the factory so that they can function as constant identifiers. eg. instance normalization is named `Norm.INSTANCE`. For example, to get a transpose convolution layer the name is needed and then a dimension argument is provided which is passed to the factory function: diff --git a/monai/networks/layers/spatial_transforms.py b/monai/networks/layers/spatial_transforms.py index a64b6d2d0a..a6b730278d 100644 --- a/monai/networks/layers/spatial_transforms.py +++ b/monai/networks/layers/spatial_transforms.py @@ -518,7 +518,7 @@ def forward( if spatial_size is not None: dst_size = src_size[:2] + ensure_tuple(spatial_size) - # reverse and normalise theta if needed + # reverse and normalize theta if needed if not self.normalized: theta = to_norm_affine( affine=theta, src_size=src_size[2:], dst_size=dst_size[2:], align_corners=self.align_corners diff --git a/monai/transforms/compose.py b/monai/transforms/compose.py index 20e72f1df0..13d2e640bc 100644 --- a/monai/transforms/compose.py +++ b/monai/transforms/compose.py @@ -194,7 +194,7 @@ class Compose(Randomizable, Transform): set of functions must be called as if it were a sequence. Example: images and labels - Images typically require some kind of normalisation that labels do not. + Images typically require some kind of normalization that labels do not. Both are then typically augmented through the use of random rotations, flips, and deformations. Compose can be used with a series of transforms that take a dictionary diff --git a/monai/utils/enums.py b/monai/utils/enums.py index dbebbe364f..dfb51d18c5 100644 --- a/monai/utils/enums.py +++ b/monai/utils/enums.py @@ -144,7 +144,7 @@ class Weight(Enum): UNIFORM = "uniform" -class Normalisation(Enum): +class Normalization(Enum): """ See also: - :py:class:`monai.networks.nets.ConvNormActi` diff --git a/tests/test_unet.py b/tests/test_unet.py index 5d95e66ba4..ed05fce552 100644 --- a/tests/test_unet.py +++ b/tests/test_unet.py @@ -72,7 +72,7 @@ (16, 3, 32, 64, 48), ] -TEST_CASE_4 = [ # 4-channel 3D, batch 16, batch normalisation +TEST_CASE_4 = [ # 4-channel 3D, batch 16, batch normalization { "dimensions": 3, "in_channels": 4,