Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
aefa7cf
update version handling
Remi-Gau Nov 3, 2022
cd2f6f5
update version handling
Remi-Gau Nov 3, 2022
87e1e76
improve release process
Remi-Gau Nov 3, 2022
5f19396
improve docekr file building
Remi-Gau Nov 3, 2022
70a3eba
fix dataset validation
Remi-Gau Nov 3, 2022
07265d4
switch to fixed branch of spmup
Remi-Gau Nov 3, 2022
9505a21
remove handling of old spmup output
Remi-Gau Nov 3, 2022
2ba67e5
update install
Remi-Gau Nov 3, 2022
95354be
refactor validation
Remi-Gau Nov 3, 2022
15f1dcd
remove dead spmup code
Remi-Gau Nov 3, 2022
4fc84e2
remùove submodule
Remi-Gau Nov 3, 2022
d9b83de
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 3, 2022
31da3d4
lift python dependency requirements
Remi-Gau Nov 3, 2022
8674cb1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 3, 2022
7d19c2e
add black config in precommit
Remi-Gau Nov 3, 2022
be03548
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 3, 2022
524be5e
fix install in CI
Remi-Gau Nov 3, 2022
8354ac4
Merge pull request #785 from Remi-Gau/docker_version
Remi-Gau Nov 3, 2022
8929e59
Merge remote-tracking branch 'upstream/main' into validate
Remi-Gau Nov 3, 2022
9b3e345
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 3, 2022
60a953b
fix typo
Remi-Gau Nov 3, 2022
5e9850b
move most package requirements in cfg
Remi-Gau Nov 3, 2022
879455d
fix typo
Remi-Gau Nov 3, 2022
b760afb
remove manifest
Remi-Gau Nov 3, 2022
61a9d73
move bash scripts in tools folder
Remi-Gau Nov 3, 2022
f99f0ea
fix setup.cfg
Remi-Gau Nov 3, 2022
6c05dab
print path of dataset validated
Remi-Gau Nov 3, 2022
911ca2a
remove extra skip-validation added
Remi-Gau Nov 3, 2022
d2a4e58
update dockerfile
Remi-Gau Nov 3, 2022
d168858
fix typo
Remi-Gau Nov 3, 2022
f1c2c9f
improve doc and error message
Remi-Gau Nov 3, 2022
de957f0
fix passing test
Remi-Gau Nov 3, 2022
4b1976d
fix test
Remi-Gau Nov 3, 2022
8ee0ef1
refactor python
Remi-Gau Nov 3, 2022
334d86b
fix test
Remi-Gau Nov 3, 2022
928b5e9
silence validation warning test
Remi-Gau Nov 3, 2022
716de46
return 1 exit code if stats model validation fails
Remi-Gau Nov 3, 2022
7df6de8
try to add return values
Remi-Gau Nov 3, 2022
334a7bc
silence failing octave test
Remi-Gau Nov 3, 2022
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
11 changes: 11 additions & 0 deletions .github/workflows/run_system_tests_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,23 @@ jobs:
# MATLAB release to set up R2020a
release: R2020a

- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Install validators
run: make install

- name: Get moae fmriprep data from OSF
run: |
mkdir -p demos/MoAE/inputs/
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/run_system_tests_octave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ jobs:
sudo apt-get -y -qq update
sudo apt-get -y install octave liboctave-dev

- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Info
run: |
octave --version
Expand All @@ -69,6 +77,9 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Install validators
run: make install

- name: Get moae fmriprep data from OSF
run: |
mkdir -p demos/MoAE/inputs/
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/run_tests_matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,23 @@ jobs:
# MATLAB release to set up R2020a
release: R2020a

- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Install validators
run: make install

- name: Install SPM
run: |
git clone https://github.com/spm/spm12.git --depth 1
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/run_tests_octave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,23 @@ jobs:
run: |
octave --version

- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Clone bidspm
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Install validators
run: make install

