Skip to content

Developer Guide

Purpose

This section explains how to contribute to the RDEToolKit project and set up a development environment. We welcome various forms of contribution, including bug fixes, new feature additions, and documentation improvements.

Types of Contributions

Code Contributions

  • Bug Fixes: Resolving existing issues
  • New Feature Development: Adding and extending functionality
  • Performance Improvements: Optimizing processing speed and memory usage
  • Test Additions: Improving coverage

Documentation Contributions

  • Documentation Improvements: Enhancing quality of existing documentation
  • Translation: Expanding multilingual support
  • Tutorial Creation: Enriching learning resources

Community Contributions

  • Bug Reports: Finding and reporting issues
  • Feature Requests: Proposing new features
  • Answering Questions: Community support

Development Environment Setup

Prerequisites

  • Python: 3.9 or higher
  • Git: Version control
  • Rye: Package management tool

Setup Steps

  1. Clone Repository

    terminal
    1
    2
    git clone https://github.com/nims-dpfc/rdetoolkit.git
    cd rdetoolkit
    

  2. Install Rye

    terminal
    1
    2
    curl -sSf https://rye-up.com/get | bash
    source ~/.rye/env
    

  3. Install Dependencies

    terminal
    1
    rye sync
    

  4. Activate Development Environment

    terminal
    1
    source .venv/bin/activate
    

  5. Setup pre-commit

    terminal
    1
    pre-commit install
    

Development Workflow

Branch Strategy

  • main: Stable main branch
  • feature/: New feature development branches
  • bugfix/: Bug fix branches
  • docs/: Documentation update branches

Development Process

  1. Create or Check Issue
  2. Clarify work content in GitHub Issues
  3. Check if existing Issue exists

  4. Create Branch

    terminal
    1
    git checkout -b feature/your-feature-name
    

  5. Development and Testing

    terminal
    1
    2
    3
    4
    5
    6
    7
    8
    9
    # Make code changes
    # Run tests
    rye test
    
    # Lint check
    rye lint
    
    # Format
    rye fmt
    

  6. Commit and Push

    terminal
    1
    2
    3
    git add .
    git commit -m "feat: add new feature description"
    git push origin feature/your-feature-name
    

  7. Create Pull Request

  8. Create pull request on GitHub
  9. Include detailed description and test results

Coding Standards

Python Style

  • PEP 8: Comply with Python standard style guide
  • Type Hints: Add type annotations to all functions
  • docstring: Use Google-style docstrings
example_function.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
def process_data(
    input_data: List[Dict[str, Any]],
    config: Optional[Config] = None
) -> ProcessResult:
    """
    Function to process data

    Args:
        input_data: List of data to be processed
        config: Processing configuration (optional)

    Returns:
        ProcessResult object containing processing results

    Raises:
        ValueError: When input data is invalid
        ProcessingError: When error occurs during processing

    Example:
        >>> data = [{"key": "value"}]
        >>> result = process_data(data)
        >>> print(result.status)
        'success'
    """
    if not input_data:
        raise ValueError("Input data cannot be empty")

    # Processing logic
    return ProcessResult(status="success")

Writing Tests

test_example.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import pytest
from rdetoolkit.processing import process_data

class TestProcessData:
    def test_valid_input(self):
        """Test with valid input data"""
        data = [{"key": "value"}]
        result = process_data(data)
        assert result.status == "success"

    def test_empty_input(self):
        """Test with empty input data"""
        with pytest.raises(ValueError):
            process_data([])

    def test_invalid_input(self):
        """Test with invalid input data"""
        with pytest.raises(TypeError):
            process_data("invalid")

Quality Assurance

Automated Checks

  • pre-commit: Automatic checks before commit
  • GitHub Actions: CI/CD pipeline
  • codecov: Test coverage measurement

Check Items

  • Lint: flake8, pylint
  • Format: black, isort
  • Type Check: mypy
  • Test: pytest
  • Security: bandit

Release Process

Versioning

Adopts Semantic Versioning (SemVer):

  • MAJOR: Breaking changes
  • MINOR: Backward-compatible feature additions
  • PATCH: Backward-compatible bug fixes

Release Steps

  1. Update Changelog
  2. Update Version Number
  3. Create Tag
  4. Publish to PyPI
  5. Create GitHub Release

Community Guidelines

Communication

  • GitHub Issues: Bug reports and feature requests
  • GitHub Discussions: Questions and discussions
  • Pull Request: Code review and discussion

Code of Conduct

  • Respect: Respect all participants
  • Constructive: Provide constructive feedback
  • Collaborative: Value teamwork
  • Inclusive: Welcome diversity

Next Steps

To participate in development:

  1. Contributing - Detailed contribution guidelines
  2. Documentation Creation - How to create documentation
  3. GitHub Issues - Check available tasks

For First-time Contributors

If you're contributing for the first time, we recommend starting with Issues labeled "good first issue".