Thanks for your interest in contributing to CYBER! We welcome contributions of all kinds, from bug fixes to new features.
- 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.)
- Join our Discussions for:
- Feature proposals
- Architecture discussions
- Best practices
- Use cases & applications
- Questions & answers
- Bug fixes
- Performance improvements
- Documentation updates
- New features
- Test coverage improvements
- Share new model architectures
- Add model implementations
- Contribute pre-trained checkpoints
- Improve existing models
- Add model benchmarks
- Contribute new datasets
- Add data processing scripts
- Improve data loading
- Share data augmentation techniques
- Add dataset documentation
- Fix typos and clarify explanations
- Add code examples
- Write tutorials
- Create diagrams
- Translate documentation
- Open a Discussion
- Email: [email protected]
- Check existing issues and discussions
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.
-
Fork and Clone
git clone https://github.com/YOUR_USERNAME/Cyber.git cd Cyber
-
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
-
Install Pre-commit Hooks
poetry run pre-commit install
We use several tools to maintain code quality:
-
Ruff for linting and formatting:
- Line length: 160 characters
- Python version: 3.10+
- Auto-fixes available for many issues
- Run:
poetry run ruff check .
-
MyPy for type checking:
- Strict optional checking
- Run:
poetry run mypy .
-
Pre-commit Hooks check:
- Formatting (ruff-format)
- Linting (ruff)
- Type checking (mypy)
- Run manually:
poetry run pre-commit run --all-files
We follow the GitHub Flow for all contributions. Here's a detailed breakdown:
-
Create a Branch
git checkout -b feature/your-feature-name
- Use descriptive branch names (e.g.,
add-vision-model
,fix-memory-leak
) - Create a separate branch for each set of unrelated changes
- Use descriptive branch names (e.g.,
-
Make Changes
- Write clear, documented code
- Add tests for new features
- Update documentation if needed
- Commit and push changes regularly to backup your work
- Each commit should contain an isolated, complete change
-
Quality Checks
# Run all pre-commit hooks poetry run pre-commit run --all-files # Run tests poetry run pytest tests/
- All CI checks must pass
- Code must follow our style guidelines
- Tests must pass
-
Create Pull Request
- Write a clear PR description explaining the changes
- Link related issues using keywords (e.g., "Fixes #123")
- Include screenshots or examples if relevant
- Mark as draft if you want early feedback
- Request reviews from relevant team members
-
Address Reviews
- Respond to all review comments
- Make requested changes
- Push additional commits as needed
- Get required approvals
-
Merge
- PR must have required approvals
- All CI checks must pass
- No merge conflicts
- Squash commits if requested by reviewers
-
Clean Up
- Delete your branch after merging
- Close related issues if not auto-closed
For more detailed information about the GitHub Flow process, please refer to the GitHub Flow documentation.
-
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