Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 2.71 KB

File metadata and controls

61 lines (45 loc) · 2.71 KB

Contributing to Firecrown

Thank you for your interest in contributing to Firecrown! This document provides guidelines and workflows to help you get started.

Development Environment Setup

We recommend using conda (or mamba/miniforge) to manage your development environment.

  1. Clone the repository:

    git clone https://github.com/LSSTDESC/firecrown.git
    cd firecrown
  2. Create and activate the environment:

    conda env create -f environment.yml
    conda activate firecrown_developer
  3. Install Firecrown in development mode:

    make install

Recommended Developer Workflow

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.

Pull Request Process

  1. Create a Branch: Always work on a new branch for your feature or bug fix.
  2. Write Tests: Ensure your changes are covered by unit tests. We aim for 100% coverage on new code.
  3. Verify Locally: Run make pre-commit to ensure everything is in order.
  4. Submit PR: Once your tests pass locally, submit a Pull Request to the master branch.
  5. 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.

Coding Style

  • Use black for formatting.
  • Follow PEP 8 guidelines (enforced by flake8).
  • Use type hints wherever possible (checked by mypy).
  • Ensure pylint passes without warnings in the relevant packages.