diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/workflows/check_markdown.yml b/.github/workflows/check_markdown.yml new file mode 100644 index 00000000..46725a09 --- /dev/null +++ b/.github/workflows/check_markdown.yml @@ -0,0 +1,34 @@ +name: Check Markdown + +on: + push: + branches: + - master + pull_request: + branches: '*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 1 + + - uses: actions/setup-node@v2 + with: + node-version: '10' + + - name: Install dependencies and check markdown + run: | + npm install `cat npm-requirements.txt` + npx remark README.md --frail + npx remark ./notebooks/ --frail + npx remark ./tests/ --frail + npx remark ./docs/ --frail + + diff --git a/.github/workflows/check_md_links.yml b/.github/workflows/check_md_links.yml index c54aac1c..62bb95e1 100644 --- a/.github/workflows/check_md_links.yml +++ b/.github/workflows/check_md_links.yml @@ -6,7 +6,6 @@ on: push: branches: - master - - dev pull_request: branches: '*' diff --git a/.github/workflows/miss_hit.yml b/.github/workflows/miss_hit.yml index d4cb7ae8..5c5e561d 100644 --- a/.github/workflows/miss_hit.yml +++ b/.github/workflows/miss_hit.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - dev pull_request: branches: '*' @@ -28,12 +27,16 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip setuptools - pip3 install install miss_hit + pip3 install -r requirements.txt - - name: Miss_hit code quality + - name: MISS_HIT Code style run: | - mh_metric . --ci + mh_style --process-slx - - name: Miss_hit code style + - name: MISS_HIT Metrics run: | - mh_style . + mh_metric --ci + + - name: MISS_HIT Bug finder + run: | + mh_lint diff --git a/.github/workflows/moxunit.yml b/.github/workflows/moxunit.yml index 16a9ee9c..0063a04c 100644 --- a/.github/workflows/moxunit.yml +++ b/.github/workflows/moxunit.yml @@ -1,9 +1,10 @@ -name: CI +name: MOxUnit on: push: branches: - master + - dev pull_request: branches: '*' @@ -11,10 +12,21 @@ jobs: build: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 with: submodules: true fetch-depth: 1 + + - name: Make jsonread for octave + run: | + sudo apt-get -y -qq update + sudo apt-get -y install octave + sudo apt-get -y install liboctave-dev + cd lib/JSONio + mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS + # cd ../.. + - name: MOxUnit Action uses: joergbrech/moxunit-action@v1.1 with: @@ -22,6 +34,7 @@ jobs: src: src with_coverage: true cover_xml_file: coverage.xml + - name: Code coverage uses: codecov/codecov-action@v1 with: diff --git a/.gitignore b/.gitignore index 3a9f5620..c1db3745 100644 --- a/.gitignore +++ b/.gitignore @@ -23,8 +23,20 @@ tests/*.tsv* check_my_code_report.txt # jupyter notebook checkpoints -.ipynb_checkpoints -*/.ipynb_checkpoints/* +notebooks/.ipynb_checkpoints/* +notebooks/source/* +notebooks/output/* +notebooks/new_experiment/* +# ignore node js files +node_modules/* +package-lock.json +# visual studio code stuff +.vscode +# virtual env +cpp_bids/* + +# documentation +docs/build/* diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..ec0951f4 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,26 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/source/conf.py + builder: html + fail_on_warning: true + +# Build documentation with MkDocs +#mkdocs: +# configuration: mkdocs.yml + +# Optionally build your docs in additional formats such as PDF +formats: + - pdf + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: requirements.txt \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index d5cfa910..87c8f835 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,17 +3,12 @@ # have set it up to run continuous integration on this this repo # Linux distribution (bionic beaver) -dist: bionic +dist: focal # Language and version language: node_js node_js: - - "10" - -cache: - apt: true # only works with Pro version - directories: - - node_modules # NPM packages for the remark markdown linter + - "11" branches: only: # only run the CI for those branches @@ -33,7 +28,7 @@ before_install: - travis_retry sudo apt-get -y install nodejs - travis_retry sudo apt-get -y install npm # Install BIDS-Validator - - sudo npm install -g bids-validator@1.5.4 + - sudo npm install -g bids-validator@1.5.7 install: # make octave file the JSONio submodule @@ -51,12 +46,3 @@ jobs: - name: "BIDS validator: create and check dataset" script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/raw/ --ignoreNiftiHeaders - - - name: "Check markdown" - before_script: - - npm install `cat npm-requirements.txt` - script: - - remark README.md --frail - - remark ./notebooks/ --frail - - remark ./tests/ --frail - - remark ./docs/ --frail diff --git a/.zenodo.json b/.zenodo.json new file mode 100644 index 00000000..6edf043c --- /dev/null +++ b/.zenodo.json @@ -0,0 +1,35 @@ +{ + "title": "CPP_BIDS", + "description": "A lightweight Octave/MATLAB toolbox to help create BIDS data sets from source.", + "creators": [ + { + "affiliation": "Université Catholique de Louvain", + "name": "Gau, Rémi", + "orcid": "0000-0002-1535-9767" + }, + { + "affiliation": "Université Catholique de Louvain", + "name": "Barilari, Marco", + "orcid": "0000-0002-3313-3120" + }, + { + "affiliation": "Université Catholique de Louvain", + "name": "Battal, Ceren", + "orcid": "0000-0002-9844-7630" + }, + { + "affiliation": "Université Catholique de Louvain", + "name": "Lenc, Thomas", + "orcid": "0000-0001-5796-1388" + } + ], + "keywords": [ + "BIDS", + "brain imaging data structure", + "neuroscience", + "MATLAB", + "Octave" + ], + "license": "MIT license", + "upload_type": "software" +} \ No newline at end of file diff --git a/README.md b/README.md index 1d1e474e..6fb0f241 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,14 @@ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/cpp-lln-lab/CPP_BIDS/master?filepath=notebooks%2Fbasic_usage.ipynb) +**Documentation** + +[![Documentation Status: stable](https://readthedocs.org/projects/cpp-bids/badge/?version=stable)](https://cpp-bids.readthedocs.io/en/stable/?badge=stable) + +**Cite it** + +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4007674.svg)](https://doi.org/10.5281/zenodo.4007674) + **Unit tests and coverage** [![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_BIDS/actions) @@ -19,7 +27,7 @@ [![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-) -* * * +--- # CPP_BIDS @@ -44,42 +52,24 @@ A set of function for matlab and octave to create structure and filenames for the output of behavioral, EEG, fMRI, eyetracking studies. -## Output format - -### Modality agnostic aspect - -Subjects, session and run number labels will be numbers with zero padding up to -3 values (e.g subject 1 will become `sub-001`). - -A session folder will ALWAYS be created even if not requested (default will be -`ses-001`). - -Task labels will be printed in camelCase in the filenames. - -Time stamps are added directly in the filename by adding a suffix -`_date-YYYYMMDDHHMM` which makes the file name non-BIDS compliant. This was -added to prevent overwriting files in case a certain run needs to be done a -second time because of a crash (Some of us are paranoid about keeping even -cancelled runs during my experiments). This suffix should be removed to make the -data set BIDS compliant. See `convertSourceToRaw.m` for more details. - -For example: - -```bash -sub-090/ses-003/sub-090_ses-003_task-auditoryTask_run-023_events_date-202007291536.tsv -``` - ## Documentation - [Installation](./docs/installation.md) - [How to use it: jupyter notebooks](./notebooks) -- [Functions description](./docs/functions-description.md) +- [General documentation](https://cpp-bids.readthedocs.io/en/dev/index.html) ## Contributing Feel free to open issues to report a bug and ask for improvements. -### Guidestyle +If you want to contribute, have a look at our +[contributing guidelines](https://github.com/cpp-lln-lab/.github/blob/main/CONTRIBUTING.md) +that are meant to guide you and help you get started. If something is not clear +or you get stuck: it is more likely we did not do good enough a job at +explaining things. So do not hesitate to open an issue, just to ask for +clarification. + +### Style guide - We use camelCase. @@ -97,23 +87,31 @@ Here are the naming templates used. - Behavior -`sub-