Skip to content

Commit 558a247

Browse files
authored
Merge pull request #72 from Remi-Gau/remi-dev
improve travis CI
2 parents 6f68f45 + 5365de4 commit 558a247

File tree

9 files changed

+275
-206
lines changed

9 files changed

+275
-206
lines changed

.travis.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
# Travis CI (https://travis-ci.org/)
2+
# This will only work on your repo if you have an account on travis and you
3+
# have set it up to run continuous integration on this this repo
24

3-
language: c
5+
# Linux distribution (bionic beaver)
46
dist: bionic
7+
8+
# Language and version
9+
language: python
10+
python:
11+
- "3.6" # current default Python on Travis CI
12+
513
cache:
614
apt: true # only works with Pro version
715

16+
# Install the miss_hit linter
817
before_install:
9-
- cd .. && git clone https://github.com/florianschanda/miss_hit.git && export PATH=$PATH:`pwd`/miss_hit && cd CPP_PTB
18+
- pip3 install miss_hit
1019

20+
# Lists all the tasks we will do
1121
jobs:
1222
include:
13-
- script: mh_style `pwd`
14-
name: "miss_hit linter" # names the second job
23+
- name: "miss_hit: checking code quality"
24+
script: mh_metric . --ci
25+
- name: "miss_hit: checking code style"
26+
script: mh_style .
27+

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_PTB/actions)
2+
![](https://github.com/cpp-lln-lab/CPP_PTB/workflows/CI/badge.svg)
3+
4+
[![Build Status](https://travis-ci.com/cpp-lln-lab/CPP_BIDS.svg?branch=master)](https://travis-ci.com/cpp-lln-lab/CPP_PTB)
5+
6+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
7+
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
8+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
9+
10+
# CPP_PTB
11+
112
<!-- vscode-markdown-toc -->
213
* 1. [Requirements](#Requirements)
314
* 2. [Code guidestyle](#Codeguidestyle)
@@ -17,17 +28,13 @@
1728
numbering=true
1829
autoSave=true
1930
/vscode-markdown-toc-config -->
20-
<!-- /vscode-markdown-toc --># CPP_PTB
31+
<!-- /vscode-markdown-toc -->
2132

22-
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
23-
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
24-
<!-- ALL-CONTRIBUTORS-BADGE:END -->
2533

26-
This is List of Crossmodal Perception and Plasticity lab (CPP) PsychToolBox (PTB) toolbox.
34+
This is the Crossmodal Perception and Plasticity lab (CPP) PsychToolBox (PTB) toolbox.
2735

2836
Those functions are mostly wrappers around some PTB functions to facilitate their use and to have a codebase to facilitate their reuse.
2937

30-
3138
## 1. <a name='Requirements'></a>Requirements
3239

3340
Make sure that the following toolboxes are installed and added to the matlab / octave path.
@@ -36,7 +43,7 @@ For instructions see the following links:
3643

3744
| Requirements | Used version |
3845
|----------------------------------------------------------|--------------|
39-
| [PsychToolBox](http://psychtoolbox.org/) Duuuuhh | >=3.0.14 |
46+
| [PsychToolBox](http://psychtoolbox.org/) | >=3.0.14 |
4047
| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2015b |
4148
| or [octave](https://www.gnu.org/software/octave/) | 4.? |
4249

@@ -50,7 +57,7 @@ We use the following regular expression for function names: `[a-z]+(([A-Z]|[0-9]
5057

5158
We keep the McCabe complexity as reported by the [check_my_code function](https://github.com/Remi-Gau/check_my_code) below 15.
5259

53-
We use the [MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html) to automatically fix some linting issues.
60+
We use the [MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html) to automatically fix some linting issues. The code style and quality is also checked during the continuous integration.
5461

5562
## 3. <a name='Howtoinstall'></a>How to install
5663

@@ -163,6 +170,10 @@ Using empty vectors (ie `[]`) or a negative value for those means that you will
163170

164171
## 5. <a name='Structure'></a>Structure
165172

173+
The `cfg` structure is where most of the information about your experiment will be defined.
174+
175+
Below we try to outline what it contains.
176+
166177
```matlab
167178
168179
cfg.testingDevice = 'pc';

docs/functions_description.md

Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
1+
# functions description
2+
13
<!-- vscode-markdown-toc -->
2-
* 1. [function details](#functiondetails)
4+
* 1. [ General functions](#Generalfunctions)
35
* 1.1. [initPTB](#initPTB)
4-
* 1.2. [testKeyboards](#testKeyboards)
5-
* 1.3. [cleanUp](#cleanUp)
6-
* 1.4. [getExperimentStart](#getExperimentStart)
7-
* 1.5. [getExperimentEnd](#getExperimentEnd)
8-
* 1.6. [getResponse](#getResponse)
9-
* 1.7. [deg2Pix](#deg2Pix)
10-
* 1.8. [drawFixationCross](#drawFixationCross)
11-
* 1.9. [eyeTracker](#eyeTracker)
12-
* 1.10. [pressSpace4me](#pressSpace4me)
13-
* 1.11. [standByScreen](#standByScreen)
14-
* 1.12. [waitForTrigger](#waitForTrigger)
6+
* 1.2. [cleanUp](#cleanUp)
7+
* 1.3. [getExperimentStart](#getExperimentStart)
8+
* 1.4. [getExperimentEnd](#getExperimentEnd)
9+
* 1.5. [deg2Pix](#deg2Pix)
10+
* 1.6. [eyeTracker](#eyeTracker)
11+
* 1.7. [standByScreen](#standByScreen)
12+
* 1.8. [waitForTrigger](#waitForTrigger)
13+
* 2. [Keyboard functions: response collection and aborting experiment](#Keyboardfunctions:responsecollectionandabortingexperiment)
14+
* 2.1. [testKeyboards](#testKeyboards)
15+
* 2.2. [getResponse](#getResponse)
16+
* 2.3. [pressSpace4me](#pressSpace4me)
17+
* 3. [Fixations](#Fixations)
18+
* 3.1. [drawFixationCross](#drawFixationCross)
19+
* 4. [Drawing dots](#Drawingdots)
20+
* 5. [Drawing apertures](#Drawingapertures)
1521

1622
<!-- vscode-markdown-toc-config
1723
numbering=true
1824
autoSave=true
1925
/vscode-markdown-toc-config -->
20-
<!-- /vscode-markdown-toc --># functions description
21-
22-
23-
24-
## 1. <a name='functiondetails'></a>function details
26+
<!-- /vscode-markdown-toc -->
2527

28+
## 1. <a name='Generalfunctions'></a> General functions
2629

2730
### 1.1. <a name='initPTB'></a>initPTB
2831

2932
This will initialize PsychToolBox
3033

3134
- screen
32-
- the windon opened takes the whole screen by default
35+
- the window opened takes the whole screen by default
3336
- set in debug mode with window transparency if necessary
3437
- can skip synch test if you ask for it (nicely)
3538
- gets the flip interval
@@ -38,26 +41,48 @@ This will initialize PsychToolBox
3841
- keyboard
3942
- sound
4043

41-
### 1.2. <a name='testKeyboards'></a>testKeyboards
42-
43-
Checks that the keyboards asked for properly connected.
44-
45-
If no key is pressed on the correct keyboard after the timeOut time this exits with an error.
46-
47-
### 1.3. <a name='cleanUp'></a>cleanUp
44+
### 1.2. <a name='cleanUp'></a>cleanUp
4845

4946
A wrapper function to close all windows, ports, show mouse cursor, close keyboard queues
5047
and give access back to the keyboards.
5148

52-
### 1.4. <a name='getExperimentStart'></a>getExperimentStart
49+
### 1.3. <a name='getExperimentStart'></a>getExperimentStart
5350

5451
Wrapper function that will show a fixation cross and collect a start timestamp in `cfg.experimentStart`
5552

56-
### 1.5. <a name='getExperimentEnd'></a>getExperimentEnd
53+
### 1.4. <a name='getExperimentEnd'></a>getExperimentEnd
5754

5855
Wrapper function that will show a fixation cross and display in the console the whole experiment's duration in minutes and seconds
5956

60-
### 1.6. <a name='getResponse'></a>getResponse
57+
### 1.5. <a name='deg2Pix'></a>deg2Pix
58+
59+
For a given field value in degrees of visual angle in the input `structure`,
60+
this computes its value in pixel using the pixel per degree value of the `cfg` structure
61+
and returns a structure with an additional field with Pix suffix holding that new value.
62+
63+
### 1.6. <a name='eyeTracker'></a>eyeTracker
64+
65+
This will handle the Eye Tracker (EyeLink set up) and can be called to initialize the connection and start the calibration, start/stop eye(s) movement recordings and save the `*.edf` file (named with BIDS specification from cpp-lln-lab/CPP_BIDS).
66+
67+
### 1.7. <a name='standByScreen'></a>standByScreen
68+
69+
It shows a basic one-page instruction stored in `cfg.task.instruction` and wait for `space` stroke.
70+
71+
### 1.8. <a name='waitForTrigger'></a>waitForTrigger
72+
73+
Counts a certain number of triggers coming from the mri/scanner before returning.
74+
Requires number of triggers to wait for.
75+
76+
77+
## 2. <a name='Keyboardfunctions:responsecollectionandabortingexperiment'></a>Keyboard functions: response collection and aborting experiment
78+
79+
### 2.1. <a name='testKeyboards'></a>testKeyboards
80+
81+
Checks that the keyboards asked for properly connected.
82+
83+
If no key is pressed on the correct keyboard after the timeOut time this exits with an error.
84+
85+
### 2.2. <a name='getResponse'></a>getResponse
6186

6287
It is wrapper function to use `KbQueue` which is definitely what you should use to collect responses.
6388

@@ -83,29 +108,16 @@ In brief, there are several actions you can execute with this function.
83108
- stop: Stops buffering key presses. You can still restart by calling "start" again.
84109
- release: Closes the buffer for good.
85110

86-
### 1.7. <a name='deg2Pix'></a>deg2Pix
87-
88-
For a given field value in degrees of visual angle in the input `structure`,
89-
this computes its value in pixel using the pixel per degree value of the `cfg` structure
90-
and returns a structure with an additional field with Pix suffix holding that new value.
91-
92-
### 1.8. <a name='drawFixationCross'></a>drawFixationCross
93-
94-
Define the parameters of the fixation cross in `cfg` and `expParameters` and this does the rest.
95-
96-
### 1.9. <a name='eyeTracker'></a>eyeTracker
97-
98-
This will handle the Eye Tracker (EyeLink set up) and can be called to initialize the connection and start the calibration, start/stop eye(s) movement recordings and save the `*.edf` file (named with BIDS specification from cpp-lln-lab/CPP_BIDS).
99-
100-
### 1.10. <a name='pressSpace4me'></a>pressSpace4me
111+
### 2.3. <a name='pressSpace4me'></a>pressSpace4me
101112

102113
Use that to stop your script and only restart when the space bar is pressed.
103114

104-
### 1.11. <a name='standByScreen'></a>standByScreen
115+
## 3. <a name='Fixations'></a>Fixations
105116

106-
It shows a basic one-page instruction stored in `cfg.task.instruction` and wait for `space` stroke.
117+
### 3.1. <a name='drawFixationCross'></a>drawFixationCross
107118

108-
### 1.12. <a name='waitForTrigger'></a>waitForTrigger
119+
Define the parameters of the fixation cross in `cfg` and `expParameters` and this does the rest.
109120

110-
Counts a certain number of triggers coming from the mri/scanner before returning.
111-
Requires number of triggers to wait for.
121+
## 4. <a name='Drawingdots'></a>Drawing dots
122+
123+
## 5. <a name='Drawingapertures'></a>Drawing apertures

miss_hit.cfg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html)
12
line_length: 100
23
regex_function_name: "[a-z]+(([A-Z]){1}[A-Za-z]+)*"
3-
suppress_rule: "copyright_notice"
4+
suppress_rule: "copyright_notice"
5+
6+
# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)
7+
metric "cnest": limit 4
8+
metric "file_length": limit 500
9+
metric "cyc": limit 15
10+
metric "parameters": limit 5

src/cleanUp.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function cleanUp()
1818

1919
% Shut down connection with Eyelink
2020
try
21-
Eyelink('shutdown')
21+
Eyelink('shutdown');
2222
catch
2323
end
2424

0 commit comments

Comments
 (0)