Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[43FJ] Reproduction #94

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rebase
  • Loading branch information
elodiegermani1 committed Feb 12, 2024
commit 11c9dc574c8f5b5605a5b1ac4e7480de176dd1d9
13 changes: 8 additions & 5 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -8,9 +8,11 @@ on:
push:
paths:
- '**.py'
- '.github/workflows/code_quality.yml'
pull_request:
paths:
- '**.py'
- '.github/workflows/code_quality.yml'

# Jobs that define the workflow
jobs:
@@ -33,22 +35,23 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-pylint
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-pylint
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install .[tests]

- name: Analyse the code with pylint
run: |
pylint --exit-zero narps_open > pylint_report_narps_open.txt
pylint --exit-zero tests > pylint_report_tests.txt
pylint --fail-under 8 narps_open > pylint_report_narps_open.txt
pylint --fail-under 8 tests > pylint_report_tests.txt

- name: Archive pylint results
uses: actions/upload-artifact@v3
if: failure() # Only if previous step failed
with:
name: pylint-reports-python
path: |
2 changes: 1 addition & 1 deletion .github/workflows/pipeline_tests.yml
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ jobs:
echo "tests=$test_files" >> $GITHUB_OUTPUT
echo "teams=$teams" >> $GITHUB_OUTPUT

# A job to identify and run the tests
# A job to run the tests
pytest:
needs: identify-tests
runs-on: self-hosted
4 changes: 2 additions & 2 deletions .github/workflows/test_changes.yml
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ jobs:
echo $test_files
echo "tests=$test_files" >> $GITHUB_OUTPUT

# A job to list the tests to be run
# A job to run the tests
pytest:
needs: identify-tests
runs-on: self-hosted
@@ -58,5 +58,5 @@ jobs:
- name: Execute tests with pytest
run: |
if [[ "${{ needs.identify-tests.outputs.tests }}" != "" ]]; then
pytest -s -q ${{ needs.identify-tests.outputs.tests }}
pytest -s -q ${{ needs.identify-tests.outputs.tests }} -m "not pipeline_test"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -139,3 +139,6 @@ dmypy.json
# Pyre type checker
.pyre/
*pyscript*

# For mac users
*.DS_Store
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@
datalad-url = https://github.com/OpenNeuroDatasets/ds001734.git
[submodule "data/results"]
path = data/results
url = https://gin.g-node.org/RemiGau/neurovault_narps_open_pipeline.git
datalad-url = https://gin.g-node.org/RemiGau/neurovault_narps_open_pipeline.git
url = https://gin.g-node.org/RemiGau/neurovault_narps_open_pipeline
datalad-url = https://gin.g-node.org/RemiGau/neurovault_narps_open_pipeline
datalad-id = b7b70790-7b0c-40d3-976f-c7dd49df3b86
7 changes: 7 additions & 0 deletions CONTENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Contents overview

