Skip to content

Commit

Permalink
Merge pull request #1 from yarikoptic/enh-codespell
Browse files Browse the repository at this point in the history
Add codespell support (config, workflow) and make it fix some typos
  • Loading branch information
WillForan authored Apr 8, 2024
2 parents a2cfdc1 + d2d6fa5 commit a6398f8
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,.codespellrc
check-hidden = true
# ignore-regex =
# ignore-words-list =
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion 00_dcm-rewrite-from-xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
):
continue

# final protocol wont save out derivatives (e.g. moco, tenesorFA)
# final protocol won't save out derivatives (e.g. moco, tenesorFA)
# skip to save space and time
if re.search('deriv|dwi.*_desc-',row["new_name"]):
print(f'# skipping derivative {row["new_name"]}')
Expand Down
2 changes: 1 addition & 1 deletion entity_ux/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
}
function datatype_update_suffix(){
var dt = document.getElementById('datatype');
// clear even if empyt -- any change is worth reseting things
// clear even if empyt -- any change is worth resetting things
var sel = document.getElementById('suffix');
sel.innerHTML = "<option value=''> </option>";

Expand Down
2 changes: 1 addition & 1 deletion entity_ux/make_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def write_json(fname, data):


"""
build a table indexed by datatype. with list of suffix poperties (display_name, description, entities)
build a table indexed by datatype. with list of suffix properties (display_name, description, entities)
>>> table.keys()
dict_keys(['anat', 'dwi', 'fmap', 'func', 'perf', 'pet'])
>>> table['anat'][0].keys()
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Namer
[`entity_ux/`](entity_ux/) contains a web app to guide naming sequences as an alternative to the [ReproIn Creator Spreedsheet](./ReproIn-creator.xlsx).
[`entity_ux/`](entity_ux/) contains a web app to guide naming sequences as an alternative to the [ReproIn Creator Spreadsheet](./ReproIn-creator.xlsx).

It's live on https://NPACore.github.io/reproin-namer (via github pages w/ `doc/` symlink)

Expand All @@ -9,7 +9,7 @@ It's live on https://NPACore.github.io/reproin-namer (via github pages w/ `doc/`
* [ReproIn](https://dbic-handbook.readthedocs.io/en/latest/mri/reproin.html) sequence name convention/standard
* Siemens' scanner `Dot Cockpit` and `Exam Card` setup [walk through](https://github.com/ReproNim/reproin/blob/master/docs/walkthrough-1.md) (with screenshots)
* automation implemented by [heudiconv](https://github.com/nipy/heudiconv/). See [reproin.py](https://github.com/nipy/heudiconv/blob/master/heudiconv/heuristics/reproin.py)
* [ReproIn Creator Spreedsheet](./ReproIn-creator.xlsx): MRRC template to ReproIn using a formula with per column BIDS key-value pairs. ![sheet with dropdown](ReproInCreator.png)
* [ReproIn Creator Spreadsheet](./ReproIn-creator.xlsx): MRRC template to ReproIn using a formula with per column BIDS key-value pairs. ![sheet with dropdown](ReproInCreator.png)
* [Flywheel Study Design Sheet](https://docs.google.com/spreadsheets/d/1Yd74ewWAk4roA-IBfrQuOSMNR4DPxhB9/edit#gid=1495259008) (cf. [gitlab template folder](https://gitlab.com/flywheel-io/public/bids-client/-/tree/master/flywheel_bids/templates))
* goal is near automated [BIDS](https://bids-specification.readthedocs.io/en/stable/#the-brain-imaging-data-structure) Brain Imaging Data Structure conforming scanner dicom to nifti image+json sidecar name conversion.
* Ideal for input in [fmriprep](https://fmriprep.org/en/stable/)
Expand Down Expand Up @@ -47,7 +47,7 @@ See [`output-filelist.txt`](txt/output-filelist.txt) for full list.
| [`validate.txt`](txt/validate.txt) | `bids-validator` output, using [.bidsignore](bidsignore)|

# Issues
* path `SPA_Luna/20231103lunapilotspa2/sub-20231103lunapilotspa2` has redudant ID folder. Should be `SPA_Luna/sub-20231103lunapilotspa2`?
* path `SPA_Luna/20231103lunapilotspa2/sub-20231103lunapilotspa2` has redundant ID folder. Should be `SPA_Luna/sub-20231103lunapilotspa2`?
* Does not pass bids validation. see [`validate.txt`](txt/validate.txt).
* multiple echos as e.g. `_heudiconv323_e5` instead of `_echo-5`
* no `.json` files!? (see missing in [`output-filelist.txt`](txt/output-filelist.txt))
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# for 01_dcm-bids.sh and imporant to be > than debian12 version 0.13
# for 01_dcm-bids.sh and important to be > than debian12 version 0.13
heudiconv >= 1.0.1

# for 00_dcm-rewrite-from-xlsx.py. but system versions okay
Expand Down

0 comments on commit a6398f8

Please sign in to comment.