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.
Get started contributing to FatPy in a few simple steps:
- Fork the Repository
Create a personal copy on GitHub. - Clone Your Fork
git clone https://github.com/your-username/FatPy.git # Clone your fork- Create a Branch
git checkout -b my-feature-branch # Create a new branch for your feature- 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.
# 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 installFor detailed configuration of your development environment, see the Installation Guide ➡️
FatPy emphasizes comprehensive testing to ensure code reliability and quality. All contributions should include appropriate tests and maintain high test coverage.
- 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
# 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 ➡️
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 ➡️
# 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-filesKeep 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 ➡️
# Activate project environment
.\{environment_name}\Scripts\activate
# Build and serve documentation locally
mkdocs serveSubmit 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.
All contributors must follow our standards.
Understand our expectations for collaboration, see Code of Conduct ➡️
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!