diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..24bd3aa0 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.css,.codespellrc +check-hidden = true +ignore-regex = ^\s*"image/\S+": ".* +ignore-words-list = idel,dum,sav,alph diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..b026c855 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/analyses/RunLength_2017_04_08/InstallMex.m b/analyses/RunLength_2017_04_08/InstallMex.m index 5d3228b5..7b268179 100644 --- a/analyses/RunLength_2017_04_08/InstallMex.m +++ b/analyses/RunLength_2017_04_08/InstallMex.m @@ -193,7 +193,7 @@ Flags = cat(2, Flags, {'-compatibleArrayDims'}); end -% Define endianess directive: +% Define endianness directive: if isLittleEndian Flags = cat(2, Flags, {'-D_LITTLE_ENDIAN'}); else % Does Matlab run on a big endian machine currently?! diff --git a/analyses/RunLength_2017_04_08/RunLength.c b/analyses/RunLength_2017_04_08/RunLength.c index be0a7690..1f177043 100644 --- a/analyses/RunLength_2017_04_08/RunLength.c +++ b/analyses/RunLength_2017_04_08/RunLength.c @@ -310,7 +310,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) // Create 3rd output as post-processing: ---------------------------------- // Collecting the indices on the fly might be faster, but doing this - // afterwards allowes to allocate the correct number of elements directly: + // afterwards allows to allocate the correct number of elements directly: if (nlhs == 3) { if (isColumn) { plhs[2] = mxCreateDoubleMatrix(nb, 1, mxREAL); diff --git a/analyses/RunLength_2017_04_08/RunLength_M.m b/analyses/RunLength_2017_04_08/RunLength_M.m index 2639a8d1..de70625f 100644 --- a/analyses/RunLength_2017_04_08/RunLength_M.m +++ b/analyses/RunLength_2017_04_08/RunLength_M.m @@ -137,11 +137,11 @@ if vectorized % Vectorized: -------------------------------- len = length(n); % Number of bins - d = cumsum(n); % Cummulated run lengths + d = cumsum(n); % Cumulated run lengths index = zeros(1, d(len)); % Pre-allocate index(d(1:len-1)+1) = 1; % Get the indices where the value changes index(1) = 1; % First element is treated as "changed" also - index = cumsum(index); % Cummulated indices + index = cumsum(index); % Cumulated indices x = b(index); else % Loop: -------------------------------------- diff --git a/analyses/RunLength_2017_04_08/uTest_RunLength.m b/analyses/RunLength_2017_04_08/uTest_RunLength.m index 6a1c0481..f1233ec5 100644 --- a/analyses/RunLength_2017_04_08/uTest_RunLength.m +++ b/analyses/RunLength_2017_04_08/uTest_RunLength.m @@ -140,7 +140,7 @@ function uTest_RunLength(doSpeed) end end - % Test coding with limitting counter to 255: + % Test coding with limiting counter to 255: for k = [1,2,3, 250:260, 500:520, 750:800] % Around multiples of 255 x0 = myCast(ones(1, k), aType); [b, n] = RunLength(x0, 'byte'); diff --git a/analyses/getkin.m b/analyses/getkin.m index 1bb84f1f..afde9dde 100644 --- a/analyses/getkin.m +++ b/analyses/getkin.m @@ -7,7 +7,7 @@ % BOUT_LENRH,BOUT_SPEEDRH,BOUT_LENLH,BOUT_SPEEDLH] = GETKIN(MSRAWDATA,LABELS,GROUP_NUM,FPS) % % INPUTS: -% MSRAWDATA Matrix of the positons of the 6-body parts outlining the rodent over time videotaped from the bottom looking up. +% MSRAWDATA Matrix of the positions of the 6-body parts outlining the rodent over time videotaped from the bottom looking up. % Rows represents time. % Columns 1 & 2 tracks snout; columns 3 to 6 tracks the two front paws; Columns 7 to 10 tracks the two hind paws; % Columns 11 & 12 tracks the base of the tail. Tested on tracking data generated by DeepLabCut 2.0. diff --git a/bsoid/action_gif2.m b/bsoid/action_gif2.m index cb0c615e..0c16f8b0 100644 --- a/bsoid/action_gif2.m +++ b/bsoid/action_gif2.m @@ -4,7 +4,7 @@ % % [T,B,B_EX] = ACTION_GIF2(PNGPATH,GRP,N,N_LEN,FILEPATHOUTRESULTS) outputs classified behaviors based on DeepLabCut analysis % PNGPATH The path to frame-by-frame video from FFmpeg. -% GRP Statistically different gropus based on unsupervised GMM model fitting of action space data. This is the output from BSOID. +% GRP Statistically different groups based on unsupervised GMM model fitting of action space data. This is the output from BSOID. % N Number of sampled video you desire. Default 3. % N_LEN Lower bound for consecutive frames (10fps, 50ms each) for which the video will be generated from. Default 6 (300ms). % X X times speed. Default 0.5. diff --git a/bsoid/bsoid_assign.m b/bsoid/bsoid_assign.m index e3b5d7d6..63d02974 100644 --- a/bsoid/bsoid_assign.m +++ b/bsoid/bsoid_assign.m @@ -14,7 +14,7 @@ % Otherwise, set it to 0 for individual segmentation/.csv file. Default is 1. % SMTH_HSTRY BOXCAR smoothing using number of frames from before. Default ~40ms before. % SMTH_FUTR BOXCAR smoothing using number of frames from after. Default ~40ms after. -% KCLASS Maximum number of assigment classes that the Gaussian Mixture Model will try to parse out. Default 50. +% KCLASS Maximum number of assignment classes that the Gaussian Mixture Model will try to parse out. Default 50. % % OUTPUTS: % F_10FPS Compiled features that were used to cluster, 10fps temporal resolution. diff --git a/bsoid/bsoid_fsml.m b/bsoid/bsoid_fsml.m index cc0f4dd9..0e8ca86d 100644 --- a/bsoid/bsoid_fsml.m +++ b/bsoid/bsoid_fsml.m @@ -4,7 +4,7 @@ % [LABELS_FSALL,F_10FPS_FS] = BSOID_FSML(DATA,BEHV_MDL,FPS,SMTH_HSTRY,SMTH_FUTR) outputs classified behaviors matching your camera's frame-rate % % INPUTS: -% DATA_TEST Matrix of the positons of the 6-body parts outlining the rodent over time videotaped from the bottom looking up. +% DATA_TEST Matrix of the positions of the 6-body parts outlining the rodent over time videotaped from the bottom looking up. % Rows represents time. % Columns 1 & 2 tracks snout; columns 3 to 6 tracks the two front paws; Columns 7 to 10 tracks the two hind paws; % Columns 11 & 12 tracks the base of the tail. Tested on tracking data generated by DeepLabCut 2.0. diff --git a/bsoid/bsoid_mdl2.m b/bsoid/bsoid_mdl2.m index 3265c2f0..acb2dccf 100644 --- a/bsoid/bsoid_mdl2.m +++ b/bsoid/bsoid_mdl2.m @@ -10,7 +10,7 @@ % CV_IT Number of times to run cross-validation on. Default is 30. % % OUTPUTS: -% BEHV_MDL Trained Multi-Class Support Vector Machine (SVM) classifier, based on Guassian kernels. +% BEHV_MDL Trained Multi-Class Support Vector Machine (SVM) classifier, based on Gaussian kernels. % CV_AMEAN Cross-validated accuracy mean. % CV_ASEM Cross-validated accuracy standard error of the mean. % ACC_FIG Accuracy box plot figure showing all the cross validated data points. diff --git a/bsoid/bsoid_svm.m b/bsoid/bsoid_svm.m index 08ffafbd..05841512 100644 --- a/bsoid/bsoid_svm.m +++ b/bsoid/bsoid_svm.m @@ -4,7 +4,7 @@ % [LABELS,F_10FPS_TEST] = BSOID_SVM(DATA_TEST,FPS,MDL) outputs classified behaviors using the output from bsoid_mdl. % % INPUTS: -% DATA_TEST Matrix of the positons of the 6-body parts outlining the rodent over time videotaped from the bottom looking up. +% DATA_TEST Matrix of the positions of the 6-body parts outlining the rodent over time videotaped from the bottom looking up. % Rows represents time. % Columns 1 & 2 tracks snout; columns 3 to 6 tracks the two front paws; Columns 7 to 10 tracks the two hind paws; % Columns 11 & 12 tracks the base of the tail. Tested on tracking data generated by DeepLabCut 2.0. diff --git a/bsoid_app/bsoid_analysis.py b/bsoid_app/bsoid_analysis.py index fbaa2f78..0854a4c2 100644 --- a/bsoid_app/bsoid_analysis.py +++ b/bsoid_app/bsoid_analysis.py @@ -15,7 +15,7 @@ def streamlit_run(pyfile): layout='wide', initial_sidebar_state='auto') local_css("./bsoid_app/bsoid_utilities/style.css") title = "
B-SOID " \ - " anaylsis 📊
" + " analysis 📊 " st.markdown(title, unsafe_allow_html=True) st.markdown('Step 1: Pick the directory and workspace to analyze.') st.markdown('Step 2: Once input, select the type of results to analyze using the sidebar modules.') diff --git a/bsoid_figs/figS4.py b/bsoid_figs/figS4.py index bf5a95a7..d843c033 100644 --- a/bsoid_figs/figS4.py +++ b/bsoid_figs/figS4.py @@ -2,7 +2,7 @@ import subprocess -print('\n \n \n FRAMSHIFT NEURAL DIFFERNCES \n \n \n') +print('\n \n \n FRAMSHIFT NEURAL DIFFERENCES \n \n \n') path = '/Volumes/Elements/Manuscripts/B-SOiD/bsoid_natcomm/workspace/neuralbehavior_durs.mat' fig_format = 'png' outpath = '/Volumes/Elements/Manuscripts/B-SOiD/bsoid_natcomm/figure_panels/neural_data/' diff --git a/bsoid_figs/subroutines/utilities/detect_peaks.py b/bsoid_figs/subroutines/utilities/detect_peaks.py index e113b324..d89abcd0 100644 --- a/bsoid_figs/subroutines/utilities/detect_peaks.py +++ b/bsoid_figs/subroutines/utilities/detect_peaks.py @@ -39,7 +39,7 @@ def detect_peaks(x, mph=None, mpd=1, threshold=0, edge='rising', Returns ------- ind : 1D array_like - indeces of the peaks in `x`. + indices of the peaks in `x`. Notes ----- diff --git a/bsoid_py/config/GLOBAL_CONFIG.py b/bsoid_py/config/GLOBAL_CONFIG.py index da0b42cd..6ffe1227 100644 --- a/bsoid_py/config/GLOBAL_CONFIG.py +++ b/bsoid_py/config/GLOBAL_CONFIG.py @@ -1,4 +1,4 @@ -################### THINGS YOU PROBABLY DONT'T WANT TO CHANGE ################### +################### THINGS YOU PROBABLY DON'T WANT TO CHANGE ################### import logging import sys diff --git a/bsoid_py/train.py b/bsoid_py/train.py index 04571c96..09ce9b97 100644 --- a/bsoid_py/train.py +++ b/bsoid_py/train.py @@ -26,7 +26,7 @@ def bsoid_tsne(data: list, bodyparts=BODYPARTS, fps=FPS, comp=COMP): :param fps: scalar, argument specifying camera frame-rate in LOCAL_CONFIG :param comp: boolean (0 or 1), argument to compile data or not in LOCAL_CONFIG :return f_10fps: 2D array, features - :retrun f_10fps_sc: 2D array, standardized features + :return f_10fps_sc: 2D array, standardized features :return trained_tsne: 2D array, trained t-SNE space """ win_len = np.int(np.round(0.05 / (1 / fps)) * 2 - 1) diff --git a/bsoid_py/utils/likelihoodprocessing.py b/bsoid_py/utils/likelihoodprocessing.py index 8c72b1c5..63d5c914 100644 --- a/bsoid_py/utils/likelihoodprocessing.py +++ b/bsoid_py/utils/likelihoodprocessing.py @@ -133,7 +133,7 @@ def main(folders: list): :param folders: list, data folders :return filenames: list, data filenames :return data: list, filtered data list - :retrun perc_rect: 1D array, percent filtered per BODYPART + :return perc_rect: 1D array, percent filtered per BODYPART """ filenames, data, perc_rect = import_folders(folders) return filenames, data, perc_rect diff --git a/bsoid_umap/config/GLOBAL_CONFIG.py b/bsoid_umap/config/GLOBAL_CONFIG.py index aef86a58..c05c1ebe 100644 --- a/bsoid_umap/config/GLOBAL_CONFIG.py +++ b/bsoid_umap/config/GLOBAL_CONFIG.py @@ -1,4 +1,4 @@ -################### THINGS YOU PROBABLY DONT'T WANT TO CHANGE ################### +################### THINGS YOU PROBABLY DON'T WANT TO CHANGE ################### import logging import sys diff --git a/bsoid_umap/utils/likelihoodprocessing.py b/bsoid_umap/utils/likelihoodprocessing.py index cee512e0..8e6ccc62 100644 --- a/bsoid_umap/utils/likelihoodprocessing.py +++ b/bsoid_umap/utils/likelihoodprocessing.py @@ -133,7 +133,7 @@ def main(folders: list): :param folders: list, data folders :return filenames: list, data filenames :return data: list, filtered data list - :retrun perc_rect: 1D array, percent filtered per BODYPART + :return perc_rect: 1D array, percent filtered per BODYPART """ filenames, data, perc_rect = import_folders(folders) return filenames, data, perc_rect diff --git a/docs/bsoid_mdl.md b/docs/bsoid_mdl.md index 53bde742..0cd7b2c0 100644 --- a/docs/bsoid_mdl.md +++ b/docs/bsoid_mdl.md @@ -29,7 +29,7 @@ function [OF_mdl,CV_amean,CV_asem,acc_fig] = bsoid_mdl(f_10fps,grp,hldout,cv_it, - `CV_AMEAN` Cross-validated accuracy mean. -- `CV_ASEM` Cross-validated accuracy standard error fo the mean. +- `CV_ASEM` Cross-validated accuracy standard error of the mean. - `ACC_FIG` Box plot showing classifier performance with individual data points representing a randomly subsampled test set from the hold out portion. diff --git a/googlecolab/bsoid_v1_2_1.ipynb b/googlecolab/bsoid_v1_2_1.ipynb index ca246c9e..8d904c87 100644 --- a/googlecolab/bsoid_v1_2_1.ipynb +++ b/googlecolab/bsoid_v1_2_1.ipynb @@ -367,7 +367,7 @@ " :param folders: list, data folders\n", " :return filenames: list, data filenames\n", " :return data: list, filtered data list\n", - " :retrun perc_rect: 1D array, percent filtered per BODYPART\n", + " :return perc_rect: 1D array, percent filtered per BODYPART\n", " \"\"\"\n", " filenames, data, perc_rect = import_folders(folders)\n", " return filenames, data, perc_rect\n", @@ -774,7 +774,7 @@ " :param fps: scalar, argument specifying camera frame-rate in LOCAL_CONFIG\n", " :param comp: boolean (0 or 1), argument to compile data or not in LOCAL_CONFIG\n", " :return f_10fps: 2D array, features\n", - " :retrun f_10fps_sc: 2D array, standardized features\n", + " :return f_10fps_sc: 2D array, standardized features\n", " :return trained_tsne: 2D array, trained t-SNE space\n", " \"\"\"\n", " win_len = np.int(np.round(0.05 / (1 / fps)) * 2 - 1)\n",