Thank you for your interest in contributing to KHGNN! This guide will help you get started.
-
Fork and Clone
git clone https://github.com/your-username/KHGNN.git cd KHGNN -
Install Development Dependencies
uv sync --group dev
-
Install Pre-commit Hooks (Optional but recommended)
uv run pre-commit install
We use automated code formatting tools to maintain consistency:
- Black: Code formatting
- isort: Import sorting
- Files are automatically formatted on save in VS Code
# Format all files
uv run black .
# Format specific files
uv run black filename.py
uv run isort filename.py- Follow PEP 8 guidelines
- Use type hints where possible
- Write docstrings for all public functions and classes
- Keep line length to 88 characters (Black's default)
# Run all tests
uv run pytest
# Run specific test file
uv run pytest tests/test_model.py
# Run with coverage
uv run pytest --cov=khgnnWhen adding new features or modifications:
- Run baseline experiments to ensure reproducibility
- Document performance changes in your PR
- Update configs if adding new parameters
# Run quick validation
uv run example.py
# Run full experiments
uv run trans_multi_train.py
uv run prod_multi_exp.py-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clear, concise commit messages
- Include tests for new features
- Update documentation as needed
-
Ensure quality
# Run tests uv run pytest # Check for issues uv run black --check . uv run isort --check-only .
-
Update documentation
- Update README if adding new features
- Add docstrings to new functions
- Update example scripts if needed
-
Submit PR
- Provide a clear description of changes
- Reference any related issues
- Include before/after performance comparisons if applicable
When reporting bugs, please include:
- Environment details: Python version, PyTorch version, OS
- Reproduction steps: Minimal code to reproduce the issue
- Expected vs actual behavior
- Error messages: Full stack traces if applicable
For new features:
- Check existing issues to avoid duplicates
- Provide motivation: Why is this feature needed?
- Describe the interface: How should it work?
- Consider backwards compatibility
We welcome improvements to documentation:
- Code comments: Explain complex algorithms
- Docstrings: Document all public APIs
- README updates: Keep examples current
- Tutorials: Help new users get started
Current areas where contributions are especially welcome:
- Additional kernel types
- Memory optimization
- Multi-GPU support
- Mixed precision training
- New benchmark datasets
- Hyperparameter optimization
- Ablation studies
- Comparison with other methods
- Continuous integration
- Performance benchmarks
- Docker containers
- Documentation improvements
- Be respectful and constructive in discussions
- Help others learn and contribute
- Follow the code of conduct
- Share knowledge through issues and discussions
- Open an issue for bugs or feature requests
- Start a discussion for questions or ideas
- Check existing issues before creating new ones
Contributors will be acknowledged in:
- README contributor section
- Release notes for significant contributions
- Academic papers (for algorithmic contributions)
Thank you for helping make KHGNN better! 🎉