Contributing to SpectroChemPy

General Principles

Any kind of contribution is welcome! While we encourage following these guidelines, don’t let them prevent you from contributing. This guide covers both basic contributions like issue reporting and advanced topics like code development.

For information about reporting issues, please see the issues page.

Getting Started with Development

Version Control Setup

  1. Create a GitHub account if you haven’t already

  2. Install Git:

Optional: Install a GUI client like SourceTree or GitHub Desktop

Setting Up Your Development Environment

  1. Fork the repository on GitHub

  2. Clone your fork:

    git clone https://github.com/your-user-name/spectrochempy.git
    cd spectrochempy
    git remote add upstream https://github.com/spectrochempy/spectrochempy.git
    
  3. Create a Python virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate
    
  4. Install SpectroChemPy in development mode:

    python -m pip install --upgrade pip
    python -m pip install -e ".[dev]"  # Installs development and test dependencies
    # or
    python -m pip install -e ".[dev, docs]"  # Installs development, test and documentation dependencies
    

Making Changes

  1. Create a feature branch:

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

    git add modified-files
    git commit -m "ENH: Your descriptive commit message"
    

    Commit prefix conventions: * ENH: Enhancement * FIX: Bug fix * DOC: Documentation * TEST: Testing * BUILD: Build changes * PERF: Performance * MAINT: Maintenance

  3. Push to GitHub:

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

Maintaining Your PR

To update your PR with upstream changes:

git checkout my-new-feature
git fetch upstream
git merge upstream/master
git push origin my-new-feature

Tips for Success

  • Reference related issues

  • Keep changes focused and PRs small

  • Ensure tests pass

  • Update your PR regularly

  • Follow the code style guidelines