In this section, we'll give an overview of how the code is structured. This is intended to help orient users and make it easier to contribute. The layout is intended to define the logic of the code and new merge requests should aim to fit within this logic (unless there is a good argument to change it). For example, code which adds a new sampler should not effect the gravitational-wave specific parts of the code. Note that this document is not programatically generated and so may get out of date with time. If you notice something wrong, please open an issue.
### Top level
### Bilby Code Layout
At the top level, the code is split into three modules containing the core, gravitational-wave specific, and hyper-parameter specific functionality. New changes should always respect this
```mermaid
graph TD
bilby[bilby] --> core[.core]
bilby --> gw[.gw]
bilby --> hyper[.hyper]
```
### Core
The core module contains the core inference logic - methods to define a prior, likelihood, and run Bayesian inference.