Skip to content

🚀 Contributing to OpenCyberGlove

Thanks for your interest in contributing to OpenCyberGlove! We welcome contributions of all kinds, from bug fixes to new features.

🌟 Ways to Contribute

1. 🐛 Report Bugs & Issues

  • Use our bug report template when opening issues
  • Include clear reproduction steps
  • Provide environment details (OS, Python version, GPU)
  • Add relevant logs or screenshots
  • Tag issues appropriately (bug, documentation, enhancement, etc.)

2. 💡 Share Ideas & Discussions

  • Join our Discussions for:
  • Feature proposals
  • Best practices
  • Use cases & applications
  • Questions & answers

3. 🔧 Submit Code Changes

  • Bug fixes
  • Performance improvements
  • Documentation updates
  • New features
  • Test coverage improvements

4. 🤖 Contribute Models

  • Share new model architectures
  • Add model implementations
  • Contribute pre-trained checkpoints
  • Improve existing models
  • Add model benchmarks

5. 📚 Improve Documentation

  • Fix typos and clarify explanations
  • Add code examples
  • Write tutorials
  • Create diagrams
  • Translate documentation

💬 Getting Help

  • Open a Discussion
  • Email: contact@cyberorigin.ai
  • Check existing issues and discussions

📜 License

By contributing, you agree that your contributions will be licensed under the BSD 3-Clause License.

🛠️ Development Setup Guide

Environment Setup

  1. Fork and Clone

    git clone https://github.com/YOUR_USERNAME/open_cyber_glove.git
    cd open_cyber_glove
    

  2. Set up Poetry Environment

    # Install poetry if you haven't (see https://python-poetry.org/docs/)
    # IMPORTANT: Poetry should be installed in its own isolated environment, NOT in your project's environment.
    
    # Install dependencies
    poetry install
    
    # Activate the virtual environment
    poetry shell
    

  3. Install Pre-commit Hooks

    poetry run pre-commit install
    

Code Standards

We use several tools to maintain code quality:

  1. Ruff for linting and formatting:
  2. Line length: 160 characters
  3. Python version: 3.7+
  4. Auto-fixes available for many issues
  5. Run: poetry run ruff check .

  6. MyPy for type checking:

  7. Strict optional checking
  8. Run: poetry run mypy .

  9. Pre-commit Hooks check:

  10. Formatting (ruff-format)
  11. Linting (ruff)
  12. Type checking (mypy)
  13. Run manually: poetry run pre-commit run --all-files

PR Workflow

We follow the GitHub Flow for all contributions. Here's a detailed breakdown:

  1. Create a Branch
    git checkout -b feature/your-feature-name
    
  2. Use descriptive branch names (e.g., add-vision-model, fix-memory-leak)
  3. Create a separate branch for each set of unrelated changes

  4. Make Changes

  5. Write clear, documented code
  6. Add tests for new features
  7. Update documentation if needed
  8. Commit and push changes regularly to backup your work
  9. Each commit should contain an isolated, complete change

  10. Quality Checks

    # Run all pre-commit hooks
    poetry run pre-commit run --all-files
    
    # Run tests
    poetry run pytest tests/
    

  11. All CI checks must pass
  12. Code must follow our style guidelines
  13. Tests must pass

  14. Create Pull Request

  15. Write a clear PR description explaining the changes
  16. Link related issues using keywords (e.g., "Fixes #123")
  17. Include screenshots or examples if relevant
  18. Mark as draft if you want early feedback
  19. Request reviews from relevant team members

  20. Address Reviews

  21. Respond to all review comments
  22. Make requested changes
  23. Push additional commits as needed
  24. Get required approvals

  25. Merge

  26. PR must have required approvals
  27. All CI checks must pass
  28. No merge conflicts
  29. Squash commits if requested by reviewers

  30. Clean Up

  31. Delete your branch after merging
  32. Close related issues if not auto-closed

For more detailed information about the GitHub Flow process, please refer to the GitHub Flow documentation.

Best Practices

  • Code Organization
  • Keep files focused and modular
  • Use appropriate directory structure
  • Follow existing patterns

  • Documentation

  • Document new functions/classes
  • Update README if needed
  • Add docstrings in NumPy format

  • Testing

  • Write unit tests for new features
  • Ensure existing tests pass
  • Add integration tests if needed

  • PR Size

  • Keep PRs focused on single changes
  • Split large changes into smaller PRs
  • Aim for reviewable chunks