### Site Tools

analysis:nsb2019:week1

# Differences

This shows you the differences between two versions of the page.

 analysis:nsb2019:week1 [2021/06/14 13:03]mvdm analysis:nsb2019:week1 [2022/06/24 11:25] (current)mvdm Both sides previous revision Previous revision 2022/06/24 11:25 mvdm 2022/06/23 16:45 mvdm 2021/06/14 15:30 mvdm 2021/06/14 13:03 mvdm 2021/06/14 11:51 mvdm 2019/06/30 16:12 mvdm 2019/06/30 16:12 mvdm 2019/06/28 10:41 amarek 2019/06/27 07:27 amarek 2019/06/27 07:26 amarek 2019/06/27 07:26 amarek 2019/06/24 17:21 amarek created Next revision Previous revision 2022/06/24 11:25 mvdm 2022/06/23 16:45 mvdm 2021/06/14 15:30 mvdm 2021/06/14 13:03 mvdm 2021/06/14 11:51 mvdm 2019/06/30 16:12 mvdm 2019/06/30 16:12 mvdm 2019/06/28 10:41 amarek 2019/06/27 07:27 amarek 2019/06/27 07:26 amarek 2019/06/27 07:26 amarek 2019/06/24 17:21 amarek created Line 1: Line 1: - ~~DISCUSSION~~ - ==== Module 1: Setting up ==== ==== Module 1: Setting up ==== Line 34: Line 32: === Cloning the module codebase === === Cloning the module codebase === - Now we are ready to use Git to create a local copy ("​clone"​) of the module codebase. On Windows, open a PowerShell, which you can do by typing ''​PowerShell''​ in the search box of the Start menu. Once open, note your working directory (displayed at the prompt of your now opened shell), and change it to a different location if you prefer, using the cd command. Once you are in an appropriate location, such as a new folder named ''​GitHub''​ on your local machine, type ''​git clone https://​github.com/​vandermeerlab/​nsb2021'',​ which will create a new folder ''​nsb2021''​ in your working directory. + Now we are ready to use Git to create a local copy ("​clone"​) of the module codebase. On Windows, open a PowerShell, which you can do by typing ''​PowerShell''​ in the search box of the Start menu. Once open, note your working directory (displayed at the prompt of your now opened shell), and change it to a different location if you prefer, using the cd command. Once you are in an appropriate location, such as a new folder named ''​GitHub''​ on your local machine, type ''​git clone https://​github.com/​vandermeerlab/​nsb2022'',​ which will create a new folder ''​nsb2022''​ in your working directory. - Now, verify that the above steps have resulted in the creation of a ''​nsb2021''​ folder with various subfolders and files in it, indicating that you have a local copy of the codebase. Because Git is tracking the contents of this folder, it is now easy to "​pull"​ the latest version from %%GitHub%%: + Now, verify that the above steps have resulted in the creation of a ''​nsb2022''​ folder with various subfolders and files in it, indicating that you have a local copy of the codebase. Because Git is tracking the contents of this folder, it is now easy to "​pull"​ the latest version from %%GitHub%%: <​code>​ <​code>​ Line 50: Line 48: First, if you haven'​t "done a pull" recently, do one now before starting the next step. First, if you haven'​t "done a pull" recently, do one now before starting the next step. - Open the ''​README.md''​ file in the ''​nsb2021''​ folder. The ''​.md''​ extension is for %%Markdown%%,​ a lightweight set of commands to format text (syntax reference is [[https://​help.github.com/​articles/​markdown-basics | here]]). + Open the ''​README.md''​ file in the ''​nsb2022''​ folder. The ''​.md''​ extension is for %%Markdown%%,​ a lightweight set of commands to format text (syntax reference is [[https://​help.github.com/​articles/​markdown-basics | here]]). - Add your name to the list, and save the file. Then navigate to the ''​nsb2021''​ repository in a shell and type ''​git status''​. Git should notice the change, but it says that this change is not yet "​staged for commit"​. In other words, git is not tracking this file. Let's fix this: + Add your name to the list, and save the file. Then navigate to the ''​nsb2022''​ repository in a shell and type ''​git status''​. Git should notice the change, but it says that this change is not yet "​staged for commit"​. In other words, git is not tracking this file. Let's fix this: <​code>​ <​code>​ Line 59: Line 57: ​ - If you now do a ''​git status''​ you will see that you are ahead of the origin (the online repository) by 1 commit. This makes sense because you just made a change. Let's push this by doing ''​git push''​. If you get an "​access denied"​ type error, let me (mvdm) know and I will give you permission. If everything goes to plan you should now be able to see the updated README file [[https://​github.com/​vandermeerlab/​nsb2021| on GitHub]]. + If you now do a ''​git status''​ you will see that you are ahead of the origin (the online repository) by 1 commit. This makes sense because you just made a change. Let's push this by doing ''​git push''​. If you get an "​access denied"​ type error, let me (mvdm) know and I will give you permission. If everything goes to plan you should now be able to see the updated README file [[https://​github.com/​vandermeerlab/​nsb2022| on GitHub]]. A schematic of these basic operations (pull, commit, push) is shown below, using the amazing [[https://​www.dokuwiki.org/​plugin:​graphviz|DokuWiki plugin]] for [[http://​www.graphviz.org/​|GraphViz]]:​ A schematic of these basic operations (pull, commit, push) is shown below, using the amazing [[https://​www.dokuwiki.org/​plugin:​graphviz|DokuWiki plugin]] for [[http://​www.graphviz.org/​|GraphViz]]:​ Line 75: Line 73: === Using GitHub to acquire the FieldTrip toolbox === === Using GitHub to acquire the FieldTrip toolbox === - Using your experience from the previous section, create a local clone of the [[https://​github.com/​fieldtrip/​fieldtrip|FieldTrip toolbox]]. If you are using the command line (shell), make sure that you ''​cd''​ to your %%GitHub%% folder, i.e. that you are not within some other project such as ''​nsb2021'',​ before cloning. If things worked correctly you should have ''​fieldtrip''​ and ''​nsb2021''​ folders within your %%GitHub%% folder; **not** a ''​fieldtrip''​ folder within your ''​nsb2021''​ folder! + Using your experience from the previous section, create a local clone of the [[https://​github.com/​fieldtrip/​fieldtrip|FieldTrip toolbox]]. If you are using the command line (shell), make sure that you ''​cd''​ to your %%GitHub%% folder, i.e. that you are not within some other project such as ''​nsb2022'',​ before cloning. If things worked correctly you should have ''​fieldtrip''​ and ''​nsb2022''​ folders within your %%GitHub%% folder; **not** a ''​fieldtrip''​ folder within your ''​nsb2022''​ folder! This toolbox is useful for the analysis of local field potential (LFP) data. Be aware that it is about 1.2GB in size! This toolbox is useful for the analysis of local field potential (LFP) data. Be aware that it is about 1.2GB in size! Line 88: Line 86: restoredefaultpath;​ clear classes; % start with a clean slate restoredefaultpath;​ clear classes; % start with a clean slate - cd('​D:​\My_Documents\GitHub\nsb2021\code-matlab\shared'​);​ % or, wherever your code is located -- NOTE \shared subfolder! + cd('​D:​\My_Documents\GitHub\nsb2022\code-matlab\shared'​);​ % or, wherever your code is located -- NOTE \shared subfolder! p = genpath(pwd);​ % create list of all folders from here p = genpath(pwd);​ % create list of all folders from here addpath(p); addpath(p); Line 100: Line 98: This ensures that whenever you click this button, you have a clean **path** (the set of folders, other than the current working directory, whose contents MATLAB can access) of only the MATLAB default plus your local versions of the two %%GitHub%% repositories. This ensures that whenever you click this button, you have a clean **path** (the set of folders, other than the current working directory, whose contents MATLAB can access) of only the MATLAB default plus your local versions of the two %%GitHub%% repositories. - :!: When setting your path in MATLAB to add the ''​shared''​ folder only and //not// a parent folder such as ''​nsb2019''​. Adding the entire ''​nsb2019''​ folder will result in an error when you try to run the LoadCSC command later in the module! + :!: When setting your path in MATLAB to add the ''​shared''​ folder only and //not// a parent folder such as ''​nsb2022''​. Adding the entire ''​nsb2022''​ folder will result in an error when you try to run the LoadCSC command later in the module! Optional: if you don't like the ''​.git''​ folders in your path, you can get clever with [[http://​www.mathworks.com/​help/​matlab/​matlab_prog/​regular-expressions.html|regular expressions]] to remove these: Optional: if you don't like the ''​.git''​ folders in your path, you can get clever with [[http://​www.mathworks.com/​help/​matlab/​matlab_prog/​regular-expressions.html|regular expressions]] to remove these: