Code style

Follow the Duck Book guidance on:

This contains recommendations on (amongst other things) naming conventions, style and formatting.

Tips
  • We recommend using Black to apply PEP-8 formatting Python code.
  • RStudio can reformat your R code automatically (Ctrl-Shift-A by default).

Reproducible analysis pipelines

You should structure your project so that:

  • raw data is read-only,
  • all your outputs are disposable,
  • (if possible) a small number of commands can re-run all your analysis and reproduce all the outputs from scratch.
Tip

In some situations it can be difficult to produce an easily reproducible pipeline. For example when using HPC, code often needs to be run across different systems and different environments. This is fine – just ensure there is enough documentation so that it is technically possible for someone to reproduce your work.