Skip to content

Commit

Permalink
Codespell: a workflow to prevent typos
Browse files Browse the repository at this point in the history
* Added a github action to codespell main on push and PRs
* Add rudimentary codespell config
* Add some file ignores
  • Loading branch information
yarikoptic authored Aug 21, 2023
1 parent ddcd11c commit 9034678
Show file tree
Hide file tree
Showing 45 changed files with 130 additions and 103 deletions.
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = .git,*.pdf,*.svg,analysis_pipelines_full_descriptions.tsv
# softwares - key in data structures etc
ignore-words-list = te,fpr,fwe,softwares
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
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@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ General guidelines can be found [here](https://docs.github.com/en/get-started/qu
## Reproduce a pipeline :keyboard:
:thinking: Not sure which one to start with ? You can have a look on [this table](https://github.com/Inria-Empenn/narps_open_pipelines/wiki/pipeline_status) giving the work progress status for each pipeline. This will help choosing the one that best suits you!

Need more information ? You can have a look to the pipeline decription [here](https://docs.google.com/spreadsheets/d/1FU_F6kdxOD4PRQDIHXGHS4zTi_jEVaUqY_Zwg0z6S64/edit?usp=sharing). Also feel free to use the `narps_open.utils.description` module of the project, as described [in the documentation](/docs/description.md).
Need more information ? You can have a look to the pipeline description [here](https://docs.google.com/spreadsheets/d/1FU_F6kdxOD4PRQDIHXGHS4zTi_jEVaUqY_Zwg0z6S64/edit?usp=sharing). Also feel free to use the `narps_open.utils.description` module of the project, as described [in the documentation](/docs/description.md).

When you are ready, [start an issue](https://github.com/Inria-Empenn/narps_open_pipelines/issues/new/choose) and choose **Pipeline reproduction**!

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To get the pipelines running, please follow the installation steps in [INSTALL.m

### Contributing

:wave: Any help is welcome ! Follow the guidelines in [CONTRIBUTING.md](/CONTRIBUTING.md) if you wish to get involed !
:wave: Any help is welcome ! Follow the guidelines in [CONTRIBUTING.md](/CONTRIBUTING.md) if you wish to get involved !

## References

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Here are the available topics :

* :runner: [running](/docs/running.md) tells you how to run pipelines in NARPS open pipelines
* :brain: [data](/docs/data.md) contains intructions to handle the data needed by the project
* :hammer_and_wrench: [environment](/docs/environment.md) contains intructions to handle the software environment needed by the project
* :brain: [data](/docs/data.md) contains instructions to handle the data needed by the project
* :hammer_and_wrench: [environment](/docs/environment.md) contains instructions to handle the software environment needed by the project
* :goggles: [description](/docs/description.md) tells you how to get convenient descriptions of the pipelines, as written by the teams involved in NARPS.
* :microscope: [testing](/docs/testing.md) details the testing features of the project, i.e.: how is the code tested ?
* :package: [ci-cd](/docs/ci-cd.md) contains the information on how continuous integration and delivery (knowned as CI/CD) is set up.
Expand Down
7 changes: 4 additions & 3 deletions docs/ci-cd.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# :package: Continuous Integration (CI) and Continuous Deployment (CD) for the NARPS open pipelines project

:mega: This file descripes how CI/CD works for the project.
:mega: This file describes how CI/CD works for the project.

## :octopus: CI on GitHub

GitHub allows to launch CI workflows using [Actions](https://docs.github.com/en/actions).

See GitHub's documentation on [worflow syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) to write your own workflows.
See GitHub's documentation on [workflow syntax](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions) to write your own workflows.

These worflows are YAML files, located in the `.github/workflows/` directory.
These workflows are YAML files, located in the `.github/workflows/` directory.

### CI scheme

Expand All @@ -35,6 +35,7 @@ For now, the following workflows are set up:
| Name / File | What does it do ? | When is it launched ? | Where does it run ? | How can I see the results ? |
| ----------- | ----------- | ----------- | ----------- | ----------- |
| [code_quality](/.github/workflows/code_quality.yml) | A static analysis of the python code (see the [testing](/docs/testing.md) topic of the documentation for more information). | For every push or pull_request if there are changes on `.py` files. | On GitHub servers. | Outputs (logs of pylint) are stored as [downloadable artifacts](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts) during 15 days after the push. |
| [codespell](/.github/workflows/codespell.yml) | A static analysis of the text files for commonly made typos using [codespell](codespell-project/codespell: check code for common misspellings). | For every push or pull_request to the `maint` branch. | On GitHub servers. | Outputs (logs of codespell) are stored as [downloadable artifacts](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts) during 15 days after the push. |
| [pipeline_tests](/.github/workflows/pipelines.yml) | Runs all the tests for changed pipelines. | For every push or pull_request, if a pipeline file changed. | On Empenn runners. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. |
| [test_changes](/.github/workflows/test_changes.yml) | It runs all the changed tests for the project. | For every push or pull_request, if a test file changed. | On Empenn runners. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. |
| [unit_testing](/.github/workflows/unit_testing.yml) | It runs all the unit tests for the project (see the [testing](/docs/testing.md) topic of the documentation for more information). | For every push or pull_request, if a file changed inside `narps_open/`, or a file related to test execution. | On GitHub servers. | Outputs (logs of pytest) are stored as downloadable artifacts during 15 days after the push. |
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ configuration.config_file = '/path/to/my/own/configuration/file.toml'

Configuration files must conform with the [TOML](https://toml.io/en/) format. See this [article](https://realpython.com/python-toml/#use-toml-as-a-configuration-format) on Real Python to know more about configuration files with TOML.

For python versions below 3.11, we use [tomli](https://pypi.org/project/tomli/) as a dependancy for parsing TOML. Starting from python 3.11, [tomllib](https://docs.python.org/3/library/tomllib.html) is included in the Standard Library and would replace tomli.
For python versions below 3.11, we use [tomli](https://pypi.org/project/tomli/) as a dependency for parsing TOML. Starting from python 3.11, [tomllib](https://docs.python.org/3/library/tomllib.html) is included in the Standard Library and would replace tomli.
4 changes: 2 additions & 2 deletions docs/description.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Access the descriptions of NARPS teams pipelines

The file `narps_open/data/description/analysis_pipelines_full_descriptions.tsv` contains the description provided by each team participating to NARPS.
It is a convertion into tsv format (tab-separated values) of the [original .xlsx file published in NARPS](https://github.com/poldrack/narps/blob/1.0.1/ImageAnalyses/metadata_files/analysis_pipelines_for_analysis.xlsx
It is a conversion into tsv format (tab-separated values) of the [original .xlsx file published in NARPS](https://github.com/poldrack/narps/blob/1.0.1/ImageAnalyses/metadata_files/analysis_pipelines_for_analysis.xlsx
), which allows easier parsing with python.

The file `narps_open/data/description/analysis_pipelines_derived_descriptions.tsv` contains for each team a set of programatically usable data based on the textual descriptions of the previous file. This data is available in the `derived` sub dictionary (see examples hereafter).
The file `narps_open/data/description/analysis_pipelines_derived_descriptions.tsv` contains for each team a set of programmatically usable data based on the textual descriptions of the previous file. This data is available in the `derived` sub dictionary (see examples hereafter).

The class `TeamDescription` of module `narps_open.data.description` acts as a parser for these two files.

Expand Down
10 changes: 5 additions & 5 deletions docs/pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ The `narps_open.pipelines.Pipeline` class declares abstract methods that must be

```python
def get_preprocessing(self):
""" Return a Nipype worflow describing the prerpocessing part of the pipeline """
""" Return a Nipype workflow describing the prerpocessing part of the pipeline """

def get_run_level_analysis(self):
""" Return a Nipype worflow describing the run level analysis part of the pipeline """
""" Return a Nipype workflow describing the run level analysis part of the pipeline """

def get_subject_level_analysis(self):
""" Return a Nipype worflow describing the subject level analysis part of the pipeline """
""" Return a Nipype workflow describing the subject level analysis part of the pipeline """

def get_group_level_analysis(self):
""" Return a Nipype worflow describing the group level analysis part of the pipeline """
""" Return a Nipype workflow describing the group level analysis part of the pipeline """
```

If one of these four steps was not performed by the team, simply make the corresponding method return `None`. Here is an example:
Expand Down Expand Up @@ -89,7 +89,7 @@ def get_group_level_outputs(self):
""" Return the names of the files the group level analysis is supposed to generate. """
```

:warning: Do not declare the method if no files are generated by the corresponding step. For exemple, if no preprocessing was done by the team, the `get_preprocessing_outputs` method must not be implemented.
:warning: Do not declare the method if no files are generated by the corresponding step. For example, if no preprocessing was done by the team, the `get_preprocessing_outputs` method must not be implemented.

You should use other pipeline attributes to generate the lists of outputs dynamically. E.g.:

Expand Down
2 changes: 1 addition & 1 deletion docs/status.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Access the work progress status pipelines

The class `PipelineStatusReport` of module `narps_open.utils.status` allows to create a report containing the following informations for each pipeline:
The class `PipelineStatusReport` of module `narps_open.utils.status` allows to create a report containing the following information for each pipeline:
* the software it uses (collected from the `categorized_for_analysis.analysis_SW` of the [team description](/docs/description.md)) ;
* whether it uses data from fMRIprep or not ;
* a list of issues related to it (the opened issues of the project that have the team ID inside their title or description) ;
Expand Down
6 changes: 3 additions & 3 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :microscope: How to test NARPS open pipelines ?

:mega: This file descripes the test suite and features for the project.
:mega: This file describes the test suite and features for the project.

## Static analysis

Expand Down Expand Up @@ -46,7 +46,7 @@ Tests can be launched manually or while using CI (Continuous Integration).

The main idea is to create one test file per source module (eg.: *tests/pipelines/test_pipelines.py* contains all the unit tests for the module `narps_open.pipelines`).

Each test file defines a class (in the example: `TestPipelines`), in which each test is written in a static method begining with `test_`.
Each test file defines a class (in the example: `TestPipelines`), in which each test is written in a static method beginning with `test_`.

Finally we use one or several `assert` ; each one of them making the whole test fail if the assertion is False. One can also use the `raises` method of pytest, writing `with raises(Exception):` to test if a piece of code raised the expected Exception. See the reference [here](https://docs.pytest.org/en/6.2.x/reference.html?highlight=raises#pytest.raises).

Expand All @@ -59,7 +59,7 @@ Use pytest [markers](https://docs.pytest.org/en/7.1.x/example/markers.html) to i

## Save time by downsampling data

Running pipelines over all the subjects is time and resource consuming. Ideally, this could be done only once we are confident that the pipeline is correcly reproduced, just to make sure the final values of correlations between original team results and the reproduced ones are above the expected thresholds.
Running pipelines over all the subjects is time and resource consuming. Ideally, this could be done only once we are confident that the pipeline is correctly reproduced, just to make sure the final values of correlations between original team results and the reproduced ones are above the expected thresholds.

But most of the time we need to run pipelines earlier in the development process, and for this step we need a (quick) answer whether it is going the right way or not.

Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_2T6S.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"This notebook reproduce the analysis made by team **2T6S** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_4TQ6.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"This notebook reproduce the analysis made by team **4TQ6** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_98BT.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"This notebook reproduce the analysis made by team **98BT** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_C88N.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"This notebook reproduce the analysis made by team **C88N** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_J7F9.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"This notebook reproduce the analysis made by team **J7F9** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_Q6O0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"This notebook reproduce the analysis made by team **Q6O0** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_R9K3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"\n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) \n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) \n",
" or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"\n",
"Botvinik-Nezer, R., Holzmeister, F., Camerer, C.F., Dreber, A., Huber, J., Johannesson, M., Kirchler, M., Iwanir, R., Mumford, J.A., ..., Nichols, T.E., Poldrack, R.A., Schonberg, T. (2020). Variability in the analysis of a single neuroimaging dataset by many teams. Nature. https://doi.org/10.1038/s41586-020-2314-9."
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_T54A.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"This notebook reproduce the analysis made by team **T54A** for the NARPS experiment (Botvinik-Nezer & al, 2020). \n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/notebooks/reproduction_V55J.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"\n",
"\n",
"**To use this notebook :** \n",
"- Download fMRIprep datas available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Download fMRIprep data available [**here**](https://openneuro.org/datasets/ds001734/versions/1.0.4) or in [**datalad**](http://datasets.datalad.org/?dir=/workshops/nih-2017/ds001734).\n",
"- Modify the paths:\n",
" - **exp_dir**: directory where the ds001734-download repository is stored\n",
" - **result_dir**: directory where the intermediate and final repositories will be stored\n",
Expand Down
Loading

0 comments on commit 9034678

Please sign in to comment.