pranit / CONTRIBUTING.md
RushiMane2003's picture
Upload 41 files
99f938a verified
# 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
1. **Fork the repository** on GitHub
2. **Clone your fork** locally:
```bash
git clone https://github.com/your-username/autonomous-traffic-control
cd autonomous-traffic-control
```
3. **Create a virtual environment**:
```bash
python -m venv venv
source venv/bin/activate
```
4. **Install development dependencies**:
```bash
pip install -r requirements.txt
pip install black flake8 pytest
```
5. **Create a feature branch**:
```bash
git checkout -b feature/your-feature-name
```
## Development Workflow
### Making Changes
1. Make your changes in your feature branch
2. Follow the code style guidelines (see below)
3. Add tests for new functionality
4. Ensure existing tests pass
5. 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:
```bash
black inference.py validate.py
```
### Testing
Before submitting, run validation:
```bash
# 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
1. **Update your branch** with latest main:
```bash
git fetch origin
git rebase origin/main
```
2. **Push to your fork**:
```bash
git push origin feature/your-feature-name
```
3. **Create a Pull Request** on GitHub with:
- Clear title and description
- Reference to related issues
- Summary of changes
- Test results
4. **Respond to reviews** promptly:
- Address feedback professionally
- Ask for clarification if needed
- Make requested changes
5. **Merge** once approved
## Types of Contributions
### Bug Reports
If you find a bug:
1. Check if it's already reported
2. Provide:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Python/environment version
- Error logs
### Feature Requests
For new features:
1. Check if already requested
2. 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.