-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
Thank you for your interest in contributing to the Entropic Measurement project! This guide outlines the guidelines and processes for contributing code, documentation, and other improvements to the project.
- Getting Started
- Code Style Guidelines
- Submitting Pull Requests
- Code Review Process
- Community Standards
- Reporting Issues
- Development Setup
Before contributing, ensure you have:
- A GitHub account
- Git installed on your local machine
- Python 3.8+ installed
- Familiarity with the project's purpose and scope
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/entropic_measurement.git cd entropic_measurement - Add the upstream repository:
git remote add upstream https://github.com/rconstant1/entropic_measurement.git
- PEP 8 Compliance: Follow PEP 8 style guidelines
- Line Length: Maximum 88 characters per line (Black formatter standard)
- Imports: Use absolute imports when possible, group imports logically
-
Naming Conventions:
- Variables and functions:
snake_case - Classes:
PascalCase - Constants:
UPPER_SNAKE_CASE - Private methods: prefix with single underscore
_private_method
- Variables and functions:
- Use Black for code formatting:
black . - Use isort for import sorting:
isort . - Use flake8 for linting:
flake8 .
- Docstrings: Use Google-style docstrings for all public functions and classes
- Type Hints: Include type hints for function parameters and return values
- Comments: Write clear, concise comments explaining complex logic
- README Updates: Update relevant documentation when adding new features
Example docstring format:
def calculate_entropy(data: List[float], method: str = "shannon") -> float:
"""Calculate entropy using the specified method.
Args:
data: List of numerical values for entropy calculation.
method: Entropy calculation method ("shannon", "renyi", etc.).
Returns:
The calculated entropy value.
Raises:
ValueError: If the method is not supported.
"""-
Create a Feature Branch:
git checkout -b feature/your-feature-name
-
Write Tests: Ensure your code includes appropriate unit tests
-
Run the Test Suite: All tests must pass
python -m pytest
-
Check Code Style: Run linting and formatting tools
-
Update Documentation: Add or update relevant documentation
-
Sync with Upstream:
git fetch upstream git rebase upstream/main
-
Push Your Branch:
git push origin feature/your-feature-name
-
Create Pull Request:
- Use a clear, descriptive title
- Include a detailed description of changes
- Reference any related issues using
#issue_number - Add appropriate labels
When creating a pull request, include:
## Description
Brief description of the changes made.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Other (please describe)
## Testing
- [ ] Tests pass locally
- [ ] New tests added for new functionality
- [ ] Documentation updated
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Breaking changes documented- Initial Response: Within 48 hours
- Full Review: Within 1 week for standard PRs
- Complex Reviews: May take longer, reviewers will communicate timeline
Reviewers will evaluate:
-
Code Quality:
- Adherence to style guidelines
- Code readability and maintainability
- Proper error handling
- Performance considerations
-
Testing:
- Adequate test coverage
- Test quality and relevance
- Edge cases covered
-
Documentation:
- Code is well-documented
- API documentation updated
- User-facing changes documented
-
Design:
- Follows project architecture
- Minimal, focused changes
- Backwards compatibility considered
- Respond to all review comments
- Make requested changes promptly
- Ask for clarification if feedback is unclear
- Mark conversations as resolved when addressed
- Request re-review when ready
- Required Approvals: At least 1 approval from a maintainer
- Merge Requirements: All checks must pass
- Merge Method: Squash and merge for feature branches
We are committed to providing a welcoming and inclusive environment. All contributors must adhere to our Code of Conduct.
- Be Respectful: Treat all community members with respect
- Be Constructive: Provide helpful, actionable feedback
- Be Patient: Remember that contributors have varying experience levels
- Be Collaborative: Work together to find the best solutions
- All contributors are recognized in the project's acknowledgments
- Significant contributions may be highlighted in release notes
- Regular contributors may be invited to join the maintainer team
When reporting bugs, include:
- Clear description of the issue
- Steps to reproduce
- Expected vs. actual behavior
- Environment details (OS, Python version, etc.)
- Relevant code snippets or error messages
For new features:
- Describe the proposed functionality
- Explain the use case and benefits
- Consider implementation complexity
- Discuss potential alternatives
Report security vulnerabilities privately to the maintainers. Do not create public issues for security concerns.
-
Install Dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt
-
Pre-commit Hooks (recommended):
pre-commit install
-
Run Tests:
python -m pytest tests/
-
Build Documentation:
cd docs make html
- Create feature branch
- Make changes
- Run tests and linting
- Commit changes with clear messages
- Push and create pull request
- Address review feedback
- Merge when approved
Use conventional commit format:
type(scope): brief description
Longer description if needed
Closes #issue_number
Types: feat, fix, docs, style, refactor, test, chore
If you have questions about contributing:
- Check existing issues and discussions
- Create a new issue with the "question" label
- Reach out to maintainers for guidance
Thank you for contributing to Entropic Measurement! Your efforts help make this project better for everyone.