- name: Install SPM
run: |
git clone https://github.com/spm/spm12.git --depth 1
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,3 @@
path = lib/octache
url = https://github.com/Remi-Gau/Octache.git
datalad-url = https://github.com/Remi-Gau/Octache.git
[submodule "tools/stats_model"]
path = tools/stats_model
url = https://github.com/bids-standard/stats-models.git
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,20 @@ repos:
rev: 22.10.0
hooks:
- id: black
args: [--config=pyproject.toml]

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.1.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade
args: [--py38-plus]
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ formats:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
version: "3.8"
install:
- requirements: requirements_doc.txt
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cff-version: 1.2.0

title: "bidspm"

version: 2.1.0dev
version: 2.2.0

abstract: BIDSpm is a set pipelines and tools for Octave/MATLAB to process and analyze BIDS data sets using SPM.

Expand Down
65 changes: 32 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Creates a docker image of bidspm with
# Creates a docker image of bidspm

# version number are updated automatically with tbe bump version script

# this is mostly taken from the spm docker files: https://github.com/spm/spm-docker
FROM ubuntu:22.04
Expand All @@ -8,62 +10,59 @@ USER root
ENV LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8"

#TODO how to update this with the content of the current version
LABEL version="1.1.5dev"
LABEL version="2.2.0"

LABEL maintainer="Rémi Gau <remi.gau@gmail.com>"

## Install SPM
# basic OS tools install and also octave
## basic OS tools install, node, npm also octave
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential \
build-essential software-properties-common\
curl \
octave \
liboctave-dev &&
apt-get clean &&
octave liboctave-dev \
nodejs npm

## add python
RUN add-apt-repository ppa:deadsnakes/ppa && apt-get update
RUN apt-get -y install python3.10 python3-pip

