Skip to content
Merged
Changes from all commits
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
99 changes: 63 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
- [checkCFG](#checkcfg)
- [CFG content](#cfg-content)
- [How to install](#how-to-install)
- [Use the matlab package manager](#use-the-matlab-package-manager)
- [Download with git](#download-with-git)
- [Add as a submodule](#add-as-a-submodule)
- [Direct download](#direct-download)
- [Contributing](#contributing)
- [Guidestyle](#guidestyle)
- [BIDS naming convention](#bids-naming-convention)
Expand Down Expand Up @@ -281,49 +283,74 @@ cfg.fileName.datasetDescription

## How to install

### Use the matlab package manager
### Download with git

This repository can be added as a dependencies by listing it in a
[mpm-requirements.txt file](.mpm-requirements.txt) as follows:
``` bash
cd fullpath_to_directory_where_to_install
# use git to download the code
git clone https://github.com/cpp-lln-lab/CPP_BIDS.git
# move into the folder you have just created
cd CPP_PTB
# add the src folder to the matlab path and save the path
matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src')); savepath ();"
```

Then get the latest commit:
```bash
# from the directory where you downloaded the code
git pull origin master
```
CPP_BIDS -u https://github.com/cpp-lln-lab/CPP_BIDS.git

To work with a specific version, create a branch at a specific version tag number
```bash
# creating and checking out a branch that will be called version1 at the version tag v0.0.1
git checkout -b version1 v0.0.1
```

You can then use the [matlab package manager](https://github.com/mobeets/mpm), to simply download
the appropriate version of those dependencies and add them to your path by running a
`getDependencies` function like the one below where you just need to replace
`YOUR_EXPERIMENT_NAME` by the name of your experiment.
### Add as a submodule

```matlab
function getDependencies(action)
% Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
% and add them to the matlab path. The path is never saved so you need to run getDependencies() when
% you start matlab.
%
% getDependencies('update') will force the update and overwrite previous version of the dependencies.
%
% getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.

experimentName = YOUR_EXPERIMENT_NAME;

if nargin<1
action = '';
end

switch action
case 'update'
% install dependencies
mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME
end

% adds them to the path
mpm_folder = fileparts(which('mpm'));
addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName)));

end
Add it as a submodule in the repo you are working on.

``` bash
cd fullpath_to_directory_where_to_install
# use git to download the code
git submodule add https://github.com/cpp-lln-lab/CPP_BIDS.git
# move into the folder you have just created
cd CPP_PTB
# add the src folder to the matlab path and save the path
matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src'))"
```

To get the latest commit you then need to update the submodule with the information
on its remote repository and then merge those locally.
```bash
git submodule update --remote --merge
```

Remember that updates to submodules need to be commited as well.

**TO DO**
<!-- Submodules
pros: in principle, downloading the experiment you have the whole package plus the benefit to stay updated and use version control of this dependency. Can probably handle a use case in which one uses different version on different projects (e.g. older and newer projects).
cons: for pro users and not super clear how to use it at the moment. -->

### Direct download

Download the code. Unzip. And add to the matlab path.

Pick a specific version:

https://github.com/cpp-lln-lab/CPP_BIDS/releases

Or take the latest commit (NOT RECOMMENDED):

https://github.com/cpp-lln-lab/CPP_BIDS/archive/master.zip

**TO DO**
<!-- Download a specific version and c/p it in a subfun folder
pros: the easiest solution to share the code and 'installing' it on the stimulation computer (usually not the one used to develop the code).
cons: extreme solution useful only at the very latest stage (i.e. one minute before acquiring your data); prone to be customized/modified (is it what we want?) -->

## Contributing

Feel free to open issues to report a bug and ask for improvements.
Expand Down