Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Development

Setting up

git clone https://github.com/torimcd/cesm-hawc
cd cesm-hawc
conda env create -f environment.yml
conda activate hawc_env
pip install -e ".[sim,dev,docs]"

Running the tests

pytest

Tests that need sasktran2 or hawcsimulator are skipped automatically when those aren’t installed, so the base-tier tests run in a minimal environment. Fixture-based tests use the small example column bundled in src/cesm_hawc/data/ and need no external data.

Building the documentation

The documentation is a Jupyter Book project in docs/, configured by docs/myst.yml. Jupyter Book 2 needs Node.js 18 or later.

python docs/generate_api.py   # write the API reference pages
cd docs
jupyter book start            # live preview in the browser
jupyter book build --html     # static site in docs/_build/html

To add a page, create a Markdown (.md) or notebook (.ipynb) file under docs/ and add it to the toc in myst.yml.

API reference

The pages under Python API are generated from the docstrings in src/cesm_hawc by docs/generate_api.py. They are written to docs/reference/api/, which is not committed, so run the script before building. New modules, classes and public functions (names not starting with _) appear automatically.

Docstrings follow the numpydoc format, with units in brackets, e.g. Latitude [degrees]. Check them with:

ruff check src/

Cross-references such as :func:`run_ali_simulation` and :meth:`~cesm_hawc.waccm.WACCMAtmosphere.get_column_profiles` become links between API pages.

Continuous integration

Both run on every pull request and on pushes to main.

Repository layout

PathContents
src/cesm_hawc/The package
tests/Unit tests
scripts/HPC environment setup and the SLURM job script
docs/This documentation
config.example.tomlTemplate configuration

Contributing

Bug reports and pull requests are welcome on GitHub.