RUN apt-get clean && \
rm -rf \
/tmp/hsperfdata* \
/var/*/apt/*/partial \
/var/lib/apt/lists/* \
/var/log/apt/term*

RUN mkdir /opt/spm12 &&
curl -SL https://github.com/spm/spm12/archive/r7771.tar.gz |
tar -xzC /opt/spm12 --strip-components 1 &&
curl -SL https://raw.githubusercontent.com/spm/spm-docker/main/octave/spm12_r7771.patch |
patch -p0 &&
make -C /opt/spm12/src PLATFORM=octave distclean &&
make -C /opt/spm12/src PLATFORM=octave &&
make -C /opt/spm12/src PLATFORM=octave install &&
## Install SPM
RUN mkdir /opt/spm12 && \
curl -SL https://github.com/spm/spm12/archive/r7771.tar.gz | \
tar -xzC /opt/spm12 --strip-components 1 && \
curl -SL https://raw.githubusercontent.com/spm/spm-docker/main/octave/spm12_r7771.patch | \
patch -p0 && \
make -C /opt/spm12/src PLATFORM=octave distclean && \
make -C /opt/spm12/src PLATFORM=octave && \
make -C /opt/spm12/src PLATFORM=octave install && \
ln -s /opt/spm12/bin/spm12-octave /usr/local/bin/spm12

RUN octave --no-gui --eval "addpath('/opt/spm12/'); savepath ();"

## Install nods and bids validator
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \
nodejs npm &&
apt-get clean &&
rm -rf \
/tmp/hsperfdata* \
/var/*/apt/*/partial \
/var/lib/apt/lists/* \
/var/log/apt/term*

RUN node -v && npm -v && npm install -g bids-validator

## Install BIDSpm in user folder
RUN test "$(getent passwd neuro)" || useradd --no-user-group --create-home --shell /bin/bash neuro

USER neuro

WORKDIR /home/neuro
RUN mkdir code input output

RUN mkdir code output bidspm
# COPY . /home/neuro/bidspm # this is for local development
RUN git clone --branch v2.2.0 --depth 1 --recursive https://github.com/cpp-lln-lab/bidspm.git

WORKDIR /home/neuro/
RUN cd bidspm && pip3 install .
RUN echo '\n'
RUN python3 --version && pip3 list
RUN echo '\n'

COPY [".", "/home/neuro/bidspm/"]
RUN cd bidspm && octave --no-gui --eval "bidspm; savepath();"

RUN cd bidspm && octave --no-gui --eval "initCppSpm(false); savepath();"
USER neuro

ENTRYPOINT ["octave"]
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

34 changes: 18 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,24 @@ endef
export PRINT_HELP_PYSCRIPT

# TODO make more general to use the local matlab version
MATLAB = /usr/local/MATLAB/R2017a/bin/matlab
MATLAB = /usr/local/MATLAB/R2018a/bin/matlab
ARG = -nodisplay -nosplash -nodesktop

################################################################################
# General

.PHONY: help clean clean_demos clean_test update fix_submodule

install:
npm install -g bids-validator
pip install .

help: ## Show what this Makefile can do
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean_demos clean_doc clean_test ## Remove all the clutter
rm -rf version.txt

clean_demos: ## Remove all the output of the demo
rm -rf demos/*/cfg
rm -rf demos/*/outputs/derivatives
Expand All @@ -46,28 +52,25 @@ clean_demos: ## Remove all the output of the demo
clean_test: ## Remove all the output of the tests
rm *.log
rm -rf coverage_html

update: update.sh ## Tries to get the latest version of the current branch from upstream
bash update.sh
bash tools/update.sh

fix_submodule: ## Fix any submodules that would not be checked out
git submodule update --init --recursive && git submodule update --recursive

# TODO should update the version in
# - the doc conf.py
# - in the reference in the README
# - dockerfile
version.txt: CITATION.cff
grep -w "^version" CITATION.cff | sed "s/version: /v/g" > version.txt
bump_version:
bash tools/bump_version.sh

validate_cff: ## Validate the citation file
cffconvert --validate

release: validate_cff bump_version lint manual


################################################################################
# doc

.PHONY: clean_doc manual

clean_doc:
cd docs && make clean

Expand All @@ -78,8 +81,6 @@ manual: ## Build PDF version of the doc
################################################################################
# lint

.PHONY: lint lint_matlab lint_python

lint: lint_matlab lint_python ## Clean MATLAB and python code

lint_matlab: ## Clean MATLAB code
Expand All @@ -93,11 +94,12 @@ lint_python: ## Clean python code
################################################################################
# test

.PHONY: test system_test
test: run_tests.m initCppSpm.m src tests ## Run tests with coverage
test: ## Run tests with coverage
$(MATLAB) $(ARG) -r "run_tests; exit()"
system_test: manualTests/test_moae.m initCppSpm.m src demos/MoAE/options demos/MoAE/models ## Run system tests
$(MATLAB) $(ARG) -r "cd manualTests; test_moae; exit()"

system_test: ## Run system tests
$(MATLAB) $(ARG) -r "cd demos/face_repetition/; test_face_rep; exit()"
$(MATLAB) $(ARG) -r "cd demos/MoAE/; test_moae; exit()"


################################################################################
Expand Down
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- .. only:: html -->
<!-- needed to ignore badges when building doc -->
<!-- .. only:: not latex -->

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/cpp-lln-lab/bidspm/main.svg)](https://results.pre-commit.ci/latest/github/cpp-lln-lab/bidspm/main)
[![miss hit](https://img.shields.io/badge/code%20style-miss_hit-000000.svg)](https://misshit.org/)
Expand Down Expand Up @@ -35,15 +36,41 @@ git clone \
```

To start using bidspm, you just need to initialize it for this MATLAB / Octave
session with::
session with:

```matlab
bidspm()
```

Please see our
[documentation](https://bidspm.readthedocs.io/en/latest/general_information.html)
for more info.
[documentation](https://bidspm.readthedocs.io/en/latest/installation.html) for
more info.

### Validation dependencies

If you want to validate bids dataset and bids stats model through bidspm, you
will need:

- [python3](https://www.python.org/downloads/)
- [node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)

You can then install:

- the bids validator
- the bidspm package

by running from the command line in the root folder of the repository:

```bash
make install
```

or

```bash
npm install -g bids-validator
pip install .
```

## Usage

Expand Down Expand Up @@ -146,7 +173,7 @@ info.
license = {GPL-3.0},
title = {bidspm},
url = {https://github.com/cpp-lln-lab/bidspm},
version = {2.1.0dev},
version = {2.2.0}
doi = {10.5281/zenodo.3554331},
publisher = {Zenodo},
journal = {Software}
Expand Down
Loading