|
1 | | -<!-- |
2 | | -
|
3 | | -When you have set up your repo |
4 | | -
|
5 | | -**Unit tests and coverage** |
6 | | -
|
7 | | -[](https://github.com/Remi-gau/template_matlab_analysis/actions) |
8 | | - |
9 | | -
|
10 | | -[](https://codecov.io/gh/Remi-gau/template_matlab_analysis) |
11 | | -
|
12 | | -**Miss_hit linter** |
13 | | -
|
14 | | -[](https://travis-ci.com/Remi-gau/template_matlab_analysis) |
15 | | -
|
16 | | ---> |
17 | | - |
18 | 1 | # Template repository for matlab analysis project |
19 | 2 |
|
20 | | -## How to install and use this template |
21 | | - |
22 | | -### Install with Git |
23 | | - |
24 | | -1. Click the green button `Use this template`. |
| 3 | +## Requirements |
25 | 4 |
|
26 | | -1. Give a name to the repository you want to create. Something short that |
27 | | - contains the name of your experiment: `analysis_my_study`. |
| 5 | +- Matlab - version >2017? (Possibly compatible with older versions ; Not tested |
| 6 | + on Octave) |
| 7 | +- LetsWave - version 5 - 7 |
28 | 8 |
|
29 | | -1. Decide if you want this new repo to be public or private. |
| 9 | +- There is a bids-matlab "dependency" as a git sub-module that it will be |
| 10 | + installed automatically if you use the `--recursive` flag when you clone the |
| 11 | + repository (see the `install with git` section below). |
30 | 12 |
|
31 | | -1. Click on `Create repository from template` |
32 | | - |
33 | | -You now have a copy of the template on your Github account. You can then |
34 | | -download the code and the pre-set dependencies like this. |
35 | | - |
36 | | -1. Click on green `Download` button and copy the `URL_to_your_repo` that is |
37 | | - shown there. |
| 13 | +## Install with Git |
38 | 14 |
|
39 | 15 | 1. Open a terminal and type this: |
40 | 16 |
|
41 | 17 | ```bash |
42 | | -git clone --recurse-submodules URL_to_your_repo |
43 | | -``` |
44 | | - |
45 | | -This will set up everything automatically in your current directory. |
46 | | - |
47 | | -## Content |
48 | | - |
49 | | -```bash |
50 | | -├── .git |
51 | | -│ ├── COMMIT_EDITMSG |
52 | | -│ ├── FETCH_HEAD |
53 | | -│ ├── HEAD |
54 | | -│ ├── ORIG_HEAD |
55 | | -│ ├── branches |
56 | | -│ ├── config |
57 | | -│ ├── description |
58 | | -│ ├── hooks |
59 | | -│ │ ├── pre-commit.sample |
60 | | -│ │ └── pre-push.sample |
61 | | -│ ├── ... |
62 | | -│ └── ... |
63 | | -├── .github # where you put anything github related |
64 | | -│ └── workflows # where you define your github actions |
65 | | -│ └── moxunit.yml # a yaml file that defines a github action |
66 | | -├── lib # where you put the code from external libraries (mathworks website or other github repositories) |
67 | | -│ └── README.md |
68 | | -├── src # WHERE YOU PUT YOUR CODE |
69 | | -│ ├── README.md |
70 | | -│ └── miss_hit.cfg |
71 | | -├── docs # where you write your documentation using sphinx |
72 | | -│ ├── make.bat |
73 | | -│ ├── Makefile |
74 | | -│ ├── README.md |
75 | | -│ ├── requirements.txt # to set up the python environment for the doc |
76 | | -│ └── source # the actual reStructured text file for your doc |
77 | | -│ ├── conf.py |
78 | | -│ ├── function_description.rst |
79 | | -│ ├── index.rst |
80 | | -│ ├── _static |
81 | | -│ └── _templates |
82 | | -├── tests # where you put your unit tests |
83 | | -| ├── README.md |
84 | | -| └── miss_hit.cfg |
85 | | -├── .travis.yml # where you define the continuous integration done by Travis |
86 | | -├── LICENSE |
87 | | -├── README.md |
88 | | -├── miss_hit.cfg # configuration file for the matlab miss hit linter |
89 | | -└── initEnv.m # a .m file to set up your project (adds the right folder to the path) |
90 | | -``` |
91 | | - |
92 | | -## Keeping your code stylish: miss hit linter |
93 | | - |
94 | | -### Matlab code style guide and quality |
95 | | - |
96 | | -We use the [MISS_HIT linter](https://github.com/florianschanda/miss_hit/) to |
97 | | -automatically enforce / fix some code style issues and check for code quality. |
98 | | - |
99 | | -The linter is a python package that can be installed with: |
100 | | - |
101 | | -```bash |
102 | | -pip3 install --user miss_hit |
103 | | -``` |
104 | | - |
105 | | -The rules followed by MISS_HIT are in the |
106 | | -[MISS_HIT configuration file](./miss_hit.cfg). |
107 | | - |
108 | | -To check the code style of the whole repository, you can can simply type: |
109 | | - |
110 | | -```bash |
111 | | -mh_style . |
112 | | -``` |
113 | | - |
114 | | -Some styling issues can be automatically fixed by using the `--fix` flag. You |
115 | | -might need to rerun this command several times if there are a lot of issues. |
116 | | - |
117 | | -```bash |
118 | | -mh_style . --fix |
| 18 | +git clone --recurse-submodules https://github.com/cpp-lln-lab/letswave_bids_import.git |
119 | 19 | ``` |
120 | 20 |
|
121 | | -Code quality can be checked with: |
| 21 | +## Usage |
122 | 22 |
|
123 | | -```bash |
124 | | -mh_metric . |
125 | | -``` |
| 23 | +### Add it to the Matlab path. |
126 | 24 |
|
127 | | -To see only the issues that "break" the code quality rules set in the |
128 | | -configuration file, type: |
| 25 | +You can do this by running the `init_env` that is in the root folder of the |
| 26 | +repository. |
129 | 27 |
|
130 | | -```bash |
131 | | -mh_metric . --ci |
132 | 28 | ``` |
| 29 | +this_dir = fileparts(mfilename('fullpath')); |
133 | 30 |
|
134 | | -The code style and quality is also checked during the |
135 | | -[continuous integration](.github/workflows/miss_hit.yml). |
136 | | - |
137 | | -For more information about MISS_HIT see its |
138 | | -[documentation](https://florianschanda.github.io/miss_hit/). |
139 | | - |
140 | | -## Python environment |
141 | | - |
142 | | -More on this |
143 | | -[here](https://the-turing-way.netlify.app/reproducible-research/renv/renv-package.html) |
144 | | - |
145 | | -## Testing your code |
| 31 | +% input and output directory |
| 32 | +cfg.bidsroot = pwd; |
| 33 | +cfg.out_path = fullfile(cfg.bidsroot, 'derivatives'); |
146 | 34 |
|
147 | | -The [MOxUnit testing framework](https://github.com/MOxUnit/MOxUnit) is set up to |
148 | | -run tests automatically for any tests in the `tests` folder. |
| 35 | +initialize_letswave(); |
149 | 36 |
|
150 | | -## Continuous integration |
| 37 | +import_bids(cfg); |
| 38 | +``` |
0 commit comments