Contributing Guideο
Thank you for your interest in contributing to this project! This guide will help you get started with contributing to our research software.
Getting Startedο
Development Environment Setupο
Fork and Clone: Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/YOUR-USERNAME/[REPO-NAME].git cd [REPO-NAME]
Create Development Environment:
# Option A: Using conda/mamba (recommended) conda env create -f environment.yml conda activate [project-name] pip install -e . # Option B: Using pip pip install -r requirements-dev.txt pip install -e .
Install Pre-commit Hooks:
pre-commit install
Development Workflowο
1. Create a Branchο
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description
2. Code Quality Standardsο
We maintain high code quality standards with automated tools:
3. Running Testsο
# Run all tests
pytest
# Run specific test types using markers
pytest -m "not slow" # Skip slow tests
pytest -m "unit" # Run only unit tests
pytest -m "integration" # Run only integration tests
# Run tests with coverage
pytest --cov=template_project --cov-report term-missing
4. Code Quality Checksο
Before committing, run the full quality check suite:
# Format code
black .
# Check and fix linting issues
ruff check --fix .
# Run all pre-commit hooks
pre-commit run --all-files
5. Scientific Validationο
For contributions involving scientific calculations:
Reference Methods: Cite published methods or established practices
Validation: Include test cases with known reference values
Units: Ensure proper handling of units and coordinate systems
Documentation: Document assumptions and limitations
Types of Contributionsο
Bug Fixesο
Use the π Bug Report template
Include minimal reproducible example
Reference any related issues
New Featuresο
Use the π‘ Feature Request template first for discussion
Include scientific motivation and use cases
Ensure backward compatibility where possible
Scientific Accuracy Issuesο
Use the π¬ Scientific Accuracy template
Provide references to correct methods
Include validation data or test cases
Documentationο
Follow existing structure and style
Include examples where appropriate
Update API documentation for code changes
Pull Request Processο
1. Title Conventionο
Use one of these prefixes:
[FEAT]- New features[FIX]- Bug fixes[DOC]- Documentation updates[REFACTOR]- Code improvements[TEST]- Tests[CI]- CI/CD updates[CLEANUP]- General maintenance
2. Description Templateο
Fill out the pull request template completely, including:
Summary and motivation
Type of change checklist
Testing verification
Documentation updates
Scientific validation (if applicable)
3. Review Processο
All PRs require at least one review
Automated checks must pass (tests, linting, type checking)
Scientific contributions may require domain expert review
Research Software Engineering Best Practicesο
Version Controlο
Conventional Commits: Use clear, descriptive commit messages
Atomic Commits: One logical change per commit
Branch Protection: Main branch requires PR approval
Documentationο
Code Documentation: NumPy-style docstrings
User Documentation: Clear examples and tutorials
Scientific Documentation: Reference methods and assumptions
Testingο
Unit Tests: Test individual functions and methods
Integration Tests: Test component interactions
Scientific Tests: Validate against known results
Coverage Target: Aim for >80% test coverage
Reproducibilityο
Environment Files: Keep environment.yml and requirements.txt updated
Seed Values: Use fixed random seeds in tests
Version Pinning: Pin critical dependencies
Scientific Citation Guidelinesο
When contributing scientific functionality:
Literature Review: Research existing methods and implementations
Method Documentation: Clearly document the scientific approach
Reference Implementation: Compare against established tools where possible
Uncertainty Quantification: Document limitations and error bounds
Reproducible Examples: Provide complete working examples
Getting Helpο
Documentation: Check our comprehensive docs
Discussions: Use GitHub Discussions for questions
Issues: Report bugs or request features via GitHub Issues
Code Review: Ask questions during the review process
Recognitionο
All contributors are recognized in our project documentation. Significant contributions will be acknowledged in publications that use this software.
Thank you for contributing to open research software! π