diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml index 745497b..71e7022 100644 --- a/.github/workflows/test-ci.yml +++ b/.github/workflows/test-ci.yml @@ -28,6 +28,18 @@ jobs: shell: bash run: ruff check src + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 + test-suite: runs-on: ${{ matrix.os }} needs: linter-check diff --git a/README.rst b/README.rst index 63235d9..d95a21a 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ It includes several local-low-rank based denoising methods (see the `documentati 4. Optimal Thresholding 5. Raw Singular Value Thresholding -A mathematical description of theses methods is available in the documentation. +A mathematical description of these methods is available in the documentation. @@ -58,7 +58,7 @@ After installing you can use the ``patch-denoise`` command-line. $ patch-denoise input_file.nii output_file.nii --mask="auto" -See ``patch-denoise --help`` for detailled options. +See ``patch-denoise --help`` for detailed options. Documentation and Examples ========================== diff --git a/docs/denoisers.rst b/docs/denoisers.rst index 4b94898..a6c7fbb 100644 --- a/docs/denoisers.rst +++ b/docs/denoisers.rst @@ -1,7 +1,7 @@ LLR Denoising Methods ===================== -Patch-denoise implemement several local-low-rank methods, based on singular values thresholding. +Patch-denoise implement several local-low-rank methods, based on singular values thresholding. Singular Value Thresholding diff --git a/pyproject.toml b/pyproject.toml index efec10b..9de56c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "patch-denoise" -description = "Denoising method for sequence of images or volumes. Primarly targeting fMRI data." +description = "Denoising method for sequence of images or volumes. Primarily targeting fMRI data." authors = [{name="Pierre-antoine Comby", email="pierre-antoine.comby@crans.org"}] readme = "README.rst" @@ -29,12 +29,14 @@ classifiers = [ [project.optional-dependencies] optional = ["modopt", "nipype", "numba"] test = ["pytest", "pytest-cov", "pytest-xdist", "pytest-sugar"] + doc = [ "pydata-sphinx-theme", "numpydoc", "sphinx_gallery", "sphinx", ] + dev = ["black", "isort", "ruff"] [project.scripts] @@ -80,3 +82,10 @@ addopts = [ "--cov-report=term-missing", "--cov-report=xml" ] + +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*' +check-hidden = true +ignore-regex = '\bND\b' +ignore-words-list = 'fro' diff --git a/src/patch_denoise/bindings/cli.py b/src/patch_denoise/bindings/cli.py index b241df5..ea5890c 100644 --- a/src/patch_denoise/bindings/cli.py +++ b/src/patch_denoise/bindings/cli.py @@ -182,6 +182,7 @@ def _get_parser(): ), default=None, ) + denoising_group.add_argument( "--extra", metavar="key=value", diff --git a/src/patch_denoise/bindings/utils.py b/src/patch_denoise/bindings/utils.py index f5c9835..a89df69 100644 --- a/src/patch_denoise/bindings/utils.py +++ b/src/patch_denoise/bindings/utils.py @@ -114,7 +114,7 @@ def __str__(self): def load_as_array(input): - """Load a file as a numpy array, and return affine matrix if avaiable.""" + """Load a file as a numpy array, and return affine matrix if available.""" import nibabel as nib if input is None: diff --git a/src/patch_denoise/space_time/base.py b/src/patch_denoise/space_time/base.py index 0910509..a9b5b45 100644 --- a/src/patch_denoise/space_time/base.py +++ b/src/patch_denoise/space_time/base.py @@ -267,7 +267,7 @@ def denoise(self, input_data, mask=None, mask_threshold=50, progbar=None): # # Replace all nan by mean value of patch. # # FIXME this behaviour should be documented - # # And ideally choosen by the user. + # # And ideally chosen by the user. # patch[np.isnan(patch)] = np.mean(patch) # p_denoise, maxidx, noise_var = self._patch_processing( diff --git a/src/patch_denoise/space_time/lowrank.py b/src/patch_denoise/space_time/lowrank.py index 923fab1..78b1110 100644 --- a/src/patch_denoise/space_time/lowrank.py +++ b/src/patch_denoise/space_time/lowrank.py @@ -40,7 +40,7 @@ def __init__(self, patch_shape, patch_overlap, threshold_scale, **kwargs): self.input_denoising_kwargs["threshold_scale"] = threshold_scale def _patch_processing(self, patch, patch_idx=None, threshold_scale=1.0): - """Process a pach with the MP-PCA method.""" + """Process a patch with the MP-PCA method.""" p_center, eig_vals, eig_vec, p_tmean = eig_analysis(patch) maxidx = 0 meanvar = np.mean(eig_vals) @@ -102,7 +102,7 @@ def denoise( return super().denoise(input_data, mask, mask_threshold, progbar=progbar) def _patch_processing(self, patch, patch_idx=None, var_apriori=None): - """Process a pach with the Hybrid-PCA method.""" + """Process a patch with the Hybrid-PCA method.""" varest = np.mean(var_apriori.get_patch(patch_idx)) p_center, eig_vals, eig_vec, p_tmean = eig_analysis(patch) maxidx = 0 @@ -168,7 +168,7 @@ def denoise( return super().denoise(input_data, mask, mask_threshold, progbar=progbar) def _patch_processing(self, patch, patch_idx=None, **kwargs): - """Process a pach with the simple SVT method.""" + """Process a patch with the simple SVT method.""" # Centering for better precision in SVD u_vec, s_values, v_vec, p_tmean = svd_analysis(patch)