Contributing

We welcome contributions to redback-jax! This guide will help you get started.

Development Setup

  1. Fork the repository on GitHub

  2. Clone your fork locally:

git clone https://github.com/your-username/redback-jax.git
cd redback-jax
  1. Install in development mode:

pip install -e .[dev]
  1. Install pre-commit hooks:

pre-commit install

Running Tests

Run the test suite:

pytest

Run tests with coverage:

pytest --cov=redback_jax

Code Style

We use several tools to maintain code quality:

  • Black: Code formatting

  • isort: Import sorting

  • flake8: Linting

Format code:

black redback_jax tests
isort redback_jax tests

Check code style:

flake8 redback_jax tests

Documentation

Build documentation locally:

cd docs
make html

The documentation will be available in docs/_build/html/index.html.

Submitting Changes

  1. Create a new branch for your feature:

git checkout -b feature-name
  1. Make your changes and add tests

  2. Ensure all tests pass and code style is correct

  3. Commit your changes with a clear message

  4. Push to your fork and submit a pull request

Guidelines

  • Write tests for new functionality

  • Follow existing code style and conventions

  • Update documentation as needed

  • Keep commits focused and atomic

  • Write clear commit messages