diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..02010ec --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = .git,env,*build,lib +ignore-words-list = nwe +builtin = clear,rare diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..b7ab6ff --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +name: codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + # Check for common misspellings + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: codespell-project/actions-codespell@master diff --git a/README.md b/README.md index 0679af6..fb63373 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ their use and their reuse (#DontRepeatYourself) ## Documentation -All the documentation and installtion information is accessible +All the documentation and installation information is accessible [here](https://cpp-ptb.readthedocs.io/en/stable/index.html#). ## Content diff --git a/demos/video/CPP_playVideoFramesDemo.m b/demos/video/CPP_playVideoFramesDemo.m index 294e7e1..4c14b26 100644 --- a/demos/video/CPP_playVideoFramesDemo.m +++ b/demos/video/CPP_playVideoFramesDemo.m @@ -16,19 +16,19 @@ % Skip the PTB sync test Screen('Preference', 'SkipSyncTests', 2); -% Get the screen numbers and draw to the external screen if avaliable +% Get the screen numbers and draw to the external screen if available cfg.screen.idx = max(Screen('Screens')); % Set the PTB window background manually cfg.color.background = [127 127 127]; -% Get the screen numbers and draw to the external screen if avaliable +% Get the screen numbers and draw to the external screen if available cfg.screen.idx = max(Screen('Screens')); % Open an on screen window [cfg.screen.win, cfg.screen.winRect] = Screen('OpenWindow', cfg.screen.idx, cfg.color.background); -%% Strcuture for video related info +%% Structure for video related info % The name of your "video" and its images format video.names = {'coffee', 'leaves'}; @@ -39,7 +39,7 @@ % video.frame.numbers = 30; % video.frame.numbers = [30,15]; -% The format fo the images +% The format of the images video.frame.format = '.jpeg'; % can be any img format compatible with the "imread" function % the folder where the images are (from the current folder) @@ -70,7 +70,7 @@ video.frame.number = video.frame.numbers; end - % Read the images and create the stucture with their textures + % Read the images and create the structure with their textures [video, cfg] = createFramesTextureStructure(video, cfg); % Play the video diff --git a/manualTests/test_dotMotionSimulation.m b/manualTests/test_dotMotionSimulation.m index a4712d1..f32fd3b 100644 --- a/manualTests/test_dotMotionSimulation.m +++ b/manualTests/test_dotMotionSimulation.m @@ -28,7 +28,7 @@ function test_dotMotionSimulationStatic() end function test_dotMotionSimulationTranslation() - % ensure that dog homogenity is not too low when we kill dots often enough + % ensure that dog homogeneity is not too low when we kill dots often enough nbEvents = 500; doPlot = false; diff --git a/src/aperture/apertureTexture.m b/src/aperture/apertureTexture.m index ef16222..939e1d4 100644 --- a/src/aperture/apertureTexture.m +++ b/src/aperture/apertureTexture.m @@ -148,7 +148,7 @@ cycleDuration = cfg.mri.repetitionTime * cfg.volsPerCycle; - % Update angle for rotation of background and for apperture for wedge + % Update angle for rotation of background and for aperture for wedge switch cfg.direction case '+' diff --git a/src/aperture/eccenLogSpeed.m b/src/aperture/eccenLogSpeed.m index 49a6d85..85fd44d 100644 --- a/src/aperture/eccenLogSpeed.m +++ b/src/aperture/eccenLogSpeed.m @@ -38,7 +38,7 @@ (outerRimVA + exp(1))) * maxEcc * csFuncFact; outerRimPix = newOuterRimVA * cfg.screen.ppd; % in pixel - % width of apperture changes logarithmically with eccentricity of inner ring + % width of aperture changes logarithmically with eccentricity of inner ring oldScaleInnerVA = outerRimVA - ringWidthVA; if oldScaleInnerVA < 0 oldScaleInnerVA = 0; diff --git a/src/dot/reseedDots.m b/src/dot/reseedDots.m index cc0bcc0..3ee71fc 100644 --- a/src/dot/reseedDots.m +++ b/src/dot/reseedDots.m @@ -14,7 +14,7 @@ % Create a logical vector to detect any dot that has: % - an xy position inferior to 0 % - an xy position superior to winWidth - % - has exceeded its liftime + % - has exceeded its lifetime % - is on the fixation cross % - has been been picked to be killed diff --git a/src/dot/setDotDirection.m b/src/dot/setDotDirection.m index a6ca3dd..e26923c 100644 --- a/src/dot/setDotDirection.m +++ b/src/dot/setDotDirection.m @@ -29,7 +29,7 @@ directionAllDots = dots.direction; - % when we initialiaze the direction for all the dots + % when we initialize the direction for all the dots % after that dots.direction will be a vector if numel(directionAllDots) == 1 @@ -52,7 +52,7 @@ %% Express the direction in the 0 to 360 range directionAllDots = mod(directionAllDots, 360); - % ensure we return a colum vector + % ensure we return a column vector if size(directionAllDots, 1) == 1 directionAllDots = directionAllDots'; end diff --git a/src/eyeTracker.m b/src/eyeTracker.m index 6978798..77359d8 100755 --- a/src/eyeTracker.m +++ b/src/eyeTracker.m @@ -1,6 +1,6 @@ function [el, cfg] = eyeTracker(input, cfg, varargin) % - % Wrapper function that deals with all the necessery actions to implement + % Wrapper function that deals with all the necessary actions to implement % Eye Tracker recording with eyelink. % % USAGE: @@ -69,7 +69,7 @@ % Initialize EL and make sure it worked: returns 0 if OK, -1 if error. - % Check that EL is initialzed and connected, otherwise abort experiment + % Check that EL is initialized and connected, otherwise abort experiment eyetrackerCheckConnection; % Open the edf file to write the data. @@ -277,7 +277,7 @@ error([newline 'Eyelink is not connected, aborted.']); end - % Initialize Eyelink system and connection: returns 1 when succesful, 0 + % Initialize Eyelink system and connection: returns 1 when successful, 0 % otherwise if ~EyelinkInit(0, 1) Eyelink('shutdown'); @@ -323,7 +323,7 @@ % 'Start_Ret_', ... % 'Subj_', cfg.Subj, '_', ... % 'Run', num2str(cfg.Session(end)), '_', ... -% cfg.Apperture, '_', ... +% cfg.Aperture, '_', ... % cfg.Direction]); % iViewX('incrementsetnumber', ivx, 0); % end @@ -342,7 +342,7 @@ % strFile = fullfile(OutputDir, ... % [cfg.Subj, ... % '_run', num2str(cfg.Session(end)), '_', ... -% cfg.Apperture, '_', ... +% cfg.Aperture, '_', ... % cfg.Direction, '_', ... % thedatestr, '.idf"']); % iViewX('datafile', ivx, strFile); diff --git a/src/initPTB.m b/src/initPTB.m index a3fa688..170acab 100644 --- a/src/initPTB.m +++ b/src/initPTB.m @@ -34,7 +34,7 @@ pth = fileparts(mfilename('fullpath')); addpath(genpath(fullfile(pth, 'src'))); - % For octave: to avoid displaying messenging one screen at a time + % For octave: to avoid displaying messaging one screen at a time more off; % Resets the seed of the random number generator @@ -58,7 +58,7 @@ % Make sure we have black splash screen Screen('Preference', 'VisualDebugLevel', 1); - % Get the screen numbers and draw to the external screen if avaliable + % Get the screen numbers and draw to the external screen if available cfg.screen.idx = max(Screen('Screens')); if isfield(cfg.screen, 'resolution') @@ -81,7 +81,7 @@ cfg.screen.FOV = computeFOV(cfg); cfg.screen.ppd = cfg.screen.winWidth / cfg.screen.FOV; - % Initialize visual parmaters for fixation cross or dot + % Initialize visual parameters for fixation cross or dot cfg = initFixation(cfg); %% Select specific text font, style and size @@ -205,7 +205,7 @@ function initDebug(cfg) cfg.audio.channels); % set initial PTB volume for safety (participants can adjust this manually - % at the begining of the experiment) + % at the beginning of the experiment) PsychPortAudio('Volume', cfg.audio.pahandle, cfg.audio.initVolume); end @@ -222,7 +222,7 @@ function initDebug(cfg) Screen('OpenWindow', cfg.screen.idx, cfg.color.background); end - % Enable alpha-blending, set it to a blend equation useable for linear + % Enable alpha-blending, set it to a blend equation usable for linear % superposition with alpha-weighted source. % Required for drwing smooth lines and screen('DrawDots') Screen('BlendFunction', cfg.screen.win, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/src/keyboard/checkAbort.m b/src/keyboard/checkAbort.m index b0fb258..4ad7c5b 100644 --- a/src/keyboard/checkAbort.m +++ b/src/keyboard/checkAbort.m @@ -4,7 +4,7 @@ function checkAbort(cfg, deviceNumber) % ``cfg.keyboard.escapeKey``. % When no deviceNumber is set then it will check the default device. % When an abort key is detected this will throw a - % specific error that can then be catched. + % specific error that can then be caught. % % USAGE:: % diff --git a/src/keyboard/getResponse.m b/src/keyboard/getResponse.m index 59d2cc5..85b6d47 100644 --- a/src/keyboard/getResponse.m +++ b/src/keyboard/getResponse.m @@ -32,7 +32,7 @@ % as a structure with field names that make it easier % to save the output of in a BIDS format % - % - ``responseEvents.onset`` this is an absolute value and you should substract + % - ``responseEvents.onset`` this is an absolute value and you should subtract % the "experiment start time" to get a value relative to when the experiment was started. % % - ``responseEvents.trial_type = response`` @@ -99,7 +99,7 @@ % If you use ListenChar(2), this will prevent you from using KbQueue. ListenChar(-1); - % Clean and realease any queue that might be opened + % Clean and release any queue that might be opened KbQueueRelease(deviceNumber); keysOfInterest = setKeysOfInterest(cfg.keyboard); diff --git a/src/utils/setUpRand.m b/src/utils/setUpRand.m index aeef98d..d3dd680 100644 --- a/src/utils/setUpRand.m +++ b/src/utils/setUpRand.m @@ -17,7 +17,7 @@ function setUpRand() seed = sum(100 * clock); try - % Use the reccomended method in modern Matlab + % Use the recommended method in modern Matlab RandStream.setGlobalStream(RandStream('mt19937ar', 'seed', seed)); disp('Using modern randomizer...'); catch diff --git a/tests/test_initDots.m b/tests/test_initDots.m index 004b37b..43018e6 100644 --- a/tests/test_initDots.m +++ b/tests/test_initDots.m @@ -37,7 +37,7 @@ function test_initDotsBasic() [dots] = initDots(cfg, thisEvent); - %% Undeterministic ouput + %% Undeterministic output assertTrue(all(dots.positions(:) >= 0)); assertTrue(all(dots.positions(:) <= 50)); assertTrue(all(dots.time(:) >= 0)); diff --git a/tests/test_setDotDirection.m b/tests/test_setDotDirection.m index f0ac0a4..a142516 100644 --- a/tests/test_setDotDirection.m +++ b/tests/test_setDotDirection.m @@ -11,7 +11,7 @@ function test_setDotDirectionInit() % create 5 coherent dots with direction == 362 (that should give 2 in the % end) - % also creates additonal dots with random direction between 0 and 360 + % also creates additional dots with random direction between 0 and 360 nbDots = 10; @@ -34,7 +34,7 @@ function test_setDotDirectionInit() function test_setDotDirectionReturn() % make sure that if the directions are already set it only changes that of % the noise dots - % input has 4 signal dots with set directions also has additonal noise dots + % input has 4 signal dots with set directions also has additional noise dots % with negative direction nbDots = 8; diff --git a/tests/test_setTargetPositionInSequence.m b/tests/test_setTargetPositionInSequence.m index bac85e5..431e7c7 100644 --- a/tests/test_setTargetPositionInSequence.m +++ b/tests/test_setTargetPositionInSequence.m @@ -18,7 +18,7 @@ function test_setTargetPositionInSequenceBasic() nbTarget = 3; forbiddenPos = [1 5 10]; - % Create a hundred draws of targer positiona and ensure that + % Create a hundred draws of target positiona and ensure that % - the forbidden position are never drawn % - the interval between target is superior to 1 for i = 1:100