Contributing#
We welcome contributions to pyRadtran! Whether it’s bug reports, documentation improvements, or new features — every contribution helps.
Development Setup#
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/pyRadtran.git cd pyRadtran
Install in development mode with dev dependencies:
pip install -e '.[dev]'
Set up your
~/.pyradtran/config.yaml(see Installation)
Running Tests#
pyRadtran uses pytest with markers to separate tests by type:
# Run all unit tests (no libRadtran installation needed)
python run_tests.py --unit
# Run integration tests (requires libRadtran)
python run_tests.py --integration
# Run all tests with coverage report
python run_tests.py --coverage
# Run fast tests only (skip slow integration tests)
python run_tests.py --fast
# Or use pytest directly
pytest -m unit
pytest -m "not slow"
Code Style#
We use the following tools for code formatting and linting:
black for code formatting (line length: 88)
isort for import sorting (black-compatible profile)
flake8 for linting
Before submitting a PR, run:
black pyradtran/
isort pyradtran/
flake8 pyradtran/
Notebook Guidelines#
The Jupyter notebooks in book/notebooks/ are the core of the documentation. When contributing or editing notebooks:
Always include a title as the first markdown cell:
# Quickstart: Topic Nameor# Advanced: Topic NameAdd an introduction — 1–3 sentences explaining what the notebook demonstrates
Use section headings (
## Setup,## Configuration,## Running the Simulation,## Results) to structure the notebookNever hardcode absolute paths — use
config_path=Path('config/...')with configs inbook/notebooks/config/Use the canonical API:
ds.pyradtran.run(config_path=...)— notrun_uvspec()Add result interpretation cells — explain what the reader should observe in the output/plots
Clear all cell outputs before committing — the Jupyter Book build will re-execute them
Note required datasets — if a notebook needs non-public data, add an admonition at the top
Documentation#
Documentation is built using Jupyter Book:
# Build the documentation
jupyter-book build book/
# View locally
open book/_build/html/index.html
Pull Requests#
Create a feature branch from
mainMake your changes with clear commit messages
Ensure tests pass:
python run_tests.py --unitSubmit a pull request against the
mainbranchDescribe what your PR does and link any related issues