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.
Quick Start¶
Get started contributing to FatPy in a few simple steps:
- Fork the Repository
Create a personal copy on GitHub. - Clone Your Fork
- Create a Branch
- Implement the Feature
Write code to pass your tests. - Write Tests for Your Feature
Define expected behavior first. - 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:
- Run Tests and Checks
Ensure tests pass and code quality checks succeed. - Update Documentation
Reflect changes in relevant docs. - Link Issues
Reference related GitHub issues. - Follow guidelines
Make sure your code follows the project's style guidelines. - 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:
GitHub Discussions
Join for community support.Report an Issue
Create an issue on our GitHub repository for bugs or questions.Contact our Team
Visit our contact page.
Thank you for contributing to FatPy!