Skip to content

Commit 7d7c052

Browse files
committed
update readme
1 parent 3a1269e commit 7d7c052

File tree

1 file changed

+63
-36
lines changed

1 file changed

+63
-36
lines changed

README.md

Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
- [checkCFG](#checkcfg)
1717
- [CFG content](#cfg-content)
1818
- [How to install](#how-to-install)
19-
- [Use the matlab package manager](#use-the-matlab-package-manager)
19+
- [Download with git](#download-with-git)
20+
- [Add as a submodule](#add-as-a-submodule)
21+
- [Direct download](#direct-download)
2022
- [Contributing](#contributing)
2123
- [Guidestyle](#guidestyle)
2224
- [BIDS naming convention](#bids-naming-convention)
@@ -281,49 +283,74 @@ cfg.fileName.datasetDescription
281283

282284
## How to install
283285

284-
### Use the matlab package manager
286+
### Download with git
285287

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

298+
Then get the latest commit:
299+
```bash
300+
# from the directory where you downloaded the code
301+
git pull origin master
289302
```
290-
CPP_BIDS -u https://github.com/cpp-lln-lab/CPP_BIDS.git
303+
304+
To work with a specific version, create a branch at a specific version tag number
305+
```bash
306+
# creating and checking out a branch that will be called version1 at the version tag v0.0.1
307+
git checkout -b version1 v0.0.1
291308
```
292309

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

298-
```matlab
299-
function getDependencies(action)
300-
% Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
301-
% and add them to the matlab path. The path is never saved so you need to run getDependencies() when
302-
% you start matlab.
303-
%
304-
% getDependencies('update') will force the update and overwrite previous version of the dependencies.
305-
%
306-
% getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.
307-
308-
experimentName = YOUR_EXPERIMENT_NAME;
309-
310-
if nargin<1
311-
action = '';
312-
end
313-
314-
switch action
315-
case 'update'
316-
% install dependencies
317-
mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME
318-
end
319-
320-
% adds them to the path
321-
mpm_folder = fileparts(which('mpm'));
322-
addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName)));
323-
324-
end
312+
Add it as a submodule in the repo you are working on.
313+
314+
``` bash
315+
cd fullpath_to_directory_where_to_install
316+
# use git to download the code
317+
git submodule add https://github.com/cpp-lln-lab/CPP_BIDS.git
318+
# move into the folder you have just created
319+
cd CPP_PTB
320+
# add the src folder to the matlab path and save the path
321+
matlab -nojvm -nosplash -r "addpath(fullfile(pwd, 'src'))"
325322
```
326323

324+
To get the latest commit you then need to update the submodule with the information
325+
on its remote repository and then merge those locally.
326+
```bash
327+
git submodule update --remote --merge
328+
```
329+
330+
Remember that updates to submodules need to be commited as well.
331+
332+
**TO DO**
333+
<!-- Submodules
334+
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).
335+
cons: for pro users and not super clear how to use it at the moment. -->
336+
337+
### Direct download
338+
339+
Download the code. Unzip. And add to the matlab path.
340+
341+
Pick a specific version:
342+
343+
https://github.com/cpp-lln-lab/CPP_BIDS/releases
344+
345+
Or take the latest commit (NOT RECOMMENDED):
346+
347+
https://github.com/cpp-lln-lab/CPP_BIDS/archive/master.zip
348+
349+
**TO DO**
350+
<!-- Download a specific version and c/p it in a subfun folder
351+
pros: the easiest solution to share the code and 'installing' it on the stimulation computer (usually not the one used to develop the code).
352+
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?) -->
353+
327354
## Contributing
328355

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

0 commit comments

Comments
 (0)