Skip to content

Latest commit

 

History

History
125 lines (85 loc) · 2.5 KB

File metadata and controls

125 lines (85 loc) · 2.5 KB

Contributing to FracDimPy

Thank you for your interest in contributing to FracDimPy! This document provides guidelines for contributors.

Development Setup

  1. Fork the repository and clone your fork locally

  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install in development mode:

    pip install -e .[dev]
  4. Run tests to ensure everything is working:

    pytest

Running Tests

Run all tests:

pytest

Run tests with coverage:

pytest --cov=src/fracdimpy --cov-report=term-missing

Run specific test files:

pytest tests/monofractal/test_box_counting_curve.py

Run performance benchmarks:

pytest tests/benchmarks/ --benchmark-only

Code Style

We 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/

Adding New Features

  1. Add tests for your new functionality
  2. Update documentation with clear examples
  3. Ensure all tests pass before submitting a pull request
  4. Follow the existing code style

Testing Requirements

  • 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.

Documentation

  • Add docstrings to all public functions following the NumPy style
  • Include examples in docstrings
  • Update README.md if adding major new features

Submitting Pull Requests

  1. Create a feature branch:

    git checkout -b feature/your-feature-name
  2. Make your changes and commit them with descriptive messages

  3. Push to your fork and create a pull request

  4. Fill out the pull request template with:

    • Description of changes
    • Testing performed
    • Any breaking changes

Issue Reporting

When reporting bugs, please include:

  • Python version
  • FracDimPy version
  • Operating system
  • Minimal reproducible example
  • Expected vs. actual behavior

License

By contributing to FracDimPy, you agree that your contributions will be licensed under the GPL-3.0 license.