Skip to content

Commit b193c78

Browse files
committedMay 3, 2024
add a bit more to project organisation and make dir structure similar to template
1 parent 34ca930 commit b193c78

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed
 

Diff for: ‎content/code-style/organisation.qmd

+15-3
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ author:
1111

1212
# Project Organisation
1313

14+
## Directory Structure
15+
1416
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.
1517

1618
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.
1719

1820
At the very top level of your project, why not have something like the following structure?
1921

2022
```
21-
├── src/ # source code
23+
├── source/ # source code
2224
│ ├── @MyClass/ # a class directory
2325
│ ├── 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
2527
├── data/ # directory to contain your data
2628
│ ├── raw/ # all your raw, unprocessed data
2729
│ └── 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
3436
└── LICENSE # license file (essential)
3537
```
3638

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

Comments
 (0)