- :snake: :package: `narps_open/` contains the Python package with all the pipelines logic.
- :brain: `data/` contains data that is used by the pipelines, as well as the (intermediate or final) results data. Instructions to download data are available in [INSTALL.md](/INSTALL.md#data-download-instructions).
- :blue_book: `docs/` contains the documentation for the project. Start browsing it with the entry point [docs/README.md](/docs/README.md)
- :orange_book: `examples/` contains notebooks examples to launch of the reproduced pipelines.
- :microscope: `tests/` contains the tests of the narps_open package.
88 changes: 46 additions & 42 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,70 @@
# How to contribute to NARPS Open Pipelines ?

General guidelines can be found [here](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) in the GitHub documentation.
For the reproductions, we are especially looking for contributors with the following profiles:
- `🧠 fMRI soft` SPM, FSL, AFNI or nistats has no secrets for you ; you know one of these fMRI analysis tools by :heart:.
- `🐍 Python` You are a Python guru, willing to use [Nipype](https://nipype.readthedocs.io/en/latest/).

## 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!
In the following, read the instruction sections where the badge corresponding to your profile appears.

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).
## 1 - Choose a pipeline
`🧠 fMRI soft` `🐍 Python`

When you are ready, [start an issue](https://github.com/Inria-Empenn/narps_open_pipelines/issues/new/choose) and choose **Pipeline reproduction**!
Not sure which pipeline to start with :thinking:? The [pipeline dashboard](https://github.com/Inria-Empenn/narps_open_pipelines/wiki/pipeline_status) provides the progress status for each pipeline. You can pick a pipeline that is not fully reproduced, i.e.: not started :red_circle: or in progress :orange_circle: . Also have a look to the [pipeline reproduction management page](https://github.com/orgs/Inria-Empenn/projects/1/views/1) in order to get in touch with contributors working on the same pipeline.

### If you have experience with NiPype
> [!NOTE]
> Need more information to make a decision? The `narps_open.utils.description` module of the project, as described [in the documentation](/docs/description.md) provides easy access to all the info we have on each pipeline.

We created templates with modifications to make and holes to fill to create a pipeline. You can find them in [`narps_open/pipelines/templates`](/narps_open/pipelines/templates).
## 2 - Interact using issues
`🧠 fMRI soft` `🐍 Python`

If you feel it could be better explained, do not hesitate to suggest modifications for the templates.
Browse [issues](https://github.com/Inria-Empenn/narps_open_pipelines/issues/) before starting a new one. If the pipeline is :orange_circle:, the associated issues are listed on the [pipeline dashboard](https://github.com/Inria-Empenn/narps_open_pipelines/wiki/pipeline_status).

Feel free to have a look to the following pipelines, these are examples :
| team_id | softwares | fmriprep used ? | pipeline file |
| --- | --- | --- | --- |
| 2T6S | SPM | Yes | [/narps_open/pipelines/team_2T6S.py](/narps_open/pipelines/team_2T6S.py) |
| X19V | FSL | Yes | [/narps_open/pipelines/team_X19V.py](/narps_open/pipelines/team_2T6S.py) |
You can either:
* comment on an existing issue with details or your findings about the pipeline;
* [start an issue](https://github.com/Inria-Empenn/narps_open_pipelines/issues/new/choose) and choose **Pipeline reproduction**.

### If you have experience with the original software package but not with NiPype
> [!WARNING]
> As soon as the issue is marked as `🏁 status: ready for dev` you can proceed to the next step.

A fantastic tool named [Giraffe](https://giraffe.tools/porcupine/TimVanMourik/GiraffePlayground/master) is available. It allows you to create a graph of your pipeline using NiPype functions but without coding! Just save your NiPype script in a .py file and send it as a new issue, we will convert this script to a script which works with our specific parameters.
## 3 - Use pull requests
`🐍 Python`

## Find or propose an issue :clipboard:
Issues are very important for this project. If you want to contribute, you can either **comment an existing issue** or **proposing a new issue**.
1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the repository;
2. create a separate branch for the issue you're working on (do not make changes to the default branch of your fork).
3. push your work to the branch as soon as possible;
4. visit [this page](https://github.com/Inria-Empenn/narps_open_pipelines/pulls) to start a draft pull request.

### Answering an existing issue :label:
To answer an existing issue, make a new comment with the following information:
- Your name and/or github username
- The step you want to contribute to
- The approximate time needed
> [!WARNING]
> Make sure you create a **Draft Pull Request** as described [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork), and please stick to the description of the pull request template as much as possible.

### Proposing a new issue :bulb:
In order to start a new issue, click [here](https://github.com/Inria-Empenn/narps_open_pipelines/issues/new/choose) and choose the type of issue you want:
- **Feature request** if you aim at improving the project with your ideas ;
- **Bug report** if you encounter a problem or identified a bug ;
- **Classic issue** to ask question, give feedbacks...
## 4 - Reproduce pipeline

Some issues are (probably) already open, please browse them before starting a new one. If your issue was already reported, you may want complete it with details or other circumstances in which a problem appear.
### Translate the pipeline description into code
`🐍 Python`

## Pull Requests :inbox_tray:
Pull requests are the best way to get your ideas into this repository and to solve the problems as fast as possible.
Write your code and push it to the branch. Make sure you perform all the items of the pull request checklist.

### Make A Branch :deciduous_tree:
Create a separate branch for each issue you're working on. Do not make changes to the default branch (e.g. master, develop) of your fork.
From the description provided by the team you chose, write Nipype workflows that match the steps performed by the teams (preprocessing, run level analysis, subject level analysis, group level analysis).

### Push Your Code :outbox_tray:
Push your code as soon as possible.
We created templates with modifications to make and holes to fill to help you with that. Find them in [`narps_open/pipelines/templates`](/narps_open/pipelines/templates).

### Create the Pull Request (PR) :inbox_tray:
Once you pushed your first lines of code to the branch in your fork, visit [this page](https://github.com/Inria-Empenn/narps_open_pipelines/pulls) to start creating a PR for the NARPS Open Pipelines project.
> [!TIP]
> Have a look to the already reproduced pipelines, as examples :
> | team_id | softwares | fmriprep used ? | pipeline file |
> | --- | --- | --- | --- |
> | Q6O0 | SPM | Yes | [/narps_open/pipelines/team_Q6O0.py](/narps_open/pipelines/team_Q6O0.py) |

:warning: Please create a **Draft Pull Request** as described [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork), and please stick to the PR description template as much as possible.
Once your work is ready, you may ask a reviewer to your pull request, as described [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review). Please turn your draft pull request into a *regular* pull request, by clicking **Ready for review** in the pull request page.

Continue writing your code and push to the same branch. Make sure you perform all the items of the PR checklist.
### Run the pipeline and produce evidences
`🧠 fMRI soft`

### Request Review :disguised_face:
Once your PR is ready, you may add a reviewer to your PR, as described [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) in the GitHub documentation.
From the description provided by the team you chose, perform the analysis on the associated software to get as many metadata (log, configuration files, and other relevant files for reproducibility) as possible from the execution. Complementary hints and comments on the process would definitely be welcome, to enrich the description (e.g.: relevant parameters not written in the description, etc.).

Please turn your Draft Pull Request into a "regular" Pull Request, by clicking **Ready for review** in the Pull Request page.
Especially these files contain valuable information about model design:
* for FSL pipelines, `design.fsf` setup files coming from FEAT ;
* for SPM pipelines, `matlabbatch` files.

**:wave: Thank you in advance for contributing to the project!**
You can attach these files as comments on the pipeline reproduction issue.

**:wave: Thank you for contributing to the project!**
Loading
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.