Thank you for your interest in contributing to Firecrown! This document provides guidelines and workflows to help you get started.
We recommend using conda (or mamba/miniforge) to manage your development environment.
-
Clone the repository:
git clone https://github.com/LSSTDESC/firecrown.git cd firecrown -
Create and activate the environment:
conda env create -f environment.yml conda activate firecrown_developer
-
Install Firecrown in development mode:
make install
To maintain high code quality and consistency, we use several automated tools. We recommend following this workflow during development:
| Target | Description | When to run |
|---|---|---|
make format |
Automatically format all code using black |
Frequently during development |
make lint |
Run all linters (black, flake8, mypy, pylint) in parallel |
Before every commit |
make test |
Run fast unit tests in parallel | Regularly during development |
make unit-tests |
Run all unit tests with 100% per-component coverage check | Before pushing |
make test-ci |
Run the full test suite exactly as the CI system does | Final check before pushing |
make docs |
Build and verify all documentation (tutorials + API) | When changing tutorials or docstrings |
make pre-commit |
A comprehensive check: format, lint, docs-verify, and full tests | Recommended pre-push check |
Tip
The Makefile automatically runs targets in parallel and detects the number of available CPUs. Use make -j1 <target> to run serially (useful for debugging), or JOBS=N make <target> to override the number of jobs.
For detailed diagrams of how Makefile targets relate to each other, how parallelism
works, and how the CI pipeline is structured, see
CONTRIBUTING_ADVANCED.md.
- Create a Branch: Always work on a new branch for your feature or bug fix.
- Write Tests: Ensure your changes are covered by unit tests. We aim for 100% coverage on new code.
- Verify Locally: Run
make pre-committo ensure everything is in order. - Submit PR: Once your tests pass locally, submit a Pull Request to the
masterbranch. - CI Pipeline: Our CI system will run the full test matrix on Ubuntu and macOS with various Python versions. Your PR must pass all CI checks before it can be merged.
- Use
blackfor formatting. - Follow PEP 8 guidelines (enforced by
flake8). - Use type hints wherever possible (checked by
mypy). - Ensure
pylintpasses without warnings in the relevant packages.