From 2a03263aa933b71bbb14808c39f1c826a9f53ded Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 16:24:44 -0400 Subject: [PATCH 1/2] BF: move configuration from codespell invocation in tox into pyproject.toml Apparently typos sneaked in since I had a typo in cubids folder name in tox.ini. tomli is needed to pick up configuration from pyproject.toml --- pyproject.toml | 6 ++++++ tox.ini | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 10b94d6a1..af1647283 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,8 @@ [build-system] requires = ["setuptools >= 40.8.0", "wheel"] + +[tool.codespell] +skip = '*.svg,_version.py,*.pem,*.json,testdata' +# +# ignore-words-list = '' + diff --git a/tox.ini b/tox.ini index 7a89eb01e..e9f887867 100644 --- a/tox.ini +++ b/tox.ini @@ -5,5 +5,6 @@ envlist = codespell skip_install = true deps = codespell~=2.0 + tomli commands = - codespell -D- --skip "_version.py,*.pem,*.json" {posargs} cubds docs notebooks tests + codespell {posargs} From f32dc3868a7b8b14685ecd667598d400218f8bbc Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 16:24:54 -0400 Subject: [PATCH 2/2] [DATALAD RUNCMD] run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- cubids/cli.py | 6 +++--- cubids/cubids.py | 12 ++++++------ cubids/metadata_merge.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cubids/cli.py b/cubids/cli.py index 5aae9dbed..c173a5f49 100644 --- a/cubids/cli.py +++ b/cubids/cli.py @@ -372,7 +372,7 @@ def cubids_group(): def cubids_apply(): - ''' Command Line Interface funciton for applying the tsv changes.''' + ''' Command Line Interface function for applying the tsv changes.''' parser = argparse.ArgumentParser( description="cubids-apply: apply the changes specified in a tsv " @@ -508,7 +508,7 @@ def cubids_apply(): def cubids_datalad_save(): - ''' Command Line Interfcae function for performing datalad save.''' + ''' Command Line Interface function for performing datalad save.''' parser = argparse.ArgumentParser( description="cubids-datalad-save: perform a DataLad save on a BIDS " @@ -614,7 +614,7 @@ def cubids_copy_exemplars(): type=Path, action='store', help='absolute path to the .tsv file that lists one ' - 'subject from each Acqusition Group ' + 'subject from each Acquisition Group ' '(*_AcqGrouping.tsv from the cubids-group output)') parser.add_argument('--use-datalad', action='store_true', diff --git a/cubids/cubids.py b/cubids/cubids.py index bae9236bf..438a0a894 100644 --- a/cubids/cubids.py +++ b/cubids/cubids.py @@ -211,7 +211,7 @@ def apply_tsv_changes(self, summary_tsv, files_tsv, new_prefix, and generates the new tsv files. This function looks at the RenameKeyGroup and MergeInto - columns and modifies the bids datset according to the + columns and modifies the bids dataset according to the specified changs. Parameters: @@ -547,12 +547,12 @@ def copy_exemplars(self, exemplars_dir, exemplars_tsv, min_group_size, ----------- exemplars_dir: str path to the directory that will contain one subject - from each Acqusition Gorup (*_AcqGrouping.tsv) + from each Acquisition Group (*_AcqGrouping.tsv) example path: /Users/Covitz/tsvs/CCNP_Acq_Groups/ exemplars_tsv: str path to the .tsv file that lists one subject - from each Acqusition Group (*_AcqGrouping.tsv + from each Acquisition Group (*_AcqGrouping.tsv from the cubids-group output) example path: /Users/Covitz/tsvs/CCNP_Acq_Grouping.tsv """ @@ -602,7 +602,7 @@ def purge(self, scans_txt, raise_on_error=True): scans_txt: str path to the .txt file that lists the scans you want to be deleted from the dataset, along - with thier associations. + with their associations. example path: /Users/Covitz/CCNP/scans_to_delete.txt """ @@ -735,7 +735,7 @@ def _purge_associations(self, scans): print("Not running any association removals") def get_nifti_associations(self, nifti): - # get all assocation files of a nifti image + # get all association files of a nifti image no_ext_file = str(nifti).split('/')[-1].split('.')[0] associations = [] for path in Path(self.path).rglob("sub-*/**/*.*"): @@ -836,7 +836,7 @@ def get_param_groups_from_key_group(self, key_group): if ret == "erroneous sidecar found": return "erroneous sidecar found" - # add modality to the retun tuple + # add modality to the return tuple l_ret = list(ret) l_ret.append(modality) tup_ret = tuple(l_ret) diff --git a/cubids/metadata_merge.py b/cubids/metadata_merge.py index 6f6af47cf..e09862b3c 100644 --- a/cubids/metadata_merge.py +++ b/cubids/metadata_merge.py @@ -12,7 +12,7 @@ def check_merging_operations(action_tsv, raise_on_error=False): """Checks that the merges in an action tsv are possible. - To be mergable the + To be mergeable the """ actions = pd.read_table(action_tsv) ok_merges = []