Skip to content

Commit 78d38f6

Browse files
authored
Merge pull request #10 from cpp-lln-lab/update_bids_matlab
[ENH] Update bids matlab
2 parents 39e65b6 + c44291b commit 78d38f6

32 files changed

+557
-190
lines changed

.github/workflows/miss_hit_code_quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ jobs:
3232
- name: Install dependencies
3333
run: |
3434
python -m pip install --upgrade pip setuptools
35-
pip3 install -r requirements.txt
35+
pip3 install -r requirements.txt
3636
3737
- name: MISS_HIT Metrics
3838
run: |
3939
mh_metric --ci
4040
4141
- name: MISS_HIT Bug finder
4242
run: |
43-
mh_lint
43+
mh_lint

.github/workflows/miss_hit_code_style.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
- name: Install dependencies
3333
run: |
3434
python -m pip install --upgrade pip setuptools
35-
pip3 install -r requirements.txt
35+
pip3 install -r requirements.txt
3636
3737
- name: MISS_HIT Code style
3838
run: |
39-
mh_style --process-slx
39+
mh_style --process-slx

.github/workflows/run_tests.yml

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ on:
66
- master
77
- main
88
- dev
9-
pull_request:
10-
branches: '*'
119

12-
env:
13-
OCTFLAGS: --no-gui --no-window-system --silent
10+
pull_request:
11+
branches: ['*']
1412

1513
jobs:
1614
build:
17-
1815
runs-on: ubuntu-20.04
1916

2017
steps:
@@ -24,37 +21,36 @@ jobs:
2421
sudo apt-get -y -qq update
2522
sudo apt-get -y install octave liboctave-dev
2623
27-
- name: Clone spm_2_bids
24+
- name: Clone spm_2_bids
2825
uses: actions/checkout@v2
2926
with:
3027
submodules: true
3128
fetch-depth: 2
3229

33-
- name: Install SPM
34-
run: |
35-
git clone https://github.com/spm/spm12.git --depth 1
36-
make -C spm12/src PLATFORM=octave distclean
37-
make -C spm12/src PLATFORM=octave
38-
make -C spm12/src PLATFORM=octave install
39-
octave $OCTFLAGS --eval "addpath(fullfile(pwd, 'spm12')); savepath();"
40-
41-
- name: Install Moxunit and MOcov
30+
- name: get bids-matlab and JSONio
4231
run: |
43-
git clone https://github.com/MOxUnit/MOxUnit.git --depth 1
44-
make -C MOxUnit install
45-
git clone https://github.com/MOcov/MOcov.git --depth 1
46-
make -C MOcov install
47-
48-
- name: get bids-matlab and set up paths
49-
run: |
50-
make install_dev
51-
octave $OCTFLAGS --eval "init_env; savepath();"
52-
53-
- name: Run tests
54-
run: |
55-
octave $OCTFLAGS --eval "run_tests"
56-
cat test_report.log | grep 0
57-
bash <(curl -s https://codecov.io/bash)
32+
make install_dev_octave
5833
59-
34+
- name: MOxUnit Action
35+
uses: joergbrech/[email protected]
36+
with:
37+
tests: tests # files or directories containing the MOxUnit test cases
38+
src: src # directories to be added to path before running the tests.
39+
ext: tests/utils lib/bids-matlab lib/JSONio # External resources to add to the search put (excluded from coverage)
40+
# data: # Directory for test data
41+
with_coverage: true
42+
cover_xml_file: coverage.xml
43+
44+
- name: Upload coverage
45+
uses: actions/upload-artifact@v1
46+
with:
47+
name: coverage_file
48+
path: coverage.xml
6049

50+
- name: Code coverage
51+
uses: codecov/codecov-action@v1
52+
with:
53+
file: coverage.xml # optional
54+
flags: unittests # optional
55+
name: codecov-umbrella # optional
56+
fail_ci_if_error: true # optional (default = false)

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
env/
77

88
lib/bids-matlab
9+
lib/JSONio
910

11+
coverage_html
12+
coverage.xml
13+
test_report.log
1014

1115
## MATLAB / OCTAVE gitignore template
1216

@@ -44,5 +48,3 @@ codegen/
4448

4549
# Octave session info
4650
octave-workspace
47-
48-

.pre-commit-config.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,18 @@ repos:
2525
entry: mh_lint
2626
files: ^(.*\.(m|slx))$
2727
language: python
28-
additional_dependencies: [miss_hit]
28+
additional_dependencies: [miss_hit]
29+
30+
- repo: https://github.com/pre-commit/pre-commit-hooks
31+
rev: v4.1.0
32+
hooks:
33+
- id: trailing-whitespace
34+
- id: end-of-file-fixer
35+
- id: check-yaml
36+
- id: check-added-large-files
37+
38+
- repo: https://github.com/pre-commit/pygrep-hooks
39+
rev: v1.9.0
40+
hooks:
41+
- id: rst-backticks # Detect common mistake of using single backticks when writing rst
42+
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
install_dev:
22
git clone https://github.com/bids-standard/bids-matlab.git lib/bids-matlab
33
cd lib/bids-matlab && git checkout dev
4+
git clone https://github.com/gllmflndn/JSONio.git --depth 1 lib/JSONio
5+
6+
install_dev_octave:
7+
git clone https://github.com/bids-standard/bids-matlab.git lib/bids-matlab
8+
cd lib/bids-matlab && git checkout dev
9+
git clone https://github.com/gllmflndn/JSONio.git --depth 1 lib/JSONio
10+
cd lib/JSONio && mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS
411

512
clean:
6-
rm -rf lib/bids-matlab
13+
rm -rf lib/bids-matlab
14+
rm -rf lib/JSONio

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ When you have set up your repo
1414
[![Build Status](https://travis-ci.com/Remi-gau/template_matlab_analysis.svg?branch=master)](https://travis-ci.com/Remi-gau/template_matlab_analysis)
1515
1616
-->
17+
1718
# spm_2_bids
1819

1920
Small code base to help convert the MRI spm output to a valid bids derivatives.
@@ -26,4 +27,4 @@ Most of the renaming is based on the SPM prefixes combinations.
2627
It is configurable to adapt to new set of prefixes.
2728

2829
- [Dependencies](./lib/README.md)
29-
- [Documentation](https://spm-2-bids.readthedocs.io/en/latest/)
30+
- [Documentation](https://spm-2-bids.readthedocs.io/en/latest/)

binder/apt.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
octave
2+
liboctave-dev
3+
gnuplot
4+
ghostscript
5+
tree

binder/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dependencies:
2+
- octave_kernel

binder/postBuild

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cd ${HOME}
2+
3+
octave --no-gui --no-window-system --silent --eval "addpath (getenv (\"HOME\")); savepath ();"
4+
octave --no-gui --no-window-system --silent --eval "addpath (fullfile (getenv (\"HOME\"), \"+bids\")); savepath ();"
5+
6+
git clone git://github.com/gllmflndn/JSONio.git --depth 1
7+
cd JSONio; mkoctfile --mex jsonread.c jsmn.c -DJSMN_PARENT_LINKS; cd ..
8+
9+
octave --no-gui --no-window-system --silent --eval "addpath (fullfile (getenv (\"HOME\"), \"JSONio\")); savepath ();"
10+
11+
cd ${HOME}/examples

0 commit comments

Comments
 (0)