Spaces:
Sleeping
Sleeping
Contributing to Autonomous Traffic Control
Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project.
Code of Conduct
- Be respectful and inclusive
- Focus on ideas, not personal attacks
- Help others learn and grow
- Report code of conduct violations appropriately
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/autonomous-traffic-control cd autonomous-traffic-control - Create a virtual environment:
python -m venv venv source venv/bin/activate - Install development dependencies:
pip install -r requirements.txt pip install black flake8 pytest - Create a feature branch:
git checkout -b feature/your-feature-name
Development Workflow
Making Changes
- Make your changes in your feature branch
- Follow the code style guidelines (see below)
- Add tests for new functionality
- Ensure existing tests pass
- Update documentation as needed
Code Style
- Follow PEP 8 style guide
- Use type hints for function parameters and returns
- Write docstrings for all functions and classes
- Maximum line length: 120 characters
- Use Black formatter:
black inference.py validate.py
Testing
Before submitting, run validation:
# Full validation
python validate.py
# Skip inference test (if no API credentials)
python validate.py --skip-inference
# Style check
flake8 inference.py
black --check inference.py
Commit Messages
Write clear, descriptive commit messages:
feat: Add support for emergency vehicle priority
fix: Correct queue calculation logic
docs: Update README with deployment steps
style: Format code with Black
test: Add unit tests for phase controller
Use conventional commit types:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- style: Code style
- test: Tests
- refactor: Code refactoring
- perf: Performance improvement
- ci: CI/CD changes
Pull Request Process
Update your branch with latest main:
git fetch origin git rebase origin/mainPush to your fork:
git push origin feature/your-feature-nameCreate a Pull Request on GitHub with:
- Clear title and description
- Reference to related issues
- Summary of changes
- Test results
Respond to reviews promptly:
- Address feedback professionally
- Ask for clarification if needed
- Make requested changes
Merge once approved
Types of Contributions
Bug Reports
If you find a bug:
- Check if it's already reported
- Provide:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Python/environment version
- Error logs
Feature Requests
For new features:
- Check if already requested
- Describe:
- Use case
- Proposed implementation
- Alternatives considered
- Potential impact
Documentation
Help improve documentation:
- Fix typos and clarity
- Add examples
- Improve explanations
- Update outdated info
- Add missing sections
Code Improvements
Contribute improvements:
- Refactoring for clarity
- Performance optimizations
- Better error handling
- Test coverage
- Code organization
Review Process
Pull requests will be reviewed for:
- Functionality: Does it work as intended?
- Tests: Are new features tested?
- Documentation: Is it documented?
- Code Quality: Does it follow guidelines?
- Compatibility: Does it break anything?
License
By contributing, you agree that your contributions will be licensed under the MIT License.
Questions?
- Check existing issues/discussions
- Open a discussion on GitHub
- Contact maintainers
Appreciation
Thank you for contributing to make this project better! Your efforts are greatly appreciated.