Skip to content

🀝 Contributing to FatPy

Thank you for considering contributing to FatPy, a Python package for fatigue life evaluation of materials, part of the FABER project! Your contributions help improve open source tools for fatigue analysis. Start with these steps to make an impact.

πŸ” Learn About FABER

πŸš€ Quick Start

Get started contributing to FatPy in a few simple steps:

  1. Fork the Repository
    Create a personal copy on GitHub.
  2. Clone Your Fork
git clone https://github.com/your-username/FatPy.git  # Clone your fork
  1. Create a Branch
git checkout -b my-feature-branch  # Create a new branch for your feature
  1. Implement the Feature
    Write code to pass your tests.
  2. Write Tests for Your Feature
    Define expected behavior first.
  3. Submit a Pull Request
    Share your changes for review.

πŸ›  Development Setup

Setting Up Your Environment

# Clone the repository
git clone https://github.com/your-username/FatPy.git
cd FatPy

# Using uv (recommended)
uv venv
.venv\Scripts\activate  # On Unix: source .venv/bin/activate
uv sync
uv pip install -e .
pre-commit install

# Using pip
python -m venv venv
venv\Scripts\activate  # On Unix: source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .
pre-commit install

For detailed configuration of your development environment, see the Installation Guide ➑

πŸ§ͺ Testing

FatPy emphasizes comprehensive testing to ensure code reliability and quality. All contributions should include appropriate tests and maintain high test coverage.

Testing Guidelines

  • Write comprehensive tests - Cover all functionality with unit and integration tests
  • Test edge cases - Include boundary conditions and error scenarios
  • Maintain test coverage - Aim for high coverage to ensure reliability
  • Keep tests updated - Update tests when modifying existing functionality
  • Use clear test names - Write descriptive test names and docstrings

Running Tests

# Run all tests
pytest

# Run specific test file
pytest tests/core/test_specific_module.py

# Test with coverage report
pytest --cov=src/fatpy --cov-report=html

For more details, see the Testing Guide ➑

πŸ’» Coding Standards

FatPy aims for high code quality utilizing these tools:

  • Ruff - Linting and formatting for consistent code style.
  • MyPy - Static type checking for reliability.
  • Pre-commit - Automated checks before commits.

Follow our coding standards for contributions, see Code Style Guide ➑

Running Code Quality Checks

# Run linting
ruff check .

# Apply fixes automatically
ruff check --fix .

# Format code
ruff format .

# Run type checking
mypy .

# Run pre-commit on all files
pre-commit run --all-files

πŸ“ Documentation

Keep FatPy’s documentation clear and up-to-date with these guidelines:

  • API Changes
    Update documentation for any API modifications.
  • Docstrings
    Add docstrings following Google style to all new code.
  • Examples
    Include examples and mathematical formulas where helpful to aid users.

Learn best practices and guidelines for documentation, see Documentation Guide ➑

Building Documentation

# Activate project environment
.\{environment_name}\Scripts\activate

# Build and serve documentation locally
mkdocs serve

πŸ”ƒ Pull Request Process

Submit a high-quality pull request with these steps:

  1. Run Tests and Checks
    Ensure tests pass and code quality checks succeed.
  2. Update Documentation
    Reflect changes in relevant docs.
  3. Link Issues
    Reference related GitHub issues.
  4. Follow guidelines
    Make sure your code follows the project's style guidelines.
  5. Await Review
    Respond to feedback from maintainers.

πŸ“– Code of Conduct

All contributors must follow our standards.

Understand our expectations for collaboration, see Code of Conduct ➑

πŸ’‘ Ideas and Questions

Join discussion, create an issue or reach out to maintainers:

Thank you for contributing to FatPy!