You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-style/organisation.qmd
+15-3
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,19 @@ author:
11
11
12
12
# Project Organisation
13
13
14
+
## Directory Structure
15
+
14
16
One thing that makes a project difficult to reproduce is a disorganised project folder. Adhering to a consistent structure convention mitigates others from opening the project folder to find a big heap of confusingly named scripts.
15
17
16
18
Use folders/directories to organise your project, so that it is obvious (to you and anyone else who uses your code) where to find what is needed.
17
19
18
20
At the very top level of your project, why not have something like the following structure?
19
21
20
22
```
21
-
├── src/ # source code
23
+
├── source/ # source code
22
24
│ ├── @MyClass/ # a class directory
23
25
│ ├── a_module/ # a directory containing a group of functions or classes with some commonality
24
-
│ └── utils/ # a directory containing utility functions
26
+
│ └── utils/ # a directory containing utility functions, for example
25
27
├── data/ # directory to contain your data
26
28
│ ├── raw/ # all your raw, unprocessed data
27
29
│ └── processed/ # any data that you have altered
@@ -34,4 +36,14 @@ At the very top level of your project, why not have something like the following
34
36
└── LICENSE # license file (essential)
35
37
```
36
38
37
-
You can make use of a [matlab-project-template](https://github.com/reproducibleMATLAB/matlab-project-template) GitHub repository which contains this directory structure as a template with placeholder information, designed specifically for MATLAB projects.
39
+
This structure follows several conventions that are common across languages, such as keeping a `README` file in the top-level of your project's directory where users expect to find it, keeping your source code in a directory named `source` and your data and outputs separate from the code.
40
+
41
+
::: {.callout-note}
42
+
This type of structure works well for relatively straightforward projects such as a piece of analysis or simulation, but if you're building a package, toolbox or similar, there will be more appropriate and conventional structures to use.
43
+
:::
44
+
45
+
### Templates
46
+
47
+
One way of saving time is to make use of a project template, we have made one available on GitHub here: [matlab-project-template](https://github.com/reproducibleMATLAB/matlab-project-template){target="_blank"} which contains this directory structure as a template with placeholder information, designed specifically for MATLAB projects.
48
+
49
+
If you're not familiar with Git, you can download this repository as a ZIP file, or just make it yourself in your project by creating the relevant directories.
0 commit comments