From 87755070dedcb06e13458d0b3fec60d2634e1d07 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 10 May 2022 12:13:29 -0400 Subject: [PATCH] [DATALAD RUNCMD] Run codespell on some obvious hits === Do not change lines below === { "chain": [], "cmd": "codespell -w heudiconv/queue.py heudiconv/parser.py heudiconv/convert.py heudiconv/tests/test_heuristics.py heudiconv/cli/monitor.py heudiconv/heuristics/reproin.py", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- heudiconv/cli/monitor.py | 2 +- heudiconv/convert.py | 4 ++-- heudiconv/heuristics/reproin.py | 2 +- heudiconv/parser.py | 2 +- heudiconv/queue.py | 8 ++++---- heudiconv/tests/test_heuristics.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/heudiconv/cli/monitor.py b/heudiconv/cli/monitor.py index 105ba4b7..ba873460 100644 --- a/heudiconv/cli/monitor.py +++ b/heudiconv/cli/monitor.py @@ -79,7 +79,7 @@ def process(paths2process, db, wait=WAIT_TIME, logdir='log'): def monitor(topdir='/tmp/new_dir', check_ptrn='/20../../..', db=None, wait=WAIT_TIME, logdir='log'): - # make logdir if not existant + # make logdir if not existent try: os.makedirs(logdir) except OSError: diff --git a/heudiconv/convert.py b/heudiconv/convert.py index bf9e6def..d69baa25 100644 --- a/heudiconv/convert.py +++ b/heudiconv/convert.py @@ -51,7 +51,7 @@ def conversion_info(subject, outdir, info, filegroup, ses): continue template, outtype = key[0], key[1] # So no annotation_classes of any kind! so if not used -- what was the - # intension???? XXX + # intention???? XXX outpath = outdir for idx, itemgroup in enumerate(items): if not isinstance(itemgroup, list): @@ -131,7 +131,7 @@ def prep_conversion(sid, dicoms, outdir, heuristic, converter, anon_sid, # ref: https://github.com/nipy/heudiconv/issues/84#issuecomment-330048609 # for more automagical wishes target_heuristic_filename = op.join(idir, 'heuristic.py') - # faciliates change - TODO: remove in 1.0 + # facilitates change - TODO: remove in 1.0 old_heuristic_filename = op.join(idir, op.basename(heuristic.filename)) if op.exists(old_heuristic_filename): assure_no_file_exists(target_heuristic_filename) diff --git a/heudiconv/heuristics/reproin.py b/heudiconv/heuristics/reproin.py index c529ca6d..a8de120d 100644 --- a/heudiconv/heuristics/reproin.py +++ b/heudiconv/heuristics/reproin.py @@ -551,7 +551,7 @@ def infotodict(seqinfo): if isinstance(current_run, int) else current_run) else: - # if there is no _run -- no run label addded + # if there is no _run -- no run label added run_label = None # yoh: had a wrong assumption diff --git a/heudiconv/parser.py b/heudiconv/parser.py index 769739c0..3db1fc2c 100644 --- a/heudiconv/parser.py +++ b/heudiconv/parser.py @@ -71,7 +71,7 @@ def get_extracted_dicoms(fl): # raise ValueError("some but not all input files are tar files") # tarfiles already know what they contain, and often the filenames - # are unique, or at least in a unqiue subdir per session + # are unique, or at least in a unique subdir per session # strategy: extract everything in a temp dir and assemble a list # of all files in all tarballs diff --git a/heudiconv/queue.py b/heudiconv/queue.py index 8e091ca3..d54e91fa 100644 --- a/heudiconv/queue.py +++ b/heudiconv/queue.py @@ -91,7 +91,7 @@ def clean_args(hargs, iterarg, iteridx): is_iterarg = False itercount = 0 - indicies = [] + indices = [] cmdargs = hargs[:] for i, arg in enumerate(hargs): @@ -100,13 +100,13 @@ def clean_args(hargs, iterarg, iteridx): is_iterarg = False if is_iterarg: if iteridx != itercount: - indicies.append(i) + indices.append(i) itercount += 1 if arg in iterarg: is_iterarg = True if arg in queue_args: - indicies.extend([i, i+1]) + indices.extend([i, i+1]) - for j in sorted(indicies, reverse=True): + for j in sorted(indices, reverse=True): del cmdargs[j] return cmdargs diff --git a/heudiconv/tests/test_heuristics.py b/heudiconv/tests/test_heuristics.py index 69008779..99a439e7 100644 --- a/heudiconv/tests/test_heuristics.py +++ b/heudiconv/tests/test_heuristics.py @@ -69,7 +69,7 @@ def test_reproin_largely_smoke(tmpdir, heuristic, invocation): runner(args + ['--subjects', 'sub1', 'sub2']) if heuristic != 'reproin': - # if subject is not overriden, raise error + # if subject is not overridden, raise error with pytest.raises(NotImplementedError): runner(args) return @@ -158,7 +158,7 @@ def test_scout_conversion(tmpdir): # Let's do some basic checks on produced files j = load_json(sespath / 'fmap/sub-phantom1sid1_ses-localizer_acq-3mm_phasediff.json') # We store HeuDiConv version in each produced .json file - # TODO: test that we are not somehow overwritting that version in existing + # TODO: test that we are not somehow overwriting that version in existing # files which we have not produced in a particular run. assert j[HEUDICONV_VERSION_JSON_KEY] == __version__