Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for building, running and testing benchcab #245

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions docs/dev_docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Developer Guide
## Building
### Dependencies
- conda env
```sh
module load conda
conda env create --name benchcab-dev --file .conda/benchcab-dev.yaml
conda activate benchcab-dev
pip install --user -e .
```

### Dev-Dependencies
- `black`, `ruff`, `autoformatter`

!!! tip
Add a docstring using numpy style. (autodocstring extension in VS Code can pre-populate for you, make sure to select numpy style on settings first).

### Documentation
- mkdocs

```sh
pip install -r mkdocs-requirements.txt
```

!!! tip
Using `mkdocs` on Gadi
Use ssh port forwarding
```sh
ssh -L 8000:localhost:8000 <username>@gadi.nci.org.au
```

```sh
mkdocs serve
```

## Running

Follow the user guide

## Testing
- Static Type Checking `mypy`
- Unit tests `pytest`
- Integration tests
```sh
/bin/bash benchcab/data/test/integration.sh
```

### Comparing Models

```sh
module load <name>
```

Outputs are stored in `$SRC_DIR/runs/outputs/`

- `netcdf`

```sh
ncdump -h
```

- `nccmp`/`cdo` - Bitwise comparison

```sh
cdo </path/to/output1> </path/to/output2>
```

!!! tip
Generally, try to keep a separate copy of `output2` from the `main` branch and `output1` from the feature branch to compare the ouputs, thus checking the validity of integration testing.
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ nav:
- About: index.md
- User Guide:
- user_guide/index.md
- user_guide/dev_docs.md
- user_guide/config_options.md
- user_guide/default_science_configurations.md
- user_guide/running_CABLE_v2.md
- user_guide/expected_output.md
- Developer Guide: dev_docs.md
Loading