Skip to main content

Contributing

We welcome contributions to MCGrad! 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/MCGrad.git
    cd MCGrad
  3. Install development dependencies:

    pip install -e ".[dev]"
  4. Set up pre-commit hooks:

    pip install pre-commit
    pre-commit install
    pre-commit install --hook-type pre-push

Code Quality

We use several tools to maintain code quality:

  • flake8 - Code linting
  • pytest - Unit tests

Run all checks:

pre-commit run --all-files

Running Tests

pytest src/mcgrad/tests/ -v

With coverage:

pytest src/mcgrad/tests/ --cov=mcgrad --cov-report=html

Submitting Changes

  1. Create a new branch:

    git checkout -b my-feature
  2. Make changes and commit:

    git add .
    git commit -m "Description of changes"
  3. Push to your fork:

    git push origin my-feature
  4. Open a Pull Request on GitHub

Pull Request Guidelines

  • Include tests for new functionality
  • Update documentation as needed
  • Ensure all tests pass
  • Follow the existing code style
  • Write clear commit messages

Documentation

To build the documentation locally:

cd website
npm install
npm start

This will start a local dev server at http://localhost:3000.

License

By contributing, you agree that your contributions will be licensed under the MIT license.