Skip to content

Commit 1cf218f

Browse files
committed
update README
1 parent ae4b3af commit 1cf218f

File tree

1 file changed

+62
-32
lines changed

1 file changed

+62
-32
lines changed

README.md

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,44 +35,74 @@ We use the [MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_che
3535

3636
## How to install
3737

38-
### Use the matlab package manager
38+
### Download with git
39+
40+
``` bash
41+
cd fullpath_to_directory_where_to_install
42+
# use git to download the code
43+
git clone https://github.com/cpp-lln-lab/CPP_PTB.git
44+
# move into the folder you have just created
45+
cd CPP_PTB
46+
# add the src folder to the matlab path and save the path
47+
matlab -nojvm -nosplash -r "addpath(fullfile(pwd)); savepath ();"
48+
```
3949

40-
This repository can be added as a dependencies by listing it in a [mpm-requirements.txt file](.mpm-requirements.txt)
41-
as follows:
50+
Then get the latest commit:
51+
```bash
52+
# from the directory where you downloaded the code
53+
git pull origin master
54+
```
4255

43-
CPP_PTB -u https://github.com/cpp-lln-lab/CPP_PTB.git
56+
To work with a specific version, create a branch at a specific version tag number
57+
```bash
58+
# creating and checking out a branch that will be calle version1 at the version tag v0.0.1
59+
git checkout -b version1 v0.0.1
60+
```
4461

45-
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.
62+
### Add as a submodule
4663

47-
```matlab
48-
function getDependencies(action)
49-
% Will install on your computer the matlab dependencies specified in the mpm-requirements.txt
50-
% and add them to the matlab path. The path is never saved so you need to run getDependencies() when
51-
% you start matlab.
52-
%
53-
% getDependencies('update') will force the update and overwrite previous version of the dependencies.
54-
%
55-
% getDependencies() If you only already have the appropriate version but just want to add them to the matlab path.
56-
57-
experimentName = YOUR_EXPERIMENT_NAME;
58-
59-
if nargin<1
60-
action = '';
61-
end
62-
63-
switch action
64-
case 'update'
65-
% install dependencies
66-
mpm install -i mpm-requirements.txt -f -c YOUR_EXPERIMENT_NAME
67-
end
68-
69-
% adds them to the path
70-
mpm_folder = fileparts(which('mpm'));
71-
addpath(genpath(fullfile(mpm_folder, 'mpm-packages', 'mpm-collections', experimentName)));
72-
73-
end
64+
Add it as a submodule in the repo you are working on.
65+
66+
``` bash
67+
cd fullpath_to_directory_where_to_install
68+
# use git to download the code
69+
git submodule add https://github.com/cpp-lln-lab/CPP_PTB.git
70+
# move into the folder you have just created
71+
cd CPP_PTB
72+
# add the src folder to the matlab path and save the path
73+
matlab -nojvm -nosplash -r "addpath(fullfile(pwd))"
74+
```
75+
76+
To get the latest commit you then need to update the submodule with the information
77+
on its remote repository and then merge those locally.
78+
```bash
79+
git submodule update --remote --merge
7480
```
7581

82+
Remember that updates to submodules need to be commited as well.
83+
84+
**TO DO**
85+
<!-- Submodules
86+
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).
87+
cons: for pro users and not super clear how to use it at the moment. -->
88+
89+
### Direct download
90+
91+
Download the code. Unzip. And add to the matlab path.
92+
93+
Pick a specific version:
94+
95+
https://github.com/cpp-lln-lab/CPP_PTB/releases
96+
97+
Or take the latest commit (NOT RECOMMENDED):
98+
99+
https://github.com/cpp-lln-lab/CPP_PTB/archive/master.zip
100+
101+
**TO DO**
102+
<!-- Download a specific version and c/p it in a subfun folder
103+
pros: the easiest solution to share the code and 'installing' it on the stimulation computer (usually not the one used to develop the code).
104+
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?) -->
105+
76106
## Setting up keyboards
77107

78108
To select a specific keyboard to be used by the experimenter or the participant, you need to know

0 commit comments

Comments
 (0)