Skip to content

Creating a new diagnostic

John Krasting edited this page Aug 25, 2021 · 1 revision

The structure of OM4labs looks like:

om4labs
  \-- diags : individual diagnostics
      \-- moc
      \-- seaice
      \-- etc,...
  \-- m6plots : plotting functions
  \-- catalogs : for intake catalogs
  \-- test : for unit tests

where each diagnostic have its own subdirectory. To add a diagnostic, use the following procedure

  1. In om4labs/diags:
~: mkdir mydiag
~: echo from . import mydiag | cat >> __init__.py
  1. In om4labs/diags/mydiag:
~: cat << EOF > __init__.py
from .mydiag import parse_and_run

 __description__ = "diag for whatever I want"
EOF 
  1. Write your custom code in `om4labs/diags/mydiag/mydiag.py`

4. If you use some third-party observation datasets, please consider adding a notebook that reproduces the obs files in the data directory and a checksums file to verify binary reproducibility

5. If you use some third-party observation datasets, please add the corresponding entries to the intake catalogs

Clone this wiki locally