Thank you for your interest in contributing to FracDimPy! This document provides guidelines for contributors.
-
Fork the repository and clone your fork locally
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install in development mode:
pip install -e .[dev]
-
Run tests to ensure everything is working:
pytest
Run all tests:
pytestRun tests with coverage:
pytest --cov=src/fracdimpy --cov-report=term-missingRun specific test files:
pytest tests/monofractal/test_box_counting_curve.pyRun performance benchmarks:
pytest tests/benchmarks/ --benchmark-onlyWe use the following tools to maintain code quality:
- Black for code formatting
- Flake8 for linting
- MyPy for type checking
Format your code:
black src/ tests/Run linting:
flake8 src/Run type checking:
mypy src/- Add tests for your new functionality
- Update documentation with clear examples
- Ensure all tests pass before submitting a pull request
- Follow the existing code style
- Unit tests: Test individual functions in isolation
- Integration tests: Test components working together
- Performance tests: Ensure new features don't significantly impact performance
Aim for >80% test coverage.
- Add docstrings to all public functions following the NumPy style
- Include examples in docstrings
- Update README.md if adding major new features
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and commit them with descriptive messages
-
Push to your fork and create a pull request
-
Fill out the pull request template with:
- Description of changes
- Testing performed
- Any breaking changes
When reporting bugs, please include:
- Python version
- FracDimPy version
- Operating system
- Minimal reproducible example
- Expected vs. actual behavior
By contributing to FracDimPy, you agree that your contributions will be licensed under the GPL-3.0